hidePart during shutdown leaves something behind [message #1410863] |
Thu, 21 August 2014 16:40  |
Eclipse User |
|
|
|
How do I destroy certain parts during shutdown?
I have a part descriptor (multiples allowed and tagged "removeOnHide" and my personal tag "closeOnExit") that is used to create a part when the user double clicks a file name in a different view part in my compatibility layered rcp app.
I added a lifecycleuri to my product and that class subscribes to the UIEvents.UILifeCycle.APP_SHUTDOWN_STARTED event. I used the following article to get me this far: http://www.vogella.com/tutorials/Eclipse4LifeCycle/article.html
In my new EventHandler() I search to find all the parts tagged "closeOnExit" to be closed on exit and call hidePart(part, true); as described in the answer to this question http://stackoverflow.com/questions/16693443/eclipse-rcp4-close-part-on-exit-disable-persistence-of-a-part
The handler is executed during the shutdown of the app and the part(s) is/are hidden. However on restart of my app there is an undesired area with nothing in it except for the min max buttons.
I also added a menu item to the app that calls hidePart(part, true); and the part is closed normally without leaving behind that area with just the min max buttons.
I tried setting the part visibility to false during the shutdown which eliminates the undesired artifact on subsequent startup but it also prevents the user from being able to create new parts as needed. So I tried setVisible(true) during the creation of this part to counter the setVisible(false) during shutdown but that didn't work. I backed out this approach since it was obviously incorrect.
Have I stumbled onto a bug?
Is there a better way for me to achieve the desired result?
|
|
|
|
|
|
|
Re: hidePart during shutdown leaves something behind [message #1411237 is a reply to message #1411234] |
Fri, 22 August 2014 15:18  |
Eclipse User |
|
|
|
However this creates a new problem. An error dialog pops up stating:
Workbench Auto-Save Job
An internal error has occurred.
The selected element org.eclipse.e4.ui.model.application.ui.basic.impl.PartStackImpl@5060e945 (elementId: PartStack@606c027c, tags: [active], contributorURI: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: 5000, accessibilityPhrase: null) is not a child of this container
Obviously I didn't remove everything I needed to remove in order to keep this Job happy.
|
|
|
Powered by
FUDForum. Page generated in 0.06087 seconds