|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.jface.action.ContributionManager
org.eclipse.jface.action.MenuManager
org.eclipse.gmf.runtime.common.ui.action.ActionMenuManager
An implementation of an IMenuManager that inherits its
UI (text + icon + hints) from a given action.
When filled in a toolbar, the menu is rendered as a tool item
with two parts: a button, whose icon comes from the supplied
action handler, and a drop-down menu arrow.
When the arrow is pressed, the drop-down menu is shown. When the
button is pressed, the associated action is executed. The manager can have
an optional style to retarget the last executed action. In this
case the tool item UI reflects the last executed sub-action from the menu.
When filled in a menu, this menu shows up as a normal cascading menu with
its GUI inherited from the supplied action.
| Nested Class Summary | |
class |
ActionMenuManager.MenuCreatorAction
An action that provides a menu and fills it from the contribution items of the enclosing menu manager. |
| Field Summary | |
protected ActionMenuManager.MenuCreatorAction |
action
the associated menu action |
protected IAction |
defaultAction
the associated menu action |
| Constructor Summary | |
ActionMenuManager(java.lang.String id,
IAction actionHandler)
Creates a new instance of ActionMenuManager with
a given action handler. |
|
ActionMenuManager(java.lang.String id,
IAction actionHandler,
boolean retargetLastAction)
Creates a new instance of ActionMenuManager with
a given action handler and an option to retarget the last
executed menu action. |
|
| Method Summary | |
void |
dispose()
|
void |
fill(Composite parent)
|
void |
fill(Menu parent,
int index)
|
void |
fill(ToolBar parent,
int index)
|
IAction |
getDefaultAction()
|
protected IContributionItem[] |
getRealItems()
Returns the contribution items of this manager. |
boolean |
isDirty()
|
boolean |
isDynamic()
|
boolean |
isEnabled()
|
boolean |
isGroupMarker()
|
protected boolean |
isRetargetLastAction()
Returns whether the option to retarget last action was requested |
boolean |
isSeparator()
|
boolean |
isVisible()
|
protected void |
itemAdded(IContributionItem item)
|
protected void |
itemRemoved(IContributionItem item)
|
protected void |
setDefaultAction(IAction defaultAction)
|
void |
setParent(IContributionManager parent)
|
void |
setVisible(boolean visible)
|
protected void |
subActionSelected(IAction subActionHandler)
Handle subaction selection |
void |
update()
|
void |
update(boolean force)
|
void |
update(java.lang.String id)
|
void |
updateAll(boolean force)
|
| Methods inherited from class org.eclipse.jface.action.MenuManager |
addMenuListener, createContextMenu, createMenuBar, createMenuBar, fill, findMenuUsingPath, findUsingPath, getId, getMenu, getMenuText, getOverrides, getParent, getRemoveAllWhenShown, isSubstituteFor, markDirty, removeMenuListener, saveWidgetState, setOverrides, setRemoveAllWhenShown, update |
| Methods inherited from class org.eclipse.jface.action.ContributionManager |
add, add, allowItem, appendToGroup, appendToGroup, dumpStatistics, find, getItems, hasDynamicItems, indexOf, indexOf, insert, insertAfter, insertAfter, insertBefore, insertBefore, internalSetItems, isEmpty, prependToGroup, prependToGroup, remove, remove, removeAll, replaceItem, setDirty |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.action.IContributionManager |
add, add, appendToGroup, appendToGroup, find, getItems, insertAfter, insertAfter, insertBefore, insertBefore, isEmpty, prependToGroup, prependToGroup, remove, remove, removeAll |
| Field Detail |
protected final ActionMenuManager.MenuCreatorAction action
protected IAction defaultAction
| Constructor Detail |
public ActionMenuManager(java.lang.String id,
IAction actionHandler)
ActionMenuManager with
a given action handler. The manager does not retarget the last
selected action from the menu
id - The menu manager idactionHandler - the menu associated action handler
public ActionMenuManager(java.lang.String id,
IAction actionHandler,
boolean retargetLastAction)
ActionMenuManager with
a given action handler and an option to retarget the last
executed menu action.
id - The menu manager idactionHandler - the menu associated action handlerretargetLastAction - whether to retarget the last action or not| Method Detail |
protected boolean isRetargetLastAction()
true if retargetLastAction is enabled, false otherwiseprotected void subActionSelected(IAction subActionHandler)
subActionHandler - The selected sub action handlerpublic void fill(Composite parent)
public void fill(Menu parent,
int index)
public void fill(ToolBar parent,
int index)
public void dispose()
public boolean isEnabled()
public boolean isDirty()
public boolean isDynamic()
public boolean isGroupMarker()
public boolean isSeparator()
public boolean isVisible()
public void setParent(IContributionManager parent)
public void setVisible(boolean visible)
public void update()
public void update(java.lang.String id)
public void updateAll(boolean force)
public void update(boolean force)
protected void itemAdded(IContributionItem item)
protected void itemRemoved(IContributionItem item)
protected IContributionItem[] getRealItems()
public IAction getDefaultAction()
protected void setDefaultAction(IAction defaultAction)
|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.