Skip to main content



      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 07:56 Go to next message
Eclipse UserFriend
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 10:36 Go to previous messageGo to next message
Eclipse UserFriend
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 09:10 Go to previous messageGo to next message
Eclipse UserFriend
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 17:35 Go to previous message
Eclipse UserFriend
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: Thu Jul 17 10:08:34 EDT 2025

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

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

Back to the top