|
Re: set the default perspective even with user's preferences [message #510260 is a reply to message #509807] |
Tue, 26 January 2010 19:28 |
Wim Jongman Messages: 423 Registered: July 2009 |
Senior Member |
|
|
Hi Luca,
The restorestate methods in the advisors give you early access. Otherwise an
activator would allow you to open the welcome perspective with
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().setPerspective(ccc)
Best regards,
Wim Jongman
> Hi,
> I've got an RCP application with the following advisor:
>
>
> public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
>
> /**
> * The default perspective ID to load on the application startup.
> */
> private static final String DEFAULT_PERSPECTIVE_ID =
"hrpm.rcp.gui.perspective.WelcomePerspective";
>
> /**
> * This method is used to create the workbench window advisor, that is the
object
> * that can configure the window of the workbench.
> */
> public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
> return new ApplicationWorkbenchWindowAdvisor(configurer);
> }
>
> public String getInitialWindowPerspectiveId() {
> return DEFAULT_PERSPECTIVE_ID;
> }
>
> /* (non-Javadoc)
> * @see
org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.e clipse.ui.application.IWorkbenchConfigurer)
> */
> @Override
> public void initialize(IWorkbenchConfigurer configurer) {
> // configure with the super object
> super.initialize(configurer);
>
> // set the save-and-restore property, so that the workbench
> // will store the user layout when the application quits
> configurer.setSaveAndRestore( true );
> }
>
>
>
> }
>
>
>
> as shown the advisor uses the setSaveAndRestore method to save the user's
preferences. However I'd like that the default perspective is always shown on
top of the others without any regard to the user preferences. I mean, the
user can set the window position, size, and perspective opened at startup,
but the default one must always be shown. Is it psssible?
|
|
|
Powered by
FUDForum. Page generated in 0.03104 seconds