8886b43a645c5c7ed4addbc9d4514deb2d048f99
[taxeditor.git] / taxeditor-application / src / main / java / eu / etaxonomy / taxeditor / ApplicationActionBarAdvisor.java
1 package eu.etaxonomy.taxeditor;
2
3 import org.eclipse.ui.IWorkbenchWindow;
4 import org.eclipse.ui.actions.ActionFactory;
5 import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
6 import org.eclipse.ui.application.ActionBarAdvisor;
7 import org.eclipse.ui.application.IActionBarConfigurer;
8
9 import eu.etaxonomy.taxeditor.store.StoreUtil;
10
11 /**
12 * An action bar advisor is responsible for creating, adding, and disposing of
13 * the actions added to a workbench window. Each window will be populated with
14 * new actions.
15 */
16 public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
17
18 private IWorkbenchAction saveAction;
19 private IWorkbenchAction saveAllAction;
20
21 public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
22 super(configurer);
23 }
24
25 protected void makeActions(final IWorkbenchWindow window) {
26 StoreUtil.setStatusLineManager(getActionBarConfigurer().getStatusLineManager());
27
28 saveAction = ActionFactory.SAVE.create(window);
29 register(saveAction);
30
31 saveAllAction = ActionFactory.SAVE_ALL.create(window);
32 register(saveAllAction);
33 }
34 }