Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Detaching a Part from PartStack now available?
Detaching a Part from PartStack now available? [message #1799328] Tue, 04 December 2018 20:06 Go to next message
Thomas Fahrmeyer is currently offline Thomas FahrmeyerFriend
Messages: 30
Registered: July 2009
Location: Germany
Member
Hi,

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

Re: Detaching a Part from PartStack now available? [message #1799329 is a reply to message #1799328] Tue, 04 December 2018 20:06 Go to previous messageGo to next message
Thomas Fahrmeyer is currently offline Thomas FahrmeyerFriend
Messages: 30
Registered: July 2009
Location: Germany
Member
I forgot to mention that we are using efxclipse 3.4.1.
Re: Detaching a Part from PartStack now available? [message #1799330 is a reply to message #1799329] Tue, 04 December 2018 20:55 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
a) you also need the CleanUpAddon who cleans up after your drag operations
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
Re: Detaching a Part from PartStack now available? [message #1799337 is a reply to message #1799330] Wed, 05 December 2018 08:19 Go to previous messageGo to next message
Thomas Fahrmeyer is currently offline Thomas FahrmeyerFriend
Messages: 30
Registered: July 2009
Location: Germany
Member
Thanks Tom, for you very fast reply.

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

[Updated on: Wed, 05 December 2018 08:22]

Report message to a moderator

Re: Detaching a Part from PartStack now available? [message #1799372 is a reply to message #1799337] Wed, 05 December 2018 19:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
well then tag it with IPresentationEngine.NO_AUTO_COLLAPSE and the cleanup addon will skip it from removal when empty
Re: Detaching a Part from PartStack now available? [message #1799421 is a reply to message #1799372] Thu, 06 December 2018 14:09 Go to previous messageGo to next message
Thomas Fahrmeyer is currently offline Thomas FahrmeyerFriend
Messages: 30
Registered: July 2009
Location: Germany
Member
OK, found it.

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
Re: Detaching a Part from PartStack now available? [message #1799461 is a reply to message #1799421] Fri, 07 December 2018 08:02 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I haven't looked it up now. If you think there's a bug file a ticket with a reproduce and we see if it needs fixing ;-)
Previous Topic:Running e(fx)eclipse on Java 11
Next Topic:"View details" buttons on home page point to the wrong places
Goto Forum:
  


Current Time: Tue Mar 19 05:49:23 GMT 2024

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

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

Back to the top