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 /** Eclipse RAP specific workbench advisor */
9 public class RapWorkbenchAdvisor
extends WorkbenchAdvisor
{
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 private String username
;
16 public RapWorkbenchAdvisor(String username
) {
17 this.username
= username
;
20 public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(
21 IWorkbenchWindowConfigurer configurer
) {
22 return new RapWindowAdvisor(configurer
, username
);
25 public String
getInitialWindowPerspectiveId() {
26 if (initialPerspective
!= null) {
27 // check whether this user can see the declared perspective
28 // (typically the perspective won't be listed if this user doesn't
29 // have the right to see it)
30 IPerspectiveDescriptor pd
= getWorkbenchConfigurer().getWorkbench()
31 .getPerspectiveRegistry()
32 .findPerspectiveWithId(initialPerspective
);
36 return initialPerspective
;