Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Deleting a part from a model
Deleting a part from a model [message #1067452] Mon, 08 July 2013 19:03 Go to next message
Patrick Rusk is currently offline Patrick RuskFriend
Messages: 35
Registered: June 2012
Member
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 19:09 Go to previous messageGo to next message
Patrick Rusk is currently offline Patrick RuskFriend
Messages: 35
Registered: June 2012
Member
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 19:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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 08:08 Go to previous messageGo to next message
Phill Perryman is currently offline Phill PerrymanFriend
Messages: 214
Registered: July 2009
Senior Member
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 08:45 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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 11: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: Tue Mar 19 11:19:41 GMT 2024

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

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

Back to the top