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 public final static String INITIAL_PERSPECTIVE_PROPERTY
= "org.argeo.security.ui.initialPerspective";
10 private String initialPerspective
= System
.getProperty(
11 INITIAL_PERSPECTIVE_PROPERTY
, null);
13 public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(
14 IWorkbenchWindowConfigurer configurer
) {
15 return new SecureWorkbenchWindowAdvisor(configurer
);
18 public String
getInitialWindowPerspectiveId() {
19 if (initialPerspective
!= null) {
20 // check whether this user can see the declared perspective
21 // (typically the perspective won't be listed if this user doesn't
22 // have the right to see it)
23 IPerspectiveDescriptor pd
= getWorkbenchConfigurer().getWorkbench()
24 .getPerspectiveRegistry()
25 .findPerspectiveWithId(initialPerspective
);
29 return initialPerspective
;