1 package org
.argeo
.security
.ui
.rap
;
3 import org
.eclipse
.ui
.IPerspectiveDescriptor
;
4 import org
.eclipse
.ui
.application
.IWorkbenchWindowConfigurer
;
5 import org
.eclipse
.ui
.application
.WorkbenchAdvisor
;
6 import org
.eclipse
.ui
.application
.WorkbenchWindowAdvisor
;
8 public class SecureWorkbenchAdvisor
extends WorkbenchAdvisor
{
9 //static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.adminSecurityPerspective"; //$NON-NLS-1$
10 public final static String INITIAL_PERSPECTIVE_PROPERTY
= "org.argeo.security.ui.initialPerspective";
11 private String initialPerspective
= System
.getProperty(
12 INITIAL_PERSPECTIVE_PROPERTY
, null);
14 public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(
15 IWorkbenchWindowConfigurer configurer
) {
16 return new SecureWorkbenchWindowAdvisor(configurer
);
19 public String
getInitialWindowPerspectiveId() {
20 if (initialPerspective
!= null) {
21 // check whether this user can see the declared perspective
22 // (typically the perspective won't be listed if this user doesn't
23 // have the right to see it)
24 IPerspectiveDescriptor pd
= getWorkbenchConfigurer().getWorkbench()
25 .getPerspectiveRegistry()
26 .findPerspectiveWithId(initialPerspective
);
30 return initialPerspective
;