|
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
A SubContributionManager
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.
Constructor Summary | |
SubContributionManager(IContributionManager mgr)
Constructs a new SubContributionManager |
Method Summary | |
void |
add(IAction action)
Adds an action as a contribution item to this manager. |
void |
add(IContributionItem item)
Adds a contribution item to this manager. |
void |
appendToGroup(String groupName,
IAction action)
Adds a contribution item for the given action at the end of the group with the given name. |
void |
appendToGroup(String groupName,
IContributionItem item)
Adds a contribution item to this manager at the end of the group with the given name. |
IContributionItem |
find(String id)
Finds the contribution item with the given id. |
IContributionItem[] |
getItems()
Returns all contribution items known to this manager. |
IContributionManagerOverrides |
getOverrides()
Returns the overrides for the items of this manager. |
IContributionManager |
getParent()
Returns the parent manager. |
void |
insertAfter(String id,
IAction action)
Inserts a contribution item for the given action after the item with the given id. |
void |
insertAfter(String id,
IContributionItem item)
Inserts a contribution item after the item with the given id. |
void |
insertBefore(String id,
IAction action)
Inserts a contribution item for the given action before the item with the given id. |
void |
insertBefore(String id,
IContributionItem item)
Inserts a contribution item before the item with the given id. |
boolean |
isDirty()
Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets. |
boolean |
isEmpty()
Returns whether this manager has any contribution items. |
boolean |
isVisible()
Returns whether the contribution list is visible. |
protected void |
itemAdded(IContributionItem item,
SubContributionItem wrap)
Notifies that an item has been added. |
protected void |
itemRemoved(IContributionItem item)
Notifies that an item has been removed. |
Enumeration |
items()
Deprecated. Use getItems(String value) instead. |
void |
markDirty()
Marks this contribution manager as dirty. |
void |
prependToGroup(String groupName,
IAction action)
Adds a contribution item for the given action at the beginning of the group with the given name. |
void |
prependToGroup(String groupName,
IContributionItem item)
Adds a contribution item to this manager at the beginning of the group with the given name. |
IContributionItem |
remove(IContributionItem item)
Removes the given contribution item from the contribution items known to this manager. |
IContributionItem |
remove(String id)
Removes and returns the contribution item with the given id from this manager. |
void |
removeAll()
Removes all contribution items from this manager. |
void |
setVisible(boolean visible)
Sets the visibility of the manager. |
protected IContributionItem |
unwrap(IContributionItem item)
Unwrap a contribution item. |
protected SubContributionItem |
wrap(IContributionItem item)
Wraps a contribution item in a sub contribution item, and returns the new wrapper. |
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 |
update |
Constructor Detail |
public SubContributionManager(IContributionManager mgr)
SubContributionManager
mgr
- the parent contribution manager. All contributions made to the
SubContributionManager
are forwarded and appear in the
parent manager.Method Detail |
public void add(IAction action)
IContributionManager
add(new ActionContributionItem(action))
.
add
in interface IContributionManager
action
- the actionpublic void add(IContributionItem item)
IContributionManager
add
in interface IContributionManager
item
- the contribution itempublic void appendToGroup(String groupName, IAction action)
IContributionManager
appendToGroup(groupName,new ActionContributionItem(action))
.
appendToGroup
in interface IContributionManager
groupName
- the name of the groupaction
- the actionpublic void appendToGroup(String groupName, IContributionItem item)
IContributionManager
appendToGroup
in interface IContributionManager
groupName
- the name of the groupitem
- the contribution itempublic IContributionItem find(String id)
IContributionManager
find
in interface IContributionManager
id
- the contribution item id
null
if
no item with the given id can be foundpublic IContributionItem[] getItems()
IContributionManager
getItems
in interface IContributionManager
public IContributionManager getParent()
public IContributionManagerOverrides getOverrides()
IContributionManager
getOverrides
in interface IContributionManager
public void insertAfter(String id, IAction action)
IContributionManager
insertAfter(id,new ActionContributionItem(action))
.
insertAfter
in interface IContributionManager
id
- the contribution item idaction
- the action to insertpublic void insertAfter(String id, IContributionItem item)
IContributionManager
insertAfter
in interface IContributionManager
item
- the contribution item to insertpublic void insertBefore(String id, IAction action)
IContributionManager
insertBefore(id,new ActionContributionItem(action))
.
insertBefore
in interface IContributionManager
id
- the contribution item idaction
- the action to insertpublic void insertBefore(String id, IContributionItem item)
IContributionManager
insertBefore
in interface IContributionManager
item
- the contribution item to insertpublic boolean isDirty()
IContributionManager
isDirty
in interface IContributionManager
true
if this manager is dirty, and false
if it is up-to-datepublic boolean isEmpty()
IContributionManager
isEmpty
in interface IContributionManager
true
if there are no items, and
false
otherwisepublic boolean isVisible()
true
then each item within the manager
appears within the parent manager. Otherwise, the items are not visible.
true
if the manager is visibleprotected void itemAdded(IContributionItem item, SubContributionItem wrap)
Subclasses are not expected to override this method.
item
- the item contributed by the clientwrap
- the item contributed to the parent manager as a proxy for the item
contributed by the clientprotected void itemRemoved(IContributionItem item)
Subclasses are not expected to override this method.
item
- the item contributed by the clientpublic Enumeration items()
public void markDirty()
IContributionManager
markDirty
in interface IContributionManager
public void prependToGroup(String groupName, IAction action)
IContributionManager
prependToGroup(groupName,new ActionContributionItem(action))
.
prependToGroup
in interface IContributionManager
groupName
- the name of the groupaction
- the actionpublic void prependToGroup(String groupName, IContributionItem item)
IContributionManager
prependToGroup
in interface IContributionManager
groupName
- the name of the groupitem
- the contribution itempublic IContributionItem remove(String id)
IContributionManager
null
if this manager has no contribution items
with the given id.
remove
in interface IContributionManager
id
- the contribution item id
null
if nonepublic IContributionItem remove(IContributionItem item)
IContributionManager
remove
in interface IContributionManager
item
- the contribution item
item
parameter if the item was removed,
and null
if it was not foundpublic void removeAll()
IContributionManager
removeAll
in interface IContributionManager
public void setVisible(boolean visible)
true
then each item within the manager appears within the parent manager.
Otherwise, the items are not visible.
visible
- the new visibilityprotected SubContributionItem wrap(IContributionItem item)
protected IContributionItem unwrap(IContributionItem item)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |