Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Switch between perspectives
Switch between perspectives [message #459259] Wed, 29 November 2006 09:30 Go to next message
Eclipse UserFriend
I have a RCP application with 2 perspectives and i need to switch between the perspectives from a view (combo / button) contained in both perspectives. Problem is how.
Re: Switch between perspectives [message #459267 is a reply to message #459259] Wed, 29 November 2006 13:45 Go to previous messageGo to next message
Eclipse UserFriend
Check out IWorkbenchPage ... and I think there's a perspective registry
in IWorkbench.

Later,
PW
Re: Switch between perspectives [message #459287 is a reply to message #459259] Thu, 30 November 2006 00:34 Go to previous messageGo to next message
Eclipse UserFriend
Truls wrote:

> I have a RCP application with 2 perspectives and i need to switch between
> the perspectives from a view (combo / button) contained in both
> perspectives. Problem is how.

Try this:

IWorkbench workbench = PlatformUI.getWorkbench();
IPerspectiveRegistry perspReg = workbench.getPerspectiveRegistry();
IPerspectiveDescriptor perspDesc =
perspReg.findPerspectiveWithId("com.my.perspective.Id");

IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
page.setPerspective(perspDesc);
}

--
With best regards, Michael Spector
Re: Switch between perspectives [message #459303 is a reply to message #459259] Thu, 30 November 2006 05:22 Go to previous message
Eclipse UserFriend
Originally posted by: truls.telemagic.no

thanks al lot. works fine now.
Previous Topic:KeyListener - combination keys
Next Topic:How to shutdown the application
Goto Forum:
  


Current Time: Tue Mar 25 19:08:00 EDT 2025

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

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

Back to the top