|
Eclipse Platform 2.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.eclipse.jface.action.SubContributionManager
|
+--org.eclipse.jface.action.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 |
fill(Composite parent)
Fills the given composite control 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()
Returns the parent menu manager that this sub-manager contributes to. |
boolean |
getRemoveAllWhenShown()
Returns whether all items should be removed when the menu is first shown, 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 menu should be enabled or not. |
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 |
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 first shown, but before notifying menu listeners. |
void |
setVisible(boolean visible)
Sets whether this contribution item is visibile within its 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 dispose()
IContributionItem
method does nothing. Subclasses may override.
dispose in interface IContributionItempublic void addMenuListener(IMenuListener listener)
IMenuManager
addMenuListener in interface IMenuManagerlistener - a menu listenerpublic void fill(Composite parent)
IContributionItemStatusLineManager.
fill in interface IContributionItemparent - the parent control
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 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 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 foundprotected final IMenuManager getParentMenuManager()
public String getId()
IContributionItem
getId in interface IContributionItemnull
if nonepublic 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.
public boolean isDynamic()
IContributionItem
isDynamic in interface IContributionItemtrue if this item is dynamic, and
false for normal itemspublic boolean isEnabled()
IMenuManager
isEnabled in interface IMenuManagertrue if enabled, and
false if disabledpublic boolean isGroupMarker()
IContributionItem
isGroupMarker in interface IContributionItemtrue if this item is a group marker, and
false for normal itemsGroupMarker,
IContributionManager.appendToGroup(java.lang.String, org.eclipse.jface.action.IAction),
IContributionManager.prependToGroup(java.lang.String, org.eclipse.jface.action.IAction)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 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)
IContributionItem
setVisible in interface IContributionItemsetVisible in class SubContributionManagervisible - true if this item should be visible, and
false otherwisepublic 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 updateAll(boolean force)
IMenuManager
updateAll in interface IMenuManagerforce - true means update even if not dirty,
and false for normal incremental updatingpublic void update(String id)
IContributionItem
update in interface IContributionItemprotected SubMenuManager wrapMenu(IMenuManager menu)
|
Eclipse Platform 2.1 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||