KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > part > components > services > IPartActionBars


1 /*******************************************************************************
2  * Copyright (c) 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.part.components.services;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.action.ICoolBarManager;
15 import org.eclipse.jface.action.IMenuManager;
16 import org.eclipse.jface.action.IToolBarManager;
17 import org.eclipse.ui.IWorkbenchActionConstants;
18
19 /**
20  * Not intended to be implemented by clients
21  *
22  * @since 3.1
23  */

24 public interface IPartActionBars {
25     /**
26      * Clears the global action handler list.
27      * <p>
28      * Note: Clients who manipulate the global action list are
29      * responsible for calling <code>updateActionBars</code> so that the changes
30      * can be propagated throughout the workbench.
31      * </p>
32      */

33     public void clearGlobalActionHandlers();
34
35     /**
36      * Returns the global action handler for the action with the given id.
37      *
38      * @param actionId an action id declared in the registry
39      * @return an action handler which implements the action id, or
40      * <code>null</code> if none is registered
41      * @see IWorkbenchActionConstants
42      * @see #setGlobalActionHandler(String, IAction)
43      */

44     public IAction getGlobalActionHandler(String JavaDoc actionId);
45
46     /**
47      * Returns the menu manager for a single dropdown menu associated with the part.
48      * Top-level elements in this menu may be individual actions.
49      * <p>
50      * Note: Clients who add or remove items from the returned menu manager are
51      * responsible for calling <code>updateActionBars</code> so that the changes
52      * can be propagated throughout the workbench.
53      * </p>
54      *
55      * @return the menu manager
56      */

57     public IMenuManager getPartMenuManager();
58
59     /**
60      * Returns a menu manager that the part can use to contribute to a menu bar.
61      * Top-level elements in this menu should be things that could be contributed
62      * to the top-level menubar.
63      *
64      * <p>
65      * Note: Clients who add or remove items from the returned menu manager are
66      * responsible for calling <code>updateActionBars</code> so that the changes
67      * can be propagated throughout the workbench.
68      * </p>
69      *
70      * @return the menu manager
71      */

72     public IMenuManager getMenuBarManager();
73     
74     /**
75      * Returns the tool bar manager.
76      * <p>
77      * Note: Clients who add or remove items from the returned tool bar manager are
78      * responsible for calling <code>updateActionBars</code> so that the changes
79      * can be propagated throughout the workbench.
80      * </p>
81      *
82      * @return the tool bar manager
83      */

84     public IToolBarManager getToolBarManager();
85
86     /**
87      * Returns the cool bar manager.
88      * <p>
89      * Note: Clients who add or remove items from the returned cool bar manager are
90      * responsible for calling <code>updateActionBars</code> so that the changes
91      * can be propagated throughout the workbench.
92      * </p>
93      *
94      * @return the cool bar manager.
95      */

96     public ICoolBarManager getCoolBarManager();
97     
98     /**
99      * Sets the global action handler for the action with the given id.
100      * <p>
101      * Note: Clients who manipulate the global action list are
102      * responsible for calling <code>updateActionBars</code> so that the changes
103      * can be propagated throughout the workbench.
104      * </p>
105      *
106      * @param actionId an action id declared in the registry
107      * @param handler an action which implements the action id, or
108      * <code>null</code> to clear any existing handler
109      * @see IWorkbenchActionConstants
110      */

111     public void setGlobalActionHandler(String JavaDoc actionId, IAction handler);
112
113     /**
114      * Updates the action bars.
115      * <p>
116      * Clients who add or remove items from the menu, tool bar, or status line
117      * managers should call this method to propagated the changes throughout
118      * the workbench.
119      * </p>
120      */

121     public void updateActionBars();
122 }
123
Popular Tags