Skip to main content



      Home
Home » Eclipse Projects » BPMN 2.0 Modeler » JbpmEmptyPropertySection is not working?
JbpmEmptyPropertySection is not working? [message #1009164] Thu, 14 February 2013 10:15 Go to next message
Eclipse UserFriend
Hi.

I'm able to understand the intention behind this:
<propertyTab
 id="bpmn2.jbpm.empty.tab"
 replaceTab="org.eclipse.bpmn2.modeler.main.tab"
class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property.JbpmEmptyPropertySection"
label="Empty">
</propertyTab>


Which I think it is to replace the "base" tab with
id = "org.eclipse.bpmn2.modeler.main.tab" for one which is not applicable, this means it removes the tab.

My first doubt comes with the fact I can't find a tab with this id, so nothing to be removed.
My second doubt is because I tried this mecanism to remove process definitions tab in my extension, and it doesn't remove the tab definitions.

I'll analyse the code to check what is happening, or if I'm mistaken.

Thanks in advance
Rui
Re: JbpmEmptyPropertySection is not working? [message #1009202 is a reply to message #1009164] Thu, 14 February 2013 11:43 Go to previous messageGo to next message
Eclipse UserFriend
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 11:46] by Moderator

Re: JbpmEmptyPropertySection is not working? [message #1009575 is a reply to message #1009202] Fri, 15 February 2013 05:37 Go to previous message
Eclipse UserFriend
Bug Filed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=400906

Thanks
Rui Domingues
Previous Topic:Bind ComboObjectEditor to property extension
Next Topic:Unable to connect to repository on Eclipse 3.6.2
Goto Forum:
  


Current Time: Wed Jul 23 01:48:37 EDT 2025

Powered by FUDForum. Page generated in 0.24149 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top