Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Change perspective
Change perspective [message #122571] Wed, 25 February 2009 11:22 Go to next message
Eclipse UserFriend
Originally posted by: haglund86.hotmail.com

Hello.
I made a login page. And if the user logins I want to change the
perspective to a different one.

How do I do to change the perspective?
I looked at the demo application which has more then one perspective
however I could not fully understand that example.

I would like to see a simple example of a change of perspective.

Regards
Erik
Re: Change perspective [message #122580 is a reply to message #122571] Wed, 25 February 2009 11:48 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

See IWorkbench.showPerspective(String perspectiveId, IWorkbenchWindow
window).

Greets
Benny

Erik Haglund wrote:
> Hello.
> I made a login page. And if the user logins I want to change the
> perspective to a different one.
>
> How do I do to change the perspective?
> I looked at the demo application which has more then one perspective
> however I could not fully understand that example.
>
> I would like to see a simple example of a change of perspective.
>
> Regards
> Erik


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Change perspective [message #122589 is a reply to message #122571] Wed, 25 February 2009 11:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Erik,

The IWorkbench Inteface has a method named showPerspective(). You could
try this one:

--------------------------------------------
IWorkbench workbench = PlatformUI.getWorkbench();

try {
workbench.showPerspective("id.of.your.perspective",
workbench.getActiveWorkbenchWindow());

} catch (WorkbenchException e1) {
e1.printStackTrace();
}
--------------------------------------------

Regards,
Björn


Erik Haglund schrieb:
> Hello.
> I made a login page. And if the user logins I want to change the
> perspective to a different one.
>
> How do I do to change the perspective?
> I looked at the demo application which has more then one perspective
> however I could not fully understand that example.
>
> I would like to see a simple example of a change of perspective.
>
> Regards
> Erik
Re: Change perspective [message #122990 is a reply to message #122571] Wed, 25 February 2009 14:48 Go to previous message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi Erik,
this is really simple. Try this:

IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
final IWorkbenchPage page = window.getActivePage();
IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
IPerspectiveDescriptor perspective
= registry.findPerspectiveWithId( YOUR_ID );
page.setPerspective( perspective );

Just replace YOUR_ID with the id of the perspective to change.

Holger

Erik Haglund <haglund86@hotmail.com> schrieb:

> Hello.
> I made a login page. And if the user logins I want to change the
> perspective to a different one.
>
> How do I do to change the perspective?
> I looked at the demo application which has more then one perspective
> however I could not fully understand that example.
>
> I would like to see a simple example of a change of perspective.
>
> Regards
> Erik
>
--
----------------------------
http://eclipsesource.com
http://twitter.com/eclipsesource
Previous Topic:Multithread RAP application, ui contribution
Next Topic:Disposing Images / keeping Images just for a time or user session
Goto Forum:
  


Current Time: Mon Dec 06 21:35:37 GMT 2021

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

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

Back to the top