Modify dialog warning message
Posted: Wed Sep 12, 2018 12:35 am
Hello,
I'm modifying the filteredElements to delete a task child element when trying to insert into a task topic context (as well for a reference and a concept) as follow:
It is working fine, it doesn't allow me to introduce an invalid child for the topic in the Author mode and I'm getting the following message when attempt to do it:
I need to edit that dialog to send a custom message, how can I do it?
I'm modifying the filteredElements to delete a task child element when trying to insert into a task topic context (as well for a reference and a concept) as follow:
Code: Select all
public List<CIElement> filterElements(final List<CIElement> elements,
final WhatElementsCanGoHereContext context) {
List<CIElement> filteredElements = super.filterElements(elements, context);
if ((context != null) && (filteredElements != null)) {
Stack<ContextElement> elementStack = context.getElementStack();
if(elementStack != null) {
ContextElement contextElement = context.getElementStack().peek();
String contextName = contextElement.getQName();
//compare with the topic element
if(TOPIC_ELEMENTS.contains(contextName)) {
for(Iterator<CIElement> iterator = filteredElements.iterator(); iterator.hasNext();) {
CIElement element = iterator.next();
//remove invalid element
if(contextName.equals(element.getQName()))
{
filteredElements.remove(element);
break;
}
}
}
}
}
return filteredElements;
}
I need to edit that dialog to send a custom message, how can I do it?