Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » when using setSaveAndRestore() the application always show the editor area
when using setSaveAndRestore() the application always show the editor area [message #832650] Fri, 30 March 2012 11:56 Go to next message
Luiz E. is currently offline Luiz E.Friend
Messages: 100
Registered: September 2010
Senior Member
We have a RCP application, and i'm trying to save the state of the workbench after the user quit the application.
So far, i've done the following:

@Override
public void initialize(IWorkbenchConfigurer configurer) {
    super.initialize(configurer);
    configurer.setSaveAndRestore(true);
}


but when I reopen the application, it appears like this:
http://i.stack.imgur.com/mkEDF.png

but the app should be like this

http://i.stack.imgur.com/wKANb.png

seems like that our editor areas is always visible when the saveAndRestore is set to true

we set the editAreaVisible to false in our perspective, and we have a PerspectiveListenerAdapter that search for all editorReferences and if there are none, we set the editorAreaVisible to false again.

any ideas?
Re: when using setSaveAndRestore() the application always show the editor area [message #832747 is a reply to message #832650] Fri, 30 March 2012 14:36 Go to previous messageGo to next message
Luiz E. is currently offline Luiz E.Friend
Messages: 100
Registered: September 2010
Senior Member
I debugged the application, and I saw something weird...
My `Perspective` class is like this
    public void createInitialLayout(IPageLayout layout) {
    		IPartService partService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService();
    		partService.addPartListener(new PerspectiveListenerAdapter());
    		
    		this.layout = layout;
    
    		String editorAreaId = layout.getEditorArea();
    
    		layout.createPlaceholderFolder(FI_TOP, IPageLayout.TOP, ratioTop, editorAreaId);
    		layout.createPlaceholderFolder(FI_BOTTOM, IPageLayout.BOTTOM, ratioBottom, editorAreaId);
    		
    		layout.setEditorAreaVisible(false);
    	}

but, when i set `setSaveAndRestore` to true, the Application doesn't hit `createInitialLayout`
is this a bug?
Re: when using setSaveAndRestore() the application always show the editor area [message #834840 is a reply to message #832747] Mon, 02 April 2012 13:10 Go to previous messageGo to next message
Sharon Snyder is currently offline Sharon SnyderFriend
Messages: 56
Registered: September 2010
Member

I have found the same problem - I've got an Eclipse RCP application as well - using v 3.6.2. If you find a solution, please post it. I have not found one to date, but if I do, I will also post it on this thread.

-Sharon
Re: when using setSaveAndRestore() the application always show the editor area [message #835157 is a reply to message #834840] Mon, 02 April 2012 21:35 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1441
Registered: July 2009
Senior Member
I believe that the creatInitialLayout will only be called once if setSaveAndRestore is true. Calling it on every launch would defeat the purpose of the feature. A value of true says that the Eclipse framework tracks the layout of the perspective so customizations by the user are saved from one session to the next. If createInitialLayout were called, it would wipe out the layout customized by the user.
Previous Topic:which one technique is better in between Eclipse Branding or Eclipse Source Building
Next Topic:Open JUnit view with a Surefire-report
Goto Forum:
  


Current Time: Sun Nov 29 22:41:24 GMT 2020

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

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

Back to the top