Skip to main content


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] Sat, 16 June 2012 03:42 Go to next message
Ronald So is currently offline Ronald SoFriend
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 09:32 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
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 09:58 Go to previous message
zone whua is currently offline zone whuaFriend
Messages: 7
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:The alias '/rwt-resources' is already in use.
Next Topic:Combo Box "problem"
Goto Forum:
  


Current Time: Thu Apr 25 16:58:18 GMT 2024

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

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

Back to the top