I have a RCP application. Its default perspective opens two views on thew left and the bottom, in relation to the editor area. The option SaveAndRestore is set to true. Upon the next startup of the app, both views are closed. Why? What am i doing wrong?
Asked
Active
Viewed 752 times
3
-
What version of eclipse are you using for your RCP app? – VonC Sep 27 '11 at 11:41
-
Ok, I saw a bug for Indigo, but it won't apply for your Eclipse version. – VonC Sep 27 '11 at 12:32
-
No suggestion right now, but Alexander's "answer" (more a comment to me until you comment back on it) has merits. – VonC Sep 27 '11 at 13:57
3 Answers
2
Well it seems, that i had something wrong with my ids. Recreated some of them and checked them. Now everything is doing fine.

Coxer
- 1,694
- 2
- 26
- 44
1
I assume you closed the views manually. Use the command org.eclipse.ui.window.resetPerspective to reset the perspective to its initial state or use the "Clear" flag for the Workspace in your launch configuration.

vogella
- 24,574
- 4
- 29
- 26
-
Nope, i am doing a clean startup. Then the views are created by the default perspective. Then i am restarting the application and the views are gone. I am not doing anyting to the views. – Coxer Sep 27 '11 at 15:07
-
Try to rebuild the view example from http://www.vogella.de/articles/EclipseRCP/article.html and compare it with your example. – vogella Sep 27 '11 at 18:03
0
Do you have a saveState(memento) and init(IViewSite site, IMemento memento) implemented for your view?

Alex K.
- 3,294
- 4
- 29
- 41
-
Nope, but shouldnt the mentioned methods be handled by the superclass in case they arent overwritten? – Coxer Sep 27 '11 at 15:07
-
Well, if you inherit directly from ViewPart, then there is no implementation for above-mentioned methods. To be sure, that it is persisted correctly you can check out your workbrench.xml, which is located in your runtime folder \.metadata\.plugins\org.eclipse.ui.workbench, then 'views' section and try to find out a 'view' part with appropriate id. – Alex K. Sep 27 '11 at 15:27
-
The view is called "dev.auspex.test.view" and "dev.auspex.test.view2". I think they are persited correctly ... Here my [Workbench.xml](http://upload.auspex.eu/uploads/workbench.xml) – Coxer Sep 27 '11 at 16:23
-
As I can see from the provided workbrench.xml, your
section is empty, that means, that you don't have any persisted views, your id-s are used in other sections, like layout. There is nothing to deal with view persistence, so, try to implement those methods, I've mentioned earlier and ensure, that your view is persistent correctly, there should be something like that: – Alex K. Sep 27 '11 at 17:45...something here probably... -
-
Try this http://rajakannappan.blogspot.com/2009/10/eclipse-rcp-how-to-save-view-layouts.html – Alex K. Sep 27 '11 at 18:47