X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fplugins%2Forg.argeo.security.ui.rap%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2Fui%2Frap%2FRapWorkbenchAdvisor.java;h=edde41f14200f77bfd72a32f17fdc3eac3208981;hb=cd50e3711d3b86921f11d9e021fc6a43bef0d400;hp=b553dceeaacd38ade3fcf26f5262b16894999e79;hpb=041234a54c1b98bcba16e359c4c4905c4eed1768;p=lgpl%2Fargeo-commons.git diff --git a/security/plugins/org.argeo.security.ui.rap/src/main/java/org/argeo/security/ui/rap/RapWorkbenchAdvisor.java b/security/plugins/org.argeo.security.ui.rap/src/main/java/org/argeo/security/ui/rap/RapWorkbenchAdvisor.java index b553dceea..edde41f14 100644 --- a/security/plugins/org.argeo.security.ui.rap/src/main/java/org/argeo/security/ui/rap/RapWorkbenchAdvisor.java +++ b/security/plugins/org.argeo.security.ui.rap/src/main/java/org/argeo/security/ui/rap/RapWorkbenchAdvisor.java @@ -1,6 +1,22 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.argeo.security.ui.rap; import org.eclipse.ui.IPerspectiveDescriptor; +import org.eclipse.ui.application.IWorkbenchConfigurer; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; import org.eclipse.ui.application.WorkbenchAdvisor; import org.eclipse.ui.application.WorkbenchWindowAdvisor; @@ -8,6 +24,8 @@ import org.eclipse.ui.application.WorkbenchWindowAdvisor; /** Eclipse RAP specific workbench advisor */ public class RapWorkbenchAdvisor extends WorkbenchAdvisor { public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective"; + public final static String SAVE_AND_RESTORE_PROPERTY = "org.argeo.security.ui.saveAndRestore"; + private String initialPerspective = System.getProperty( INITIAL_PERSPECTIVE_PROPERTY, null); @@ -17,6 +35,14 @@ public class RapWorkbenchAdvisor extends WorkbenchAdvisor { this.username = username; } + @Override + public void initialize(IWorkbenchConfigurer configurer) { + super.initialize(configurer); + Boolean saveAndRestore = Boolean.parseBoolean(System.getProperty( + SAVE_AND_RESTORE_PROPERTY, "false")); + configurer.setSaveAndRestore(saveAndRestore); + } + public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor( IWorkbenchWindowConfigurer configurer) { return new RapWindowAdvisor(configurer, username);