Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Close part programmatically
Close part programmatically [message #995244] Sat, 29 December 2012 14:07 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 109
Registered: July 2009
Senior Member
When I click to close a part, the associated contribution object @PreDestroy is called.

To close a part programmatically I found:
part.getParent().getChildren().remove(part);


This closes the part, but the @PreDestroy in the contribution object is not called. It is then called on application close.

How to make this right?

thanks
Frank

Re: Close part programmatically [message #995249 is a reply to message #995244] Sat, 29 December 2012 14:20 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 109
Registered: July 2009
Senior Member
Nevermind...
partService.hidePart(part, true);

does it.

thanks Frank
Re: Close part programmatically [message #1743931 is a reply to message #995249] Tue, 20 September 2016 17:48 Go to previous message
Arun Velusamy is currently offline Arun VelusamyFriend
Messages: 3
Registered: May 2016
Junior Member
Thanks Frank. You saved my day!!!
Previous Topic:HTTP Proxy Authentication Required
Next Topic:multiple instances of an eclipse 4 application project
Goto Forum:
  


Current Time: Wed Dec 07 13:05:36 GMT 2016

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

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