Project

General

Profile

Download (1.39 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.taxeditor.editor;
2

    
3
import org.eclipse.jface.action.IMenuManager;
4
import org.eclipse.ui.IWorkbenchWindow;
5
import org.eclipse.ui.actions.ActionFactory;
6
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
7
import org.eclipse.ui.application.ActionBarAdvisor;
8
import org.eclipse.ui.application.IActionBarConfigurer;
9

    
10
/**
11
 * An action bar advisor is responsible for creating, adding, and disposing of
12
 * the actions added to a workbench window. Each window will be populated with
13
 * new actions.
14
 */
15
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
16

    
17
	// Actions - important to allocate these only in makeActions, and then use
18
	// them
19
	// in the fill methods. This ensures that the actions aren't recreated
20
	// when fillActionBars is called with FILL_PROXY.
21
	private IWorkbenchAction exitAction;
22

    
23
	public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
24
		super(configurer);
25
	}
26

    
27
	protected void makeActions(final IWorkbenchWindow window) {
28
		// Creates the actions and registers them.
29
		// Registering is needed to ensure that key bindings work.
30
		// The corresponding commands keybindings are defined in the plugin.xml
31
		// file.
32
		// Registering also provides automatic disposal of the actions when
33
		// the window is closed.
34

    
35
		exitAction = ActionFactory.QUIT.create(window);
36
		register(exitAction);
37
	}
38

    
39
	protected void fillMenuBar(IMenuManager menuBar) {
40
	}
41

    
42
}
(2-2/5)