1 package org
.argeo
.security
.ui
.rcp
;
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 aboutAction;
23 private final Boolean isRcp
;
25 public SecureActionBarAdvisor(IActionBarConfigurer configurer
, Boolean isRcp
) {
30 protected void makeActions(IWorkbenchWindow window
) {
31 preferences
= ActionFactory
.PREFERENCES
.create(window
);
32 register(preferences
);
33 openPerspectiveDialogAction
= ActionFactory
.OPEN_PERSPECTIVE_DIALOG
35 register(openPerspectiveDialogAction
);
36 showViewMenuAction
= ActionFactory
.SHOW_VIEW_MENU
.create(window
);
37 register(showViewMenuAction
);
38 helpContentAction
= ActionFactory
.HELP_CONTENTS
.create(window
);
39 register(helpContentAction
);
41 exitAction
= ActionFactory
.QUIT
.create(window
);
44 // aboutAction = ActionFactory.ABOUT.create(window);
45 // register(aboutAction);
46 newWindowAction
= ActionFactory
.OPEN_NEW_WINDOW
.create(window
);
47 register(newWindowAction
);
51 protected void fillMenuBar(IMenuManager menuBar
) {
52 MenuManager fileMenu
= new MenuManager("&File",
53 IWorkbenchActionConstants
.M_FILE
);
54 MenuManager editMenu
= new MenuManager("&Edit",
55 IWorkbenchActionConstants
.M_EDIT
);
56 MenuManager windowMenu
= new MenuManager("&Window",
57 IWorkbenchActionConstants
.M_WINDOW
);
58 MenuManager helpMenu
= new MenuManager("&Help",
59 IWorkbenchActionConstants
.M_HELP
);
61 menuBar
.add(fileMenu
);
62 menuBar
.add(editMenu
);
63 menuBar
.add(windowMenu
);
64 // Add a group marker indicating where action set menus will appear.
65 menuBar
.add(new GroupMarker(IWorkbenchActionConstants
.MB_ADDITIONS
));
66 menuBar
.add(helpMenu
);
70 fileMenu
.add(newWindowAction
);
71 fileMenu
.add(new Separator());
73 fileMenu
.add(exitAction
);
76 editMenu
.add(preferences
);
79 windowMenu
.add(openPerspectiveDialogAction
);
80 windowMenu
.add(showViewMenuAction
);
83 helpMenu
.add(helpContentAction
);
84 // helpMenu.add(aboutAction);