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

public abstract class AbstractContributionItem extends ContributionItem
Common super class for HandledContributionItem and DirectContributionItem
  • Field Details

  • Constructor Details

    • AbstractContributionItem

      public AbstractContributionItem()
    • AbstractContributionItem

      public AbstractContributionItem(String id)
  • Method Details

    • update

      public void update()
      Description copied from class: ContributionItem
      The default implementation of this IContributionItem method does nothing. Subclasses may override.
      Specified by:
      update in interface IContributionItem
      Overrides:
      update in class ContributionItem
    • update

      public void update(String id)
      Description copied from class: ContributionItem
      The ContributionItem implementation of this method declared on IContributionItem does nothing. Subclasses should override to update their state.
      Specified by:
      update in interface IContributionItem
      Overrides:
      update in class ContributionItem
      Parameters:
      id - the id of the changed property
    • updateMenuItem

      protected abstract void updateMenuItem()
    • updateToolItem

      protected abstract void updateToolItem()
    • getImage

      protected Image getImage(String iconURI, LocalResourceManager resourceManager)
    • updateIcons

      protected void updateIcons()
    • disposeOldImages

      protected void disposeOldImages()
    • setModel

      public void setModel(MItem item)
      Parameters:
      item - the model item
    • getModel

      public MItem getModel()
      Returns:
      the model
    • setParent

      public void setParent(IContributionManager parent)
      Description copied from interface: IContributionItem
      Sets the parent manager of this item
      Specified by:
      setParent in interface IContributionItem
      Overrides:
      setParent in class ContributionItem
      Parameters:
      parent - the parent contribution manager
    • fill

      public void fill(Menu menu, int index)
      Description copied from class: ContributionItem
      The default implementation of this IContributionItem method does nothing. Subclasses may override.
      Specified by:
      fill in interface IContributionItem
      Overrides:
      fill in class ContributionItem
      Parameters:
      menu - the parent menu
      index - 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 in fill(Menu, int)
    • fill

      public void fill(ToolBar parent, int index)
      Description copied from class: ContributionItem
      The default implementation of this IContributionItem method does nothing. Subclasses may override.
      Specified by:
      fill in interface IContributionItem
      Overrides:
      fill in class ContributionItem
      Parameters:
      parent - the parent tool bar
      index - 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 in fill(ToolBar, int)
    • getContextForParent

      protected IEclipseContext getContextForParent(MUIElement element)
      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

      protected IEclipseContext getContext(MUIElement part)
      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

      public Widget getWidget()
      Returns:
      the widgets of the contribution
    • getMenu

      protected Menu getMenu(MMenu mmenu, ToolItem toolItem)
    • handleWidgetSelection

      protected void handleWidgetSelection(Event event)
    • executeItem

      protected abstract void executeItem(Event event)
    • canExecuteItem

      protected abstract boolean canExecuteItem(Event event)
      Returns:
      if the item can be executed
    • getItemListener

      protected Listener getItemListener()
    • handleHelpRequest

      protected void handleHelpRequest()
    • handleWidgetDispose

      protected abstract void handleWidgetDispose(Event event)
    • updateVisible

      protected void updateVisible()
    • getUpdater

      protected ToolItemUpdater getUpdater()
    • updateItemEnablement

      protected void updateItemEnablement()