Class AbstractContributionItem
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem
- All Implemented Interfaces:
IContributionItem
- Direct Known Subclasses:
DirectContributionItem
,HandledContributionItem
Common super class for HandledContributionItem and DirectContributionItem
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
static final String
Internal key for transient maps to provide a runnable on widget disposalprotected static final String
protected EHelpService
protected static final String
protected LocalResourceManager
protected Logger
protected Listener
protected IMenuListener
protected Widget
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
canExecuteItem
(Event event) protected void
protected boolean
dropdownEvent
(Event event) protected abstract void
executeItem
(Event event) void
The default implementation of thisIContributionItem
method does nothing.void
The default implementation of thisIContributionItem
method does nothing.protected IEclipseContext
getContext
(MUIElement part) Return a context for this part.protected IEclipseContext
getContextForParent
(MUIElement element) Return a parent context for this part.protected Image
getImage
(String iconURI, LocalResourceManager resourceManager) protected Listener
protected Menu
getModel()
protected ToolItemUpdater
protected void
protected abstract void
handleWidgetDispose
(Event event) protected void
handleWidgetSelection
(Event event) protected void
This method is intended to perform actions additionally to the common actions infill(Menu, int)
protected void
This method is intended to perform actions additionally to the common actions infill(ToolBar, int)
void
void
setParent
(IContributionManager parent) Sets the parent manager of this itemvoid
update()
The default implementation of thisIContributionItem
method does nothing.void
TheContributionItem
implementation of this method declared onIContributionItem
does nothing.protected void
protected void
protected abstract void
protected abstract void
protected void
Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setVisible, toString
-
Field Details
-
FORCE_TEXT
- See Also:
-
ICON_URI
- See Also:
-
DISABLED_URI
- See Also:
-
DISPOSABLE
Internal key for transient maps to provide a runnable on widget disposal- See Also:
-
logger
-
helpService
-
widget
-
localResourceManager
-
-
Constructor Details
-
AbstractContributionItem
public AbstractContributionItem() -
AbstractContributionItem
-
-
Method Details
-
update
public void update()Description copied from class:ContributionItem
The default implementation of thisIContributionItem
method does nothing. Subclasses may override.- Specified by:
update
in interfaceIContributionItem
- Overrides:
update
in classContributionItem
-
update
Description copied from class:ContributionItem
TheContributionItem
implementation of this method declared onIContributionItem
does nothing. Subclasses should override to update their state.- Specified by:
update
in interfaceIContributionItem
- Overrides:
update
in classContributionItem
- Parameters:
id
- the id of the changed property
-
updateMenuItem
protected abstract void updateMenuItem() -
updateToolItem
protected abstract void updateToolItem() -
getImage
-
updateIcons
protected void updateIcons() -
disposeOldImages
protected void disposeOldImages() -
getModel
- Returns:
- the model
-
setParent
Description copied from interface:IContributionItem
Sets the parent manager of this item- Specified by:
setParent
in interfaceIContributionItem
- Overrides:
setParent
in classContributionItem
- Parameters:
parent
- the parent contribution manager
-
fill
Description copied from class:ContributionItem
The default implementation of thisIContributionItem
method does nothing. Subclasses may override.- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
- Parameters:
menu
- the parent menuindex
- the index where the controls are inserted, or-1
to insert at the end
-
postMenuFill
protected void postMenuFill()This method is intended to perform actions additionally to the common actions infill(Menu, int)
-
fill
Description copied from class:ContributionItem
The default implementation of thisIContributionItem
method does nothing. Subclasses may override.- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
- Parameters:
parent
- the parent tool barindex
- the index where the controls are inserted, or-1
to insert at the end
-
postToolbarFill
protected void postToolbarFill()This method is intended to perform actions additionally to the common actions infill(ToolBar, int)
-
getContextForParent
Return a parent context for this part.- Parameters:
element
- the part to start searching from- Returns:
- the parent's closest context, or global context if none in the hierarchy
-
getContext
Return a context for this part.- Parameters:
part
- the part to start searching from- Returns:
- the closest context, or global context if none in the hierarchy
-
getWidget
- Returns:
- the widgets of the contribution
-
dropdownEvent
- Returns:
- whether the event was a drop down on a toolitem
-
handleWidgetSelection
-
executeItem
-
canExecuteItem
- Returns:
- if the item can be executed
-
getItemListener
-
handleHelpRequest
protected void handleHelpRequest() -
handleWidgetDispose
-
updateVisible
protected void updateVisible() -
getUpdater
-
updateItemEnablement
protected void updateItemEnablement()
-