Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Setting different initial perspective possible?
Setting different initial perspective possible? [message #887101] Fri, 15 June 2012 23:42 Go to next message
Ronald So is currently offline Ronald So
Messages: 198
Registered: April 2011
Senior Member
Hi,

I have a need to present different initial perspective when the application starts. Say I have:

Bundle A: with perspective A
Bundle B: with perspective B

Now bundle C contains the entry point (Application.java). In the WB advisor, I need to set the initial perspective. I need to determine if Bundle A is installed so I can use perspective A, or if Bundle B is installed so I can use perspective B. Finally, if both bundles are installed, I will use perspective A. Is this do-able?

Thank you so much for your help.

Ronald
Re: Setting different initial perspective possible? [message #887256 is a reply to message #887101] Sat, 16 June 2012 05:32 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 335
Registered: July 2009
Senior Member
Ronald,

you can ask the BundleContext whether a certain bundle is available and
if it is running.
Bundle bundleC = FrameWorkUtil.getBundle( MyWorkbenchAdvisor.class );
BundleContext bundleContext = bundleC.getBundleContext();

BundleContext#getBundles() returns all known bundles, Bundle#getState()
will answer in what state the bundle currently is.

HTH
Rüdiger

On 16.06.2012 05:42, Ronald So wrote:
> Hi,
>
> I have a need to present different initial perspective when the
> application starts. Say I have:
>
> Bundle A: with perspective A
> Bundle B: with perspective B
>
> Now bundle C contains the entry point (Application.java). In the WB
> advisor, I need to set the initial perspective. I need to determine if
> Bundle A is installed so I can use perspective A, or if Bundle B is
> installed so I can use perspective B. Finally, if both bundles are
> installed, I will use perspective A. Is this do-able?
>
> Thank you so much for your help.
>
> Ronald
>
--
Rüdiger Herrmann
http://codeaffine.com
Re: Setting different initial perspective possible? [message #887886 is a reply to message #887101] Sun, 17 June 2012 05:58 Go to previous message
hua zhong is currently offline hua zhong
Messages: 1
Registered: July 2009
Location: Wuhan China
Junior Member
maybe you can use diffrent entrypoint or use parameter

@Override
public int createUI() {
Display display = PlatformUI.createDisplay();
// String para = RWT.getRequest().getParameter("test");
WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
registerService();
LoginPage.OpenPage();
int result = PlatformUI.createAndRunWorkbench(display, advisor);
return result;
}

if use parameter from rwt, you can write 2 ApplicationWorkbenchAdvisor:
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {


public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
}

public String getInitialWindowPerspectiveId() {
return UIConstants.PERSPECTIVE_ID_MYWORKSPACE;
}
}
Previous Topic:Probably simple -- need to add links to page
Next Topic:Combo Drop Down Arrow
Goto Forum:
  


Current Time: Fri Jul 25 16:47:51 EDT 2014

Powered by FUDForum. Page generated in 0.01540 seconds