Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » close perspective on switch
close perspective on switch [message #508260] Mon, 18 January 2010 02:58 Go to next message
Eclipse UserFriend
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 08:58 Go to previous messageGo to next message
Eclipse UserFriend
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 15:05 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 20:02:44 EDT 2025

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

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

Back to the top