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 14:35 Go to next message
Christian Eugster is currently offline Christian Eugster
Messages: 134
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 04:42 Go to previous message
Paul Webster is currently offline Paul Webster
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
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .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: Sat Aug 23 11:25:23 EDT 2014

Powered by FUDForum. Page generated in 0.02174 seconds