Community
Participate
Working Groups
Steps to reproduce: 1. Create a palette provider that contributes a new palette tool to an existing palette stack. Match this provider to a capability. 2. Enable the capability and set this palette tool as the active one on the stack. 3. Disable the capability. RESULT: The entire palette stack disappears. Only the palette tool that was added should have disappeared. The palette stack reappears when the diagram is reopened.
Changing component to "Runtime Diagram"
I am transfering this to GEF. The GMF layer is adding/removing entries from the palette depending on whether a capability is enabled or disabled. The GMF layer is basically updating the list of children of a palette container (adding/removing palette entries), by calling setChildren() on the palette container with the new list of children. There is an issue in the application when the active entry is one that was removed in the call to setChildren(). This could be fixed if setChildren() was overridden in PaletteStack to call checkActiveEntry() after the new children were set.
1) The "on top" entry should get updated whenever remove or setChildren gets called, or when the on-top entry becomes hidden. If setChildren is called, I think it is valid to just reset the on top entry to be the first child. To avoid this behavior clients should just remove the items individually. 2) In general, we should verify that removing or hiding the active entry results in the default entry being selected (or null if no default).
In my case, the "on top" entry may still be in the list of children being set in which case I want it to remain as the "on top" entry. I only want the "on top" entry to change to the first entry if the previous "on top" entry is not in the list of new children. However, now that I think about it more, I should probably be using the add(index, entry) and remove API instead recreating the children list myself. I think I will change this on my end afterall, but the first point made my Randy still stands. I will confirm that removing that active entry (Randy's second point) works as it should (looking at the code I think it will).
Created attachment 28309 [details] PaletteService and PaletteServiceTest patches Contributed by: Cherie Mahoney
See attached patch. Purpose: Bugzilla 110616 Palette stack is removed if active tool gets removed after capability is disabled. - PaletteService.updatePaletteContainerEntries was replacing the list of children in a palette container with a new merged list that I was creating based on the new content and existing content. The call to PaletteStack.setChildren() was not resetting the active entry. - I changed the method so that setChildren() is no longer used. Instead, I am adding and removing palette entries using the add/remove API. - Added more test scenarios to PaletteServiceTests. Activities: Bugzilla 110616 gmf_head sshaw 051014 Palette stack is removed if active tool gets removed after capability is disabled Code Reviewed by: Steve How tested: JUnit Tests: diagram.ui: 65/65
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug