Setting input on default perspective [message #640767] |
Tue, 23 November 2010 06:13 |
Missing name Mising name Messages: 16 Registered: May 2010 |
Junior Member |
|
|
Hi all,
I was wondering if anyone could tell me how to programatically set the default perspective of an RCP application when you also want to set the input. I know about overriding getInitialWindowPerspectiveId() in the ApplicationWorkbenchAdvisor, but that does not allow you to set the IAdaptable input like IWorkbechWindow.openPage(), IWorkbench.openWorkbenchWindow(), and IWorkbench.showPerspective() do. Is there something in the ApplicationWorkbenchAdvisor I have to override so I can open the perspective with something like showPerspective(), instead of letting it just use the initial Perspective?
Any advice is greatly appreciated!
Jim
[Updated on: Tue, 23 November 2010 06:44] Report message to a moderator
|
|
|
|
Re: Setting input on default perspective [message #640948 is a reply to message #640767] |
Tue, 23 November 2010 16:08 |
Missing name Mising name Messages: 16 Registered: May 2010 |
Junior Member |
|
|
Thanks! It is so obvious now that you mention it - I can't believe I missed it!
Unfortunately for me, this make my situation a little harder to manage. To give you some background, I have an RCP application that is made up of multiple plug-ins. The main app plug-in provides a login, some security, manages events between it's "child" plug-ins, and creates the workbench. The child plug-ins connect to this main app through extension points - the children depend on the main app but the main app does not know anything about the children. These children each contain a perspective that is opened via menu extensions. I also want to set the initial perspective of the workbench to one of these child plug-in perspectives.
The problem is that I want the child plug-in to create its own window/page so that it has access to it's own input. The ApplicationWorkbenchAdvisor resides in the main app, so overriding the default input there won't help me since the child plug-in is what knows how to create the input.
I got around this by setting the default perspective to a blank perspective, then calling a command handler from the child to close the active page and open a new one with it's input and perspective. This works, but it doesn't look very good because you see the flip between perspectives. I would rather have a seamless opening of the child plug-in's perspective when the app is launched.
Sorry for how long winded this has become, but I am looking for the best way to accomplish this, and I am not sure how. This is why I initially asked if there is a method I can override, perhaps in the ApplicationWorkbenchWindowAdvisor, where I can do a openPage() instead of letting it set its own initial perspective. That way I can call the openPage() in a command handler from the child plug-in so it can handle the input itself.
Thanks again!
Jim
[Updated on: Tue, 23 November 2010 16:26] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04006 seconds