|
Re: JbpmEmptyPropertySection is not working? [message #1009202 is a reply to message #1009164] |
Thu, 14 February 2013 16:43 |
Rui Domingues Messages: 194 Registered: October 2010 |
Senior Member |
|
|
Hi again.
Supposing JbpmEmptyPropertySection is being used to replace an existing tab,
I believe this could not work because in PropertyTabDescriptor, when replacements are being analysed the replacement only happens when methods appliesTo and doReplaceTab return true, which in the case of "JbpmEmptyPropertySection" only "doReplaceTab" returns true.
for (String id : replacements) {
for (Bpmn2SectionDescriptor s : (List<Bpmn2SectionDescriptor>) d.getSectionDescriptors()) {
if (s.appliesTo(part, selection)) { //false
// ask the section if it wants to replace this tab
if (s.doReplaceTab(id, part, selection)) {
// replace the tab whose ID is specified as "replaceTab" in this tab.
Bpmn2TabDescriptor replacedTab = TargetRuntime.findTabDescriptor(id);
if (replacedTab!=null) {
replaced.add(replacedTab);
int i = desc.indexOf(replacedTab);
if (i>=0) {
desc.set(i, d);
}
}
}
}
This causes that the base tab is not replaced in "desc" by the new "empty one".
On another hand, if it was replaced (setting doReplaceTab=true, appliesTo=true), when execution reaches at the code below, it would set empty to false, and it would be removed, because the tab contains a EmptySection
for (Bpmn2TabDescriptor d : desc) {
boolean empty = true;
for (Bpmn2SectionDescriptor s : (List<Bpmn2SectionDescriptor>) d.getSectionDescriptors()) {
if (s.appliesTo(part, selection)) {
empty = false;
}
if (s.getSectionClass() instanceof AdvancedPropertySection) {
advancedPropertyTab = d;
}
}
So there's here some game around the returns of the methods (appliesTo, doReplaceTab). On one hand if they return false it doesnt enter in the first crucial point, on other hand, if they return true the replacement run but tab is considered not empty.
Should I file a bug?
Thanks
Rui
[Updated on: Thu, 14 February 2013 16:46] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03501 seconds