Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Question about WorkbenchWindows and Perspectives(SaveAndRestore Perspective WorkbenchWindow RCP)
Question about WorkbenchWindows and Perspectives [message #521217] Tue, 16 March 2010 18:35 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 153
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
I am building an RCP with several perspectives, each of them shown in an own WorkbenchWindow. I want do the following: Ad Startup I give as a commandline argument (-perspective) , which perspective should open. I want only one Window with the given perspective opening at startup time. When closing the workbench, it is not yet determened which perspective will be used next startup. The Problem is that either I can handle this, but then the state of the perspectives is not saved or I can save the state but then always the last saved state is restored. Has anyone a solution for this?
Re: Question about WorkbenchWindows and Perspectives [message #521390 is a reply to message #521217] Wed, 17 March 2010 08:42 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You're seeing the 2 supported behaviours, either we don't save the
workbench state, or we save it exactly.

2 things come to mind

1) on startup look at the argument, and get rid of every
window/perspective that doesn't match. There's a postStartup method in
the workbench advisor

2) don't use save and restore, but on shutdown save each open
perspective as a custom perspective to that ID. Then on startup it
should hopefully open the custom perspective as it was saved on
shutdown. See org.eclipse.ui.IWorkbenchPage.savePerspective()

There might be more options, but I can't think of them

Paul Webster .platform.doc.isv/guide/workbench.htm

Previous Topic:Classloader not work on RCP
Next Topic:ACTION_ARRANGE_ALL: how to execute it from custom Action?
Goto Forum:

Current Time: Thu Apr 19 17:48:55 GMT 2018

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

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