1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package sk.uniba.euromath.editor.actions;
17
18 import org.eclipse.gef.ui.actions.ActionRegistry;
19 import org.eclipse.jface.action.ICoolBarManager;
20 import org.eclipse.jface.action.IMenuManager;
21 import org.eclipse.jface.action.IStatusLineManager;
22 import org.eclipse.jface.action.IToolBarManager;
23
24 /***
25 * Contributor to global bars like menu, status line, tool bar, cool bar and to
26 * local bars like context menu. Contribution to global bars must be by
27 * IMultiViewActions stored in global registry. Reason is: when focus changes,
28 * actions are moved to active EditorPart (if is some active) and contribution
29 * by old active IEditor are removed. All actions contributed to global bars must
30 * have ids. Contribution to local context menu is done by creation of context
31 * menu and contributing to it by method contributeToContextMenu. In method init
32 * acquires global action registry for all open IEditors in all open
33 * EditorSites.
34 *
35 * @author Tomáš Studva Sep 19, 2005
36 */
37
38 public interface IActionContributor {
39
40 /***
41 * Contribute to global tool bar by modifying passed manager.
42 *
43 * @param manager
44 */
45 public void contributeToToolBar(IToolBarManager manager);
46
47 /***
48 * Contribute to status line by modifying passed manager.
49 *
50 * @param manager
51 */
52 public void contributeToStatusLine(IStatusLineManager manager);
53
54 /***
55 * Contribute to global cool bar by modifying passed manager.
56 *
57 * @param manager
58 */
59 public void contributeCoolBar(ICoolBarManager manager);
60
61 /***
62 * Contribute to global menu by modifying passed manager.
63 *
64 * @param manager
65 */
66 public void contributeToMenu(IMenuManager manager);
67
68 /***
69 * Initialization this contributor with access to global registry. After
70 * this call contributor can create actions and contribute using global
71 * registry. Created actions are stored globally for all open IEditors. When
72 * focus changes, actions are automatically moved to active EditorPart.
73 *
74 * @param actionRegistry
75 * global action registry
76 *
77 */
78 public void init(ActionRegistry actionRegistry);
79
80 /***
81 * Returns global action registry passed in init.
82 * @see #init(ActionRegistry)
83 *
84 * @return global action registry
85 */
86 public ActionRegistry getGlobalActionRegistry();
87
88 }