|Welcome page for a single perspective [message #506454]
||Thu, 07 January 2010 05:10
| Markus Schindler
Registered: July 2009
I'm searching for a solution for following problem:
I have an rcp application with a few perspectives.
If the user switches to one special perspective (which is not the initial perspective), a welcome screen (or something that looks like a welcome
screen) should be displayed.
If the user clicks a link on the page, the welcome sceen should close.
I tried this with an IntroPart, but I doesn't get it work. It is to much "product" dependend. Could someone give me a hint.
|Re: Welcome page for a single perspective [message #507274 is a reply to message #506454]
||Tue, 12 January 2010 12:33
| John Ormerod
Registered: January 2010
I think you could handle this by using a PerspectiveListener (a class that implements IPerspectiveListener4). One of the methods in the interface is perspectiveActivated(), which (from memory) I think is the one that gets invoked when the user selects a new perspective. When a perspective is opened, the perspectiveOpened() method is invoked.
One of the parameters is the PerspectiveDescriptor, which allows you to determine when the perspective is your 'special' perspective. When it is, you can display your 'welcome' screen.
There is only one PerspectiveListener allowed, so I create mine in the WorkbenchWindowAdvisor#postWindowOpen():
IWorkbenchPage activePage = window.getActivePage();
When you say 'the welcome screen should close' - if you want the perspective to close, you have the info to do this:
activePage.closePerspective(specialPerspId, true, true);
Hope this helps.
Powered by FUDForum
. Page generated in 0.01659 seconds