Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDetaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799328/#msg_1799328
I'm just trying to figuring out how much is the buildin support for detaching a Part from it's enclosing PartStack. The detached part should be transfered into a new window and if the window is closed, it should be rearranged into the original tab pane of the part stack.
I already did the following:
- added the DndAddon
- set the system property -Ddetachdrag.enabled=true
- provided a dummy DndService which just returns true in the methods
detachAllowed
handleDetach
The tab can now be moved, but nothing happens. So, I got the following questions:
1. Is the DndService responsible for creating the new window and move the Node to the new window?
2. Who is removing the tab from the PartStack if the "detach" is handeled?
3. How is the reparenting be handled?
4. The most important question: Is there a implementation for this service. Found nothing in the sources.
If I would get the right hints, I would try to provide an implementation later.
Thanks, for the support
Thomas
]]>Thomas Fahrmeyer2018-12-04T20:06:13-00:00Re: Detaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799329/#msg_1799329
]]>Thomas Fahrmeyer2018-12-04T20:06:40-00:00Re: Detaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799330/#msg_1799330
b) if you provide a DNDService you need to handle the detaching yourself if you return true from handleDetach() yourself - the default method simply calls EModelService#detach
c) no there's no default implementation - if there's no custom impl the default implemented in the DNDAddon is used => so take a look there to find out how the default works ;-)
Something NOT supported out of the box is the reattaching upon window close you need to implement this yourself - the best options for it is to use the lifecycle support for model-elements and provide an implementation method annotated with @PreClose]]>Thomas Schindl2018-12-04T20:55:07-00:00Re: Detaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799337/#msg_1799337
I got it, it works!
The only minor thing discovered so far ist, that the CleanUpAddon is removing the PartStack or better said makes it not findable via modelService.find() because the parent is set to null, if the last child was removed.
Our situation is, that the PartStack should remain as placeholder and is used to add parts programmatically. Therefore we need to find the stack. But thats not a big deal.
Cool stuff ;)
Thanks,
Thomas]]>Thomas Fahrmeyer2018-12-05T08:19:34-00:00Re: Detaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799372/#msg_1799372
Thomas Schindl2018-12-05T19:03:35-00:00Re: Detaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799421/#msg_1799421
In my opionion the implementation is not fully consistent. In the CleanUpAddon is the method handleChildrenModified() which handling removals of children of the part stack. The other method is handleRenderingChanged() handling changes of the toBeRendered flag of a MUIElement.
My current understanding is as follows:
If I would clear all children of a part stack (which we do) the handleChildrenModified() method is call. The flag tobeRendered is set to false (because there is only one stack) . That triggers handleRenderingChanged() and would respect the property IPresentationEngine.NO_AUTO_COLLAPSE. That prevents the container from set to invisible. That is ok. BUT in handleChildrenModified() the parent of the container is to null. That is, in my opinion, inconsistent, because the part is now not findable via
modelService.find() methods.
Shouldn't the property IPresentationEngine.NO_AUTO_COLLAPSE be respected there as well?
If the property NO_AUTO_COLLAPSE is set, I would expect, that the part is fully unchanged, even if it has no children anymore. Is that a missunderstanding?
Thanks
Thomas
]]>Thomas Fahrmeyer2018-12-06T14:09:22-00:00Re: Detaching a Part from PartStack now available?
https://www.eclipse.org/forums/index.php/mv/msg/1096493/1799461/#msg_1799461
Thomas Schindl2018-12-07T08:02:41-00:00