Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to get or create the PerspectiveSwitcher Bar?
How to get or create the PerspectiveSwitcher Bar? [message #115615] Sat, 13 December 2008 15:36 Go to next message
CAO Dahai is currently offline CAO DahaiFriend
Messages: 16
Registered: July 2009
Junior Member
hi, I saw the sample of DemoPresentationWorkbenchWindowAdvisor and found
the method as below:
private void createPerspectiveSwitcher(final Composite banner) {
IAction[] actions = new IAction[] { new Action("Perspective 1") {
public void run() {
switchPerspective(0);
}

}, new Action("Perspective 2") {
public void run() {
switchPerspective(1);
}
} };

ActionBarButton actionBar = new ActionBarButton(banner, SWT.NONE,
actions);
actionBar.pack();

FormData fdActionBar = new FormData();
actionBar.setLayoutData(fdActionBar);
fdActionBar.top = new FormAttachment(0, 44);
fdActionBar.left = new FormAttachment(100, -actionBar.getSize().x);
}

But I hope to know how to create the PerspectiveSwitcher Bar showed as on
the top-right corner of Eclipse? I saw the code that create system cool
bar as below:

IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
Composite coolBar = (Composite) configurer.createCoolBarControl(banner);
Re: How to get or create the PerspectiveSwitcher Bar? [message #115864 is a reply to message #115615] Tue, 16 December 2008 09:08 Go to previous message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Did you have a look at class PerspectiveSwitcher and its usage in
WorkbenchWindow#addPerspectiveBar() and createDefaultContents()?

HTH
Rüdiger


CAO Dahai wrote:
> hi, I saw the sample of DemoPresentationWorkbenchWindowAdvisor and found
> the method as below: private void createPerspectiveSwitcher(final
> Composite banner) {
> IAction[] actions = new IAction[] { new Action("Perspective 1") {
> public void run() {
> switchPerspective(0);
> }
>
> }, new Action("Perspective 2") {
> public void run() {
> switchPerspective(1);
> }
> } };
>
> ActionBarButton actionBar = new ActionBarButton(banner, SWT.NONE,
> actions);
> actionBar.pack();
>
> FormData fdActionBar = new FormData();
> actionBar.setLayoutData(fdActionBar);
> fdActionBar.top = new FormAttachment(0, 44);
> fdActionBar.left = new FormAttachment(100, -actionBar.getSize().x);
> }
>
> But I hope to know how to create the PerspectiveSwitcher Bar showed as
> on the top-right corner of Eclipse? I saw the code that create system
> cool bar as below:
> IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
> Composite coolBar = (Composite) configurer.createCoolBarControl(banner);
>
>
Previous Topic:Combo border theming
Next Topic:Deploying RAP application
Goto Forum:
  


Current Time: Wed Feb 01 15:49:19 GMT 2023

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

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

Back to the top