Community
Participate
Working Groups
1) Detach a part stack containing multiple views from main window 2) DnD one view in detached window stack into new part stack within same detached window 3) Minimize the original part stack in the detached window 4) DnD the view of the remaining part stack into main window a) CleanupAddon removes sash from detached window b) Detached window is set invisible (CleanupAddon response to sash toBeRendered set to false) 5) All views in detached window are lost permanently in that perspective A solution is to avoid removing the sash of a detached window when the sash's last stack is minimized... CleanupAddon... @Inject @Optional private void subscribeTopicChildren(@UIEventTopic(UIEvents.ElementContainer.TOPIC_CHILDREN) Event event) { ... // if a sash container has only one element then remove // it and move // its child up to where it used to be... MUIElement theChild = container.getChildren().get(0); MElementContainer<MUIElement> parentContainer = container.getParent(); // ...unless its parent is a detached window // and its last remaining part stack is minimized if (parentContainer != null && parentContainer.getParent() != null && !theChild.getTags().contains(IPresentationEngine.MINIMIZED)) { int index = parentContainer.getChildren().indexOf(container); ... }
Darrel, can you please provide a Gerrit patch? Thanks!
(In reply to darrel karisch from comment #0) > 1) Detach a part stack containing multiple views from main window > 2) DnD one view in detached window stack into new part stack within same > detached window > 3) Minimize the original part stack in the detached window > 4) DnD the view of the remaining part stack into main window > a) CleanupAddon removes sash from detached window > b) Detached window is set invisible (CleanupAddon response to sash > toBeRendered set to false) > 5) All views in detached window are lost permanently in that perspective > > A solution is to avoid removing the sash of a detached window when the > sash's last stack is minimized... > > CleanupAddon... > @Inject > @Optional > private void > subscribeTopicChildren(@UIEventTopic(UIEvents.ElementContainer. > TOPIC_CHILDREN) Event event) { > ... > > // if a sash container has only one element then remove > // it and move > // its child up to where it used to be... > MUIElement theChild = container.getChildren().get(0); > MElementContainer<MUIElement> parentContainer = container.getParent(); > // ...unless its parent is a detached window > // and its last remaining part stack is minimized > if (parentContainer != null && parentContainer.getParent() != null > && !theChild.getTags().contains(IPresentationEngine.MINIMIZED)) { > int index = parentContainer.getChildren().indexOf(container); > ... > } I erred a bit with the logic to identify a detached window. replace... parentContainer != null && parentContainer.getParent() != null with... !(modelService.getContainer(parentContainer) instanceof MPerspective) thus the updated modification... // if a sash container has only one element then remove // it and move // its child up to where it used to be... MUIElement theChild = container.getChildren().get(0); MElementContainer<MUIElement> parentContainer = container.getParent(); // ...unless its remaining part stack element is minimized // and its parent is a detached window if (!theChild.getTags().contains(IPresentationEngine.MINIMIZED) && !(modelService.getContainer(parentContainer) instanceof MPerspective)) { int index = parentContainer.getChildren().indexOf(container);
(In reply to Andrey Loskutov from comment #1) > Darrel, can you please provide a Gerrit patch? Thanks! Darrel, can you provide a *Gerrit* patch *please*?
Created attachment 272556 [details] Defect Demo Task List view lost permanently
Created attachment 272557 [details] Bug Fix similar to embedded suggestion The situation is a bit more complex than the test case. Consider three tiled stacks (e.g. vertically) in a detached window: detached window sash1 / \ stack1 sash2 / \ *stack2 *stack3 *where stack2 and stack3 are minimized DnD stack1 back to the main window. sash1 is unrendered and removed in CleaunAddon.subscribeTopicChildren. unrendering sash1 leads to CleaunAddon.subscribeRenderingChanged which sets sash1's parent, the detached window, invisible since the window has no immediate visible and rendered children. Tthis leaves the parts in stack2 and stack3 unreachable. Hence, the additional check for detached window in subscribeRenderingChanged.
New Gerrit change created: https://git.eclipse.org/r/116796
My testing with the proposed fix does not reveal any unintentional side-effects or defects with stickyFolderRight or any other container in the main window.
Changing subscribeTopicChildren code is unnecessary. The change to subscribeRenderingChanged in the diff attachment is sufficient to fix the problem.
Thanks, Darrel.
Gerrit change https://git.eclipse.org/r/116796 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=62f65f5d869c6920d5945d21558bfb9560fb5f7b