Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » close perspective on switch
close perspective on switch [message #508260] Mon, 18 January 2010 07:58 Go to next message
Luca Ferrari is currently offline Luca FerrariFriend
Messages: 159
Registered: November 2009
Senior Member
Hi,
is it possibile to close the current perspective when the user switches to another perspective?

Thanks.
Re: close perspective on switch [message #508347 is a reply to message #508260] Mon, 18 January 2010 13:58 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You would probably have to complete your switch to the new perspective,
and then request the old perspective to close.

I'd try the command id = org.eclipse.ui.window.closePerspective ... it
takes a parameter with the perspective id =
org.eclipse.ui.window.closePerspective.perspectiveId

--
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


Re: close perspective on switch [message #508441 is a reply to message #508260] Mon, 18 January 2010 20:05 Go to previous message
John Ormerod is currently offline John OrmerodFriend
Messages: 39
Registered: January 2010
Member
Hi Luca
if you want a more generalised solution, you could create a PerspectiveListener class - consider subclassing org.eclipse.ui.PerspectiveAdapter.

You can only have one of these and that's the first one to be defined. I do this in the WWAdvisor's postWindowOpen() method, something like:
IWorkbenchPage activePage = window.getActivePage(); activePage.getWorkbenchWindow().addPerspectiveListener(new RCPPerspectiveListener());

Regards, John
Previous Topic:No application id has been found
Next Topic:actionSetPartAssociations with a multipage editor
Goto Forum:
  


Current Time: Tue Apr 23 13:12:34 GMT 2024

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

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

Back to the top