public abstract class SubContributionManager extends Object implements IContributionManager
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 and Description |
|---|
SubContributionManager(IContributionManager mgr)
Constructs a new
SubContributionManager |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
disposeManager()
Disposes this sub contribution manager, removing all its items
and cleaning up any other resources allocated by it.
|
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)
Unwraps a nested contribution item.
|
protected SubContributionItem |
wrap(IContributionItem item)
Wraps a contribution item in a sub contribution item, and returns the new wrapper.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdatepublic SubContributionManager(IContributionManager mgr)
SubContributionManagermgr - the parent contribution manager. All contributions made to the
SubContributionManager are forwarded and appear in the
parent manager.public void add(IAction action)
IContributionManageradd(new ActionContributionItem(action)).add in interface IContributionManageraction - the actionpublic void add(IContributionItem item)
IContributionManageradd in interface IContributionManageritem - the contribution itempublic void appendToGroup(String groupName, IAction action)
IContributionManagerappendToGroup(groupName,new ActionContributionItem(action)).appendToGroup in interface IContributionManagergroupName - the name of the groupaction - the actionpublic void appendToGroup(String groupName, IContributionItem item)
IContributionManagerappendToGroup in interface IContributionManagergroupName - the name of the groupitem - the contribution itempublic void disposeManager()
public IContributionItem find(String id)
IContributionManagerfind in interface IContributionManagerid - the contribution item idnull if
no item with the given id can be foundpublic IContributionItem[] getItems()
IContributionManagergetItems in interface IContributionManagerpublic IContributionManager getParent()
public IContributionManagerOverrides getOverrides()
IContributionManagergetOverrides in interface IContributionManagerpublic void insertAfter(String id, IAction action)
IContributionManagerinsertAfter(id,new ActionContributionItem(action)).insertAfter in interface IContributionManagerid - the contribution item idaction - the action to insertpublic void insertAfter(String id, IContributionItem item)
IContributionManagerinsertAfter in interface IContributionManagerid - the contribution item iditem - the contribution item to insertpublic void insertBefore(String id, IAction action)
IContributionManagerinsertBefore(id,new ActionContributionItem(action)).insertBefore in interface IContributionManagerid - the contribution item idaction - the action to insertpublic void insertBefore(String id, IContributionItem item)
IContributionManagerinsertBefore in interface IContributionManagerid - the contribution item iditem - the contribution item to insertpublic boolean isDirty()
IContributionManagerisDirty in interface IContributionManagertrue if this manager is dirty, and false
if it is up-to-datepublic boolean isEmpty()
IContributionManagerisEmpty in interface IContributionManagertrue 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()
IContributionManagermarkDirty in interface IContributionManagerpublic void prependToGroup(String groupName, IAction action)
IContributionManagerprependToGroup(groupName,new ActionContributionItem(action)).prependToGroup in interface IContributionManagergroupName - the name of the groupaction - the actionpublic void prependToGroup(String groupName, IContributionItem item)
IContributionManagerprependToGroup in interface IContributionManagergroupName - the name of the groupitem - the contribution itempublic IContributionItem remove(String id)
IContributionManagernull if this manager has no contribution items
with the given id.remove in interface IContributionManagerid - the contribution item idnull if nonepublic IContributionItem remove(IContributionItem item)
IContributionManagerremove in interface IContributionManageritem - the contribution itemitem parameter if the item was removed,
and null if it was not foundpublic void removeAll()
IContributionManagerremoveAll in interface IContributionManagerpublic 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)
SubContributionItem, then its inner item is
returned. Otherwise, the item itself is returned.item - The item to unwrap; may be null.item, if item is
a SubContributionItem;item
otherwise.Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.