|
Eclipse Platform 2.0 |
||||||||||
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 |
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. |
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 |
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 IMenuManager
listener
- a menu listenerpublic void fill(Composite parent)
IContributionItem
StatusLineManager
.
fill
in interface IContributionItem
parent
- the parent controlpublic void fill(Menu parent, int index)
IContributionItem
MenuManager
.
fill
in interface IContributionItem
parent
- the parent menuindex
- the index where the controls are inserted,
or -1
to insert at the endpublic void fill(ToolBar parent, int index)
IContributionItem
ToolBarManager
.
fill
in interface IContributionItem
parent
- 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 IMenuManager
path
- 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 IMenuManager
path
- the path string
null
if there is no
such contribution itempublic IContributionItem find(String id)
IContributionManager
find
in interface IContributionManager
find
in class SubContributionManager
id
- the contribution item id
null
if
no item with the given id can be foundpublic String getId()
IContributionItem
getId
in interface IContributionItem
null
if nonepublic boolean getRemoveAllWhenShown()
IMenuManager
false
.
getRemoveAllWhenShown
in interface IMenuManager
true
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 IContributionItem
true
if this item is dynamic, and
false
for normal itemspublic boolean isEnabled()
IMenuManager
isEnabled
in interface IMenuManager
true
if enabled, and
false
if disabledpublic boolean isGroupMarker()
IContributionItem
isGroupMarker
in interface IContributionItem
true
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 IContributionItem
true
if this item is a separator, and
false
for normal itemsSeparator
public void removeAll()
removeAll
in interface IContributionManager
removeAll
in class SubContributionManager
public void removeMenuListener(IMenuListener listener)
IMenuManager
removeMenuListener
in interface IMenuManager
listener
- the menu listenerpublic void setParent(IContributionManager parent)
IContributionItem
setParent
in interface IContributionItem
parent
- the parent contribution managerpublic void setRemoveAllWhenShown(boolean removeAll)
IMenuManager
setRemoveAllWhenShown
in interface IMenuManager
removeAll
- true
if all items should be removed when shown, false
if notpublic void setVisible(boolean visible)
IContributionItem
setVisible
in interface IContributionItem
setVisible
in class SubContributionManager
visible
- true
if this item should be visible, and
false
otherwisepublic void update()
IContributionItem
update
in interface IContributionItem
public void update(boolean force)
IContributionManager
update
in interface IContributionManager
force
- true
means update even if not dirty,
and false
for normal incremental updatingpublic void updateAll(boolean force)
IMenuManager
updateAll
in interface IMenuManager
force
- true
means update even if not dirty,
and false
for normal incremental updatingpublic void update(String id)
IContributionItem
update
in interface IContributionItem
protected SubMenuManager wrapMenu(IMenuManager menu)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |