|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.action.SubContributionManager
org.eclipse.jface.action.SubMenuManager
public class SubMenuManager
A SubMenuManager is used to define a set of contribution
items within a parent manager. Once defined, the visibility of the entire set can
be changed as a unit.
A client may ask for and make additions to a submenu. The visibility of these items
is also controlled by the visibility of the SubMenuManager.
| Constructor Summary | |
|---|---|
SubMenuManager(IMenuManager mgr)
Constructs a new manager. |
|
| Method Summary | |
|---|---|
void |
addMenuListener(IMenuListener listener)
Adds a menu listener to this menu. |
void |
dispose()
The default implementation of this IContributionItem
method does nothing. |
void |
disposeManager()
Disposes this sub contribution manager, removing all its items and cleaning up any other resources allocated by it. |
void |
fill(Composite parent)
Fills the given composite control with controls representing this contribution item. |
void |
fill(CoolBar parent,
int index)
Fills the given cool bar with controls representing this contribution item. |
void |
fill(Menu parent,
int index)
Fills the given menu with controls representing this contribution item. |
void |
fill(ToolBar parent,
int index)
Fills the given tool bar with controls representing this contribution item. |
IContributionItem |
find(String id)
Finds the contribution item with the given id. |
IMenuManager |
findMenuUsingPath(String path)
The menu returned is wrapped within a SubMenuManager to
monitor additions and removals. |
IContributionItem |
findUsingPath(String path)
Finds the contribution item at the given path. |
String |
getId()
Returns the identifier of this contribution item. |
protected IMenuManager |
getParentMenuManager()
|
boolean |
getRemoveAllWhenShown()
Returns whether all items should be removed when the menu is about to show, but before notifying menu listeners. |
protected IMenuManager |
getWrapper(IMenuManager mgr)
Returns the menu wrapper for a menu manager. |
boolean |
isDynamic()
Returns whether this contribution item is dynamic. |
boolean |
isEnabled()
Returns whether this contribution item is enabled. |
boolean |
isGroupMarker()
Returns whether this contribution item is a group marker. |
boolean |
isSeparator()
Returns whether this contribution item is a separator. |
void |
removeAll()
Remove all contribution items. |
void |
removeMenuListener(IMenuListener listener)
Removes the given menu listener from this menu. |
void |
saveWidgetState()
Saves any state information of the control(s) owned by this contribution item. |
void |
setParent(IContributionManager parent)
Sets the parent manager of this item |
void |
setRemoveAllWhenShown(boolean removeAll)
Sets whether all items should be removed when the menu is about to show, but before notifying menu listeners. |
void |
setVisible(boolean visible)
Sets the visibility of the manager. |
void |
update()
Updates any SWT controls cached by this contribution item with any changes which have been made to this contribution item since the last update. |
void |
update(boolean force)
Updates this manager's underlying widget(s) with any changes which have been made to it or its items. |
void |
update(String id)
Updates any SWT controls cached by this contribution item with changes for the the given property. |
void |
updateAll(boolean force)
Incrementally builds the menu from the contribution items, and does so recursively for all submenus. |
protected SubMenuManager |
wrapMenu(IMenuManager menu)
Wraps a menu manager in a sub menu manager, and returns the new wrapper. |
| Methods inherited from class org.eclipse.jface.action.SubContributionManager |
|---|
add, add, appendToGroup, appendToGroup, getItems, getOverrides, getParent, insertAfter, insertAfter, insertBefore, insertBefore, isDirty, isEmpty, isVisible, itemAdded, itemRemoved, items, markDirty, prependToGroup, prependToGroup, remove, remove, unwrap, wrap |
| 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, getItems, getOverrides, insertAfter, insertAfter, insertBefore, insertBefore, isDirty, isEmpty, markDirty, prependToGroup, prependToGroup, remove, remove |
| Methods inherited from interface org.eclipse.jface.action.IContributionItem |
|---|
isDirty, isVisible |
| Constructor Detail |
|---|
public SubMenuManager(IMenuManager mgr)
mgr - the parent manager. All contributions made to the
SubMenuManager are forwarded and appear in the
parent manager.| Method Detail |
|---|
public void addMenuListener(IMenuListener listener)
IMenuManager
addMenuListener in interface IMenuManagerlistener - a menu listenerpublic void dispose()
IContributionItem
method does nothing. Subclasses may override.
dispose in interface IContributionItempublic void disposeManager()
SubContributionManager
disposeManager in class SubContributionManagerpublic void fill(Composite parent)
IContributionItemStatusLineManager.
fill in interface IContributionItemparent - the parent control
public void fill(CoolBar parent,
int index)
IContributionItemCoolBarManager.
fill in interface IContributionItemparent - the parent cool barindex - the index where the controls are inserted,
or -1 to insert at the end
public void fill(Menu parent,
int index)
IContributionItemMenuManager.
fill in interface IContributionItemparent - the parent menuindex - the index where the controls are inserted,
or -1 to insert at the end
public void fill(ToolBar parent,
int index)
IContributionItemToolBarManager.
fill in interface IContributionItemparent - the parent tool barindex - the index where the controls are inserted,
or -1 to insert at the endpublic IContributionItem find(String id)
IContributionManager
find in interface IContributionManagerfind in class SubContributionManagerid - the contribution item id
null if
no item with the given id can be foundpublic IMenuManager findMenuUsingPath(String path)
The menu returned is wrapped within a SubMenuManager to
monitor additions and removals. If the visibility of this menu is modified
the visibility of the submenus is also modified.
findMenuUsingPath in interface IMenuManagerpath - the path string
null
if there is no such contribution item or if the item does
not have an associated menu managerpublic IContributionItem findUsingPath(String path)
IMenuManager'/'.
findUsingPath in interface IMenuManagerpath - the path string
null if there is no
such contribution itempublic String getId()
IContributionItem
getId in interface IContributionItemnull
if noneprotected final IMenuManager getParentMenuManager()
public boolean getRemoveAllWhenShown()
IMenuManagerfalse.
getRemoveAllWhenShown in interface IMenuManagertrue if all items should be removed when shown,
false if notprotected IMenuManager getWrapper(IMenuManager mgr)
The sub menus within this menu are wrapped within a SubMenuManager to
monitor additions and removals. If the visibility of this menu is modified
the visibility of the sub menus is also modified.
mgr - the menu manager to be wrapped
public boolean isDynamic()
IContributionItem
isDynamic in interface IContributionItemtrue if this item is dynamic, and
false for normal itemspublic boolean isEnabled()
IContributionItem
isEnabled in interface IContributionItemisEnabled in interface IMenuManagertrue if this item is enabledpublic boolean isGroupMarker()
IContributionItem
isGroupMarker in interface IContributionItemtrue if this item is a group marker, and
false for normal itemsGroupMarker,
IContributionManager.appendToGroup(String, IContributionItem),
IContributionManager.prependToGroup(String, IContributionItem)public boolean isSeparator()
IContributionItem
isSeparator in interface IContributionItemtrue if this item is a separator, and
false for normal itemsSeparatorpublic void removeAll()
removeAll in interface IContributionManagerremoveAll in class SubContributionManagerpublic void removeMenuListener(IMenuListener listener)
IMenuManager
removeMenuListener in interface IMenuManagerlistener - the menu listenerpublic void saveWidgetState()
IContributionItem
saveWidgetState in interface IContributionItempublic void setParent(IContributionManager parent)
IContributionItem
setParent in interface IContributionItemparent - the parent contribution managerpublic void setRemoveAllWhenShown(boolean removeAll)
IMenuManager
setRemoveAllWhenShown in interface IMenuManagerremoveAll - true if all items should be removed when shown,
false if notpublic void setVisible(boolean visible)
SubContributionManagertrue
then each item within the manager appears within the parent manager.
Otherwise, the items are not visible.
setVisible in interface IContributionItemsetVisible in class SubContributionManagervisible - the new visibilitypublic void update()
IContributionItem
update in interface IContributionItempublic void update(boolean force)
IContributionManager
update in interface IContributionManagerforce - true means update even if not dirty,
and false for normal incremental updatingpublic void update(String id)
IContributionItem
update in interface IContributionItemid - the id of the changed propertypublic void updateAll(boolean force)
IMenuManager
updateAll in interface IMenuManagerforce - true means update even if not dirty,
and false for normal incremental updatingprotected SubMenuManager wrapMenu(IMenuManager menu)
menu - the menu manager to wrap
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.