Package org.eclipse.jface.action
Class SubContributionItem
java.lang.Object
org.eclipse.jface.action.SubContributionItem
- All Implemented Interfaces:
IContributionItem
- Direct Known Subclasses:
ActionSetContributionItem
A
SubContributionItem
is a wrapper for an IContributionItem
.
It is used within a SubContributionManager
to control the visibility
of items.
This class is not intended to be subclassed.
-
Constructor Summary
ConstructorDescriptionCreates a newSubContributionItem
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
The default implementation of thisIContributionItem
delegates to the inner item.void
Fills the given composite control with controls representing this contribution item.void
Fills the given cool bar with controls representing this contribution item.void
Fills the given menu with controls representing this contribution item.void
Fills the given tool bar with controls representing this contribution item.getId()
Returns the identifier of this contribution item.Returns the inner contribution item.boolean
isDirty()
Returns whether this contribution item is dirty.boolean
Returns whether this contribution item is dynamic.boolean
Returns whether this contribution item is enabled.boolean
Returns whether this contribution item is a group marker.boolean
Returns whether this contribution item is a separator.boolean
Returns whether this contribution item is visibile within its manager.void
Saves any state information of the control(s) owned by this contribution item.void
setParent
(IContributionManager parent) Sets the parent manager of this itemvoid
setVisible
(boolean visible) Sets whether this contribution item is visibile within its manager.toString()
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
Updates any SWT controls cached by this contribution item with changes for the the given property.
-
Constructor Details
-
SubContributionItem
Creates a newSubContributionItem
.- Parameters:
item
- the contribution item to be wrapped
-
-
Method Details
-
dispose
public void dispose()The default implementation of thisIContributionItem
delegates to the inner item. Subclasses may override.- Specified by:
dispose
in interfaceIContributionItem
-
fill
Description copied from interface:IContributionItem
Fills the given composite control with controls representing this contribution item. Used byStatusLineManager
.- Specified by:
fill
in interfaceIContributionItem
- Parameters:
parent
- the parent control
-
fill
Description copied from interface:IContributionItem
Fills the given menu with controls representing this contribution item. Used byMenuManager
.- Specified by:
fill
in interfaceIContributionItem
- Parameters:
parent
- the parent menuindex
- the index where the controls are inserted, or-1
to insert at the end
-
fill
Description copied from interface:IContributionItem
Fills the given tool bar with controls representing this contribution item. Used byToolBarManager
.- Specified by:
fill
in interfaceIContributionItem
- Parameters:
parent
- the parent tool barindex
- the index where the controls are inserted, or-1
to insert at the end
-
getId
Description copied from interface:IContributionItem
Returns the identifier of this contribution item. The id is used for retrieving an item from its manager.- Specified by:
getId
in interfaceIContributionItem
- Returns:
- the contribution item identifier, or
null
if none
-
getInnerItem
Returns the inner contribution item.- Returns:
- the inner contribution item
-
isEnabled
public boolean isEnabled()Description copied from interface:IContributionItem
Returns whether this contribution item is enabled.- Specified by:
isEnabled
in interfaceIContributionItem
- Returns:
true
if this item is enabled
-
isDirty
public boolean isDirty()Description copied from interface:IContributionItem
Returns whether this contribution item is dirty. A dirty item will be recreated when the action bar is updated.- Specified by:
isDirty
in interfaceIContributionItem
- Returns:
true
if this item is dirty
-
isDynamic
public boolean isDynamic()Description copied from interface:IContributionItem
Returns whether this contribution item is dynamic. A dynamic contribution item contributes items conditionally, dependent on some internal state.- Specified by:
isDynamic
in interfaceIContributionItem
- Returns:
true
if this item is dynamic, andfalse
for normal items
-
isGroupMarker
public boolean isGroupMarker()Description copied from interface:IContributionItem
Returns whether this contribution item is a group marker. This information is used when adding items to a group.- Specified by:
isGroupMarker
in interfaceIContributionItem
- Returns:
true
if this item is a group marker, andfalse
for normal items- See Also:
-
isSeparator
public boolean isSeparator()Description copied from interface:IContributionItem
Returns whether this contribution item is a separator. This information is used to enable hiding of unnecessary separators.- Specified by:
isSeparator
in interfaceIContributionItem
- Returns:
true
if this item is a separator, andfalse
for normal items- See Also:
-
isVisible
public boolean isVisible()Description copied from interface:IContributionItem
Returns whether this contribution item is visibile within its manager.- Specified by:
isVisible
in interfaceIContributionItem
- Returns:
true
if this item is visible, andfalse
otherwise
-
setParent
Description copied from interface:IContributionItem
Sets the parent manager of this item- Specified by:
setParent
in interfaceIContributionItem
- Parameters:
parent
- the parent contribution manager
-
setVisible
public void setVisible(boolean visible) Description copied from interface:IContributionItem
Sets whether this contribution item is visibile within its manager.- Specified by:
setVisible
in interfaceIContributionItem
- Parameters:
visible
-true
if this item should be visible, andfalse
otherwise
-
update
public void update()Description copied from interface:IContributionItem
Updates any SWT controls cached by this contribution item with any changes which have been made to this contribution item since the last update. Called by contribution manager update methods.- Specified by:
update
in interfaceIContributionItem
-
update
Description copied from interface:IContributionItem
Updates any SWT controls cached by this contribution item with changes for the the given property.- Specified by:
update
in interfaceIContributionItem
- Parameters:
id
- the id of the changed property
-
fill
Description copied from interface:IContributionItem
Fills the given cool bar with controls representing this contribution item. Used byCoolBarManager
.- Specified by:
fill
in interfaceIContributionItem
- Parameters:
parent
- the parent cool barindex
- the index where the controls are inserted, or-1
to insert at the end
-
saveWidgetState
public void saveWidgetState()Description copied from interface:IContributionItem
Saves any state information of the control(s) owned by this contribution item. The contribution manager calls this method before disposing of the controls.- Specified by:
saveWidgetState
in interfaceIContributionItem
-
toString
-