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
FieldsModifier and TypeFieldDescriptionprotected IContributionFactoryprotected static final Stringstatic final StringInternal key for transient maps to provide a runnable on widget disposalprotected static final Stringprotected EHelpServiceprotected static final Stringprotected LocalResourceManagerprotected Loggerprotected Listenerprotected IMenuListenerprotected Widget -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancanExecuteItem(Event event) protected voidprotected booleandropdownEvent(Event event) protected abstract voidexecuteItem(Event event) voidThe default implementation of thisIContributionItemmethod does nothing.voidThe default implementation of thisIContributionItemmethod does nothing.protected IEclipseContextgetContext(MUIElement part) Return a context for this part.protected IEclipseContextgetContextForParent(MUIElement element) Return a parent context for this part.protected ImagegetImage(String iconURI, LocalResourceManager resourceManager) protected Listenerprotected MenugetModel()protected ToolItemUpdaterprotected voidprotected abstract voidhandleWidgetDispose(Event event) protected voidhandleWidgetSelection(Event event) booleanThe default implementation of thisIContributionItemmethod returns the value recorded in an internal state variable, which istrueby default.protected voidThis method is intended to perform actions additionally to the common actions infill(Menu, int)protected voidThis method is intended to perform actions additionally to the common actions infill(ToolBar, int)voidvoidsetParent(IContributionManager parent) Sets the parent manager of this itemvoidupdate()The default implementation of thisIContributionItemmethod does nothing.voidTheContributionItemimplementation of this method declared onIContributionItemdoes nothing.protected voidprotected voidprotected abstract voidprotected abstract voidprotected voidMethods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, 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
-
contributionFactory
-
widget
-
localResourceManager
-
-
Constructor Details
-
AbstractContributionItem
public AbstractContributionItem() -
AbstractContributionItem
-
-
Method Details
-
update
public void update()Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
updatein interfaceIContributionItem- Overrides:
updatein classContributionItem
-
update
Description copied from class:ContributionItemTheContributionItemimplementation of this method declared onIContributionItemdoes nothing. Subclasses should override to update their state.- Specified by:
updatein interfaceIContributionItem- Overrides:
updatein classContributionItem- Parameters:
id- the id of the changed property
-
isVisible
public boolean isVisible()Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod returns the value recorded in an internal state variable, which istrueby default.setVisibleshould be used to change this setting.- Specified by:
isVisiblein interfaceIContributionItem- Overrides:
isVisiblein classContributionItem- Returns:
trueif this item is visible, andfalseotherwise
-
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:IContributionItemSets the parent manager of this item- Specified by:
setParentin interfaceIContributionItem- Overrides:
setParentin classContributionItem- Parameters:
parent- the parent contribution manager
-
fill
Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
fillin interfaceIContributionItem- Overrides:
fillin classContributionItem- Parameters:
menu- the parent menuindex- the index where the controls are inserted, or-1to 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:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
fillin interfaceIContributionItem- Overrides:
fillin classContributionItem- Parameters:
parent- the parent tool barindex- the index where the controls are inserted, or-1to 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()
-