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 aboutAction;
17 private IWorkbenchAction newWindowAction
;
18 private IWorkbenchAction preferences
= null;
20 public SecureActionBarAdvisor(IActionBarConfigurer configurer
) {
24 protected void makeActions(IWorkbenchWindow window
) {
25 preferences
= ActionFactory
.PREFERENCES
.create(window
);
26 register(preferences
);
27 exitAction
= ActionFactory
.QUIT
.create(window
);
30 // aboutAction = ActionFactory.ABOUT.create(window);
31 // register(aboutAction);
33 newWindowAction
= ActionFactory
.OPEN_NEW_WINDOW
.create(window
);
34 register(newWindowAction
);
37 protected void fillMenuBar(IMenuManager menuBar
) {
38 MenuManager fileMenu
= new MenuManager("&File",
39 IWorkbenchActionConstants
.M_FILE
);
40 MenuManager editMenu
= new MenuManager("&Edit",
41 IWorkbenchActionConstants
.M_EDIT
);
42 MenuManager helpMenu
= new MenuManager("&Help",
43 IWorkbenchActionConstants
.M_HELP
);
45 menuBar
.add(fileMenu
);
46 menuBar
.add(editMenu
);
47 // Add a group marker indicating where action set menus will appear.
48 menuBar
.add(new GroupMarker(IWorkbenchActionConstants
.MB_ADDITIONS
));
49 menuBar
.add(helpMenu
);
52 fileMenu
.add(newWindowAction
);
53 fileMenu
.add(new Separator());
54 fileMenu
.add(exitAction
);
57 editMenu
.add(preferences
);
60 // helpMenu.add(aboutAction);