Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Deleting a part from a model
Deleting a part from a model [message #1067452] Mon, 08 July 2013 15:03 Go to next message
Eclipse UserFriend
I have a situation where I use the PartService's createPart() method to create a part from a PartDescriptor. The PartDescriptor indicates that the part is "multiple", "closeable", and "dirtyable".

My problem is that when I then close the part, I see in the workbench.xmi that there is still an entry for the part, with toBeRendered="false". That orphaned entry isn't really doing me any good because I don't want to retrieve it again.

Is there a way I can tell the model to remove the part entirely when it is closed? I'm sure there must be, but I can't find the API in either the EPartService or EModelService.

Thank you.
Re: Deleting a part from a model [message #1067453 is a reply to message #1067452] Mon, 08 July 2013 15:09 Go to previous messageGo to next message
Eclipse UserFriend
My, how often the answer comes just after posting to a forum....

Calling setParent(null) on the part did the trick.
Re: Deleting a part from a model [message #1067457 is a reply to message #1067453] Mon, 08 July 2013 15:29 Go to previous messageGo to next message
Eclipse UserFriend
The real solution is to tag the part with "removeOnHide" and the
framework will remove the instance from the model when closed.

Tom

On 08.07.13 21:09, Patrick Rusk wrote:
> My, how often the answer comes just after posting to a forum....
>
> Calling setParent(null) on the part did the trick.
Re: Deleting a part from a model [message #1067515 is a reply to message #1067457] Tue, 09 July 2013 04:08 Go to previous messageGo to next message
Eclipse UserFriend
I put removeOnHide into eclipse help (F1) but it finds no matches. Is there a list of these tags somewhere. I am assuming I just add it to the Tags on the supplementary tag of the part descriptor.
Re: Deleting a part from a model [message #1067528 is a reply to message #1067515] Tue, 09 July 2013 04:45 Go to previous messageGo to next message
Eclipse UserFriend
It is on the EPartService. I currently don't know if this is documented
in the wiki else this should be done there. Naturally also the tooling
should know the tags available - you should file a bug against it unless
there's already one.

Tom

On 09.07.13 10:08, Phill Perryman wrote:
> I put removeOnHide into eclipse help (F1) but it finds no matches. Is
> there a list of these tags somewhere. I am assuming I just add it to the
> Tags on the supplementary tag of the part descriptor.
Re: Deleting a part from a model [message #1067565 is a reply to message #1067528] Tue, 09 July 2013 07:09 Go to previous message
Eclipse UserFriend
On 07/09/2013 10:45 AM, Tom Schindl wrote:
> Naturally also the tooling
> should know the tags available - you should file a bug against it unless
> there's already one.


https://bugs.eclipse.org/393870

M.
Previous Topic:[Kepler] Cannot resolve org.eclipse.e4.ui.model.application.*
Next Topic:Discouraged Access
Goto Forum:
  


Current Time: Fri Jul 25 20:20:18 EDT 2025

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

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

Back to the top