1 package org
.argeo
.security
.ui
.application
;
3 import org
.eclipse
.jface
.action
.GroupMarker
;
4 import org
.eclipse
.jface
.action
.IMenuManager
;
5 import org
.eclipse
.jface
.action
.MenuManager
;
6 import org
.eclipse
.jface
.action
.Separator
;
7 import org
.eclipse
.ui
.IWorkbenchActionConstants
;
8 import org
.eclipse
.ui
.IWorkbenchWindow
;
9 import org
.eclipse
.ui
.actions
.ActionFactory
;
10 import org
.eclipse
.ui
.actions
.ActionFactory
.IWorkbenchAction
;
11 import org
.eclipse
.ui
.application
.ActionBarAdvisor
;
12 import org
.eclipse
.ui
.application
.IActionBarConfigurer
;
14 public class SecureActionBarAdvisor
extends ActionBarAdvisor
{
15 private IWorkbenchAction exitAction
;
16 private IWorkbenchAction openPerspectiveDialogAction
;
17 private IWorkbenchAction showViewMenuAction
;
18 private IWorkbenchAction newWindowAction
;
19 private IWorkbenchAction preferences
;
20 private IWorkbenchAction helpContentAction
;
21 private IWorkbenchAction changePassword
;
22 // private IWorkbenchAction aboutAction;
24 private final Boolean isRcp
;
26 public SecureActionBarAdvisor(IActionBarConfigurer configurer
, Boolean isRcp
) {
31 protected void makeActions(IWorkbenchWindow window
) {
32 preferences
= ActionFactory
.PREFERENCES
.create(window
);
33 register(preferences
);
34 openPerspectiveDialogAction
= ActionFactory
.OPEN_PERSPECTIVE_DIALOG
36 register(openPerspectiveDialogAction
);
37 showViewMenuAction
= ActionFactory
.SHOW_VIEW_MENU
.create(window
);
38 register(showViewMenuAction
);
39 helpContentAction
= ActionFactory
.HELP_CONTENTS
.create(window
);
40 register(helpContentAction
);
42 exitAction
= ActionFactory
.QUIT
.create(window
);
45 // aboutAction = ActionFactory.ABOUT.create(window);
46 // register(aboutAction);
47 newWindowAction
= ActionFactory
.OPEN_NEW_WINDOW
.create(window
);
48 register(newWindowAction
);
53 protected void fillMenuBar(IMenuManager menuBar
) {
54 MenuManager fileMenu
= new MenuManager("&File",
55 IWorkbenchActionConstants
.M_FILE
);
56 MenuManager editMenu
= new MenuManager("&Edit",
57 IWorkbenchActionConstants
.M_EDIT
);
58 MenuManager windowMenu
= new MenuManager("&Window",
59 IWorkbenchActionConstants
.M_WINDOW
);
60 MenuManager helpMenu
= new MenuManager("&Help",
61 IWorkbenchActionConstants
.M_HELP
);
63 menuBar
.add(fileMenu
);
64 menuBar
.add(editMenu
);
65 menuBar
.add(windowMenu
);
66 // Add a group marker indicating where action set menus will appear.
67 menuBar
.add(new GroupMarker(IWorkbenchActionConstants
.MB_ADDITIONS
));
68 menuBar
.add(helpMenu
);
72 fileMenu
.add(newWindowAction
);
73 fileMenu
.add(new Separator());
75 fileMenu
.add(exitAction
);
78 editMenu
.add(preferences
);
81 windowMenu
.add(openPerspectiveDialogAction
);
82 windowMenu
.add(showViewMenuAction
);
85 helpMenu
.add(helpContentAction
);
86 // helpMenu.add(aboutAction);