Community
Participate
Working Groups
From bugzilla 110616: There is an issue in the application when the active entry of a palette stack is one that was removed in a call to setChildren(). This could be fixed if setChildren() was overridden in PaletteStack to call checkActiveEntry() after the new children were set. ------- Additional Comment #3 From Randy Hudson 2005-10-13 11:29 [reply] ------- 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).
So you hijack bug 110616 and then reopened a new bug reporting the same problem?? I guess we'll this one now :-)
Created attachment 85737 [details] Patch to fix problem I have made the change discussed in the comments so that PaletteStack.setChildren() also calls checkActiveEntry(). Randy's second comment also indicates that there is a problem where the active entry is not updated if it becomes hidden. There is a use case to reproduce this problem... The Customize Palette dialog does not allow the user to hide individual stack items. I think it should. When I changed this in the Customize Palette dialog, I realized that the problem is that if the active entry is hidden, then the entire stack is hidden. The rest of the changes in this patch address this issue. To summarize the changes: - PaletteStack now listens to all its children and when it receives notification that the active entry has been hidden it calls checkActiveEntry() to update the active entry. - checkActiveEntry() has been updated to also check the visibility of the entries. - The changes in PaletteStackEditPart are required in the scenario where all the stack's children were hidden and then one becomes visible.
Anthony, this one is ready for a code review. It affects the Customize Palette capability that I added in GMF.
Looks ok, committed to HEAD
Created attachment 85994 [details] patch to fix NPE I should have added a null check on the active entry in the PaletteStack.checkActiveEntry() method.
Anthony, can you commit the attached patch?
Committed the fix to HEAD.