org.eclipse.jface.action
Class ContributionItem
java.lang.Object
org.eclipse.jface.action.ContributionItem
- All Implemented Interfaces:
- IContributionItem
- Direct Known Subclasses:
- AbstractGroupMarker, ActionContributionItem, ControlContribution, NewWizardMenu, OpenWithMenu, PerspectiveMenu, StatusLineContributionItem, ToolBarContributionItem
- public abstract class ContributionItem
- extends Object
- implements IContributionItem
An abstract base implementation for contribution items.
Method Summary
|
void
| dispose()
The default implementation of this IContributionItem
method does nothing.
|
void
| fill(Composite parent)
The default implementation of this IContributionItem
method does nothing.
|
void
| fill(CoolBar parent,
int index)
The default implementation of this IContributionItem
method does nothing.
|
void
| fill(Menu menu,
int index)
The default implementation of this IContributionItem
method does nothing.
|
void
| fill(ToolBar parent,
int index)
The default implementation of this IContributionItem
method does nothing.
|
String
| getId()
Returns the identifier of this contribution item.
|
IContributionManager
| getParent()
Returns the parent contribution manager.
|
boolean
| isDirty()
The default implementation of this IContributionItem
method returns false.
|
boolean
| isDynamic()
The default implementation of this IContributionItem
method returns false.
|
boolean
| isEnabled()
The default implementation of this IContributionItem
method returns true.
|
boolean
| isGroupMarker()
The default implementation of this IContributionItem
method returns false.
|
boolean
| isSeparator()
The default implementation of this IContributionItem
method returns false.
|
boolean
| isVisible()
The default implementation of this IContributionItem
method returns the value recorded in an internal state variable,
which is true by default.
|
void
| saveWidgetState()
The default implementation of this IContributionItem
method does nothing.
|
void
| setParent(IContributionManager parent)
Sets the parent manager of this item
|
void
| setVisible(boolean visible)
The default implementation of this IContributionItem
method stores the value in an internal state variable,
which is true by default.
|
String
| toString()
Returns a string representation of this contribution item
suitable only for debugging.
|
void
| update()
The default implementation of this IContributionItem
method does nothing.
|
void
| update(String id)
The ContributionItem implementation of this
method declared on IContributionItem does nothing.
|
ContributionItem
protected ContributionItem()
- Creates a contribution item with a null id.
Calls this(String) with null.
ContributionItem
protected ContributionItem(String id)
- Creates a contribution item with the given (optional) id.
The given id is used to find items in a contribution manager,
and for positioning items relative to other items.
- Parameters:
- id - the contribution item identifier, or null
dispose
public void dispose()
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- dispose in interface IContributionItem
fill
public void fill(Composite parent)
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- fill in interface IContributionItem
- Parameters:
- parent - the parent control
fill
public void fill(Menu menu,
int index)
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- fill in interface IContributionItem
- Parameters:
- menu - the parent menu
- index - the index where the controls are inserted,
or -1 to insert at the end
fill
public void fill(ToolBar parent,
int index)
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- fill in interface IContributionItem
- Parameters:
- parent - the parent tool bar
- index - the index where the controls are inserted,
or -1 to insert at the end
fill
public void fill(CoolBar parent,
int index)
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- fill in interface IContributionItem
- Parameters:
- parent - the parent cool bar
- index - the index where the controls are inserted,
or -1 to insert at the end
- Since:
- 3.0
saveWidgetState
public void saveWidgetState()
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- saveWidgetState in interface IContributionItem
- Since:
- 3.0
getId
public String 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 interface IContributionItem
- Returns:
- the contribution item identifier, or null
if none
getParent
public IContributionManager getParent()
- Returns the parent contribution manager.
- Returns:
- the parent contribution manager
- Since:
- 2.0
isDirty
public boolean isDirty()
- The default implementation of this IContributionItem
method returns false. Subclasses may override.
- Specified by:
- isDirty in interface IContributionItem
- Returns:
- true if this item is dirty
isEnabled
public boolean isEnabled()
- The default implementation of this IContributionItem
method returns true. Subclasses may override.
- Specified by:
- isEnabled in interface IContributionItem
- Returns:
- true if this item is enabled
isDynamic
public boolean isDynamic()
- The default implementation of this IContributionItem
method returns false. Subclasses may override.
- Specified by:
- isDynamic in interface IContributionItem
- Returns:
- true if this item is dynamic, and
false for normal items
isGroupMarker
public boolean isGroupMarker()
- The default implementation of this IContributionItem
method returns false. Subclasses may override.
- Specified by:
- isGroupMarker in interface IContributionItem
- Returns:
- true if this item is a group marker, and
false for normal items
- See Also:
- GroupMarker,
IContributionManager.appendToGroup(java.lang.String, org.eclipse.jface.action.IAction),
IContributionManager.prependToGroup(java.lang.String, org.eclipse.jface.action.IAction)
isSeparator
public boolean isSeparator()
- The default implementation of this IContributionItem
method returns false. Subclasses may override.
- Specified by:
- isSeparator in interface IContributionItem
- Returns:
- true if this item is a separator, and
false for normal items
- See Also:
- Separator
isVisible
public boolean isVisible()
- The default implementation of this IContributionItem
method returns the value recorded in an internal state variable,
which is true by default. setVisible
should be used to change this setting.
- Specified by:
- isVisible in interface IContributionItem
- Returns:
- true if this item is visible, and
false otherwise
setVisible
public void setVisible(boolean visible)
- The default implementation of this IContributionItem
method stores the value in an internal state variable,
which is true by default.
- Specified by:
- setVisible in interface IContributionItem
- Parameters:
- visible - true if this item should be visible, and
false otherwise
toString
public String toString()
- Returns a string representation of this contribution item
suitable only for debugging.
update
public void update()
- The default implementation of this IContributionItem
method does nothing. Subclasses may override.
- Specified by:
- update in interface IContributionItem
setParent
public void setParent(IContributionManager parent)
- Description copied from interface: IContributionItem
- Sets the parent manager of this item
- Specified by:
- setParent in interface IContributionItem
- Parameters:
- parent - the parent contribution manager
update
public void update(String id)
- The ContributionItem implementation of this
method declared on IContributionItem does nothing.
Subclasses should override to update their state.
- Specified by:
- update in interface IContributionItem
- Parameters:
- id - the id of the changed property
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.