Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[bpmn2-modeler-dev] Tab deletion (with JbpmEmptyPropertyTab)


Hi
.

Supposing JbpmEmptyPropertySection is being used to replace an existing tab
, which I think it's not, because the replaceId doesnt exist,
I believe
the remotion of a tab (by this via)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)) {
    // 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".
On another hand,
IF it was replaced (setting doReplaceTab=true, appliesTo=true), when execution reaches 
the code below
it
would set empty to false, and it would be removed, because the tab contains the EmptySection
where appliesTo=true


[code]
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;
}
}
[/code]


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
, and it is not remover


Should I file a bug?

Thanks
Rui
Domingues

Back to the top