Class ObjectPluginAction

All Implemented Interfaces:
EventListener, IAction, ISelectionChangedListener, INullSelectionListener, IPartListener2, IPluginContribution, ISelectionListener

public class ObjectPluginAction extends PluginAction implements IPartListener2
An object action extension in a popup menu.

For backward compatibility, the delegate object can implement either IActionDelegate or IObjectActionDelegate.

  • Field Details

    • ATT_OVERRIDE_ACTION_ID

      public static final String ATT_OVERRIDE_ACTION_ID
      The configuration element attribute for the identifier of the action which this action is intended to override (i.e., replace).
      See Also:
  • Constructor Details

    • ObjectPluginAction

      public ObjectPluginAction(IConfigurationElement actionElement, String id, int style)
      Constructs a new ObjectPluginAction.
      Parameters:
      actionElement - The configuration element used to construct this action; must not be null.
      id - The identifier for this action; must not be null.
      style - The style bits
  • Method Details

    • partActivated

      public void partActivated(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part has been activated.
      Specified by:
      partActivated in interface IPartListener2
      Parameters:
      partRef - the part that was activated
      See Also:
    • partBroughtToTop

      public void partBroughtToTop(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part has been brought to the top.

      These events occur when an editor is brought to the top in the editor area, or when a view is brought to the top in a page book with multiple views. They are normally only sent when a part is brought to the top programmatically (via IPerspective.bringToTop). When a part is activated by the user clicking on it, only partActivated is sent.

      Specified by:
      partBroughtToTop in interface IPartListener2
      Parameters:
      partRef - the part that was surfaced
      See Also:
    • partClosed

      public void partClosed(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part has been closed.

      Note that if other perspectives in the same page share the view, this notification is not sent. It is only sent when the view is being removed from the page entirely (it is being disposed).

      Specified by:
      partClosed in interface IPartListener2
      Parameters:
      partRef - the part that was closed
      See Also:
    • partDeactivated

      public void partDeactivated(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part has been deactivated.
      Specified by:
      partDeactivated in interface IPartListener2
      Parameters:
      partRef - the part that was deactivated
      See Also:
    • partHidden

      public void partHidden(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part is hidden or obscured by another part.
      Specified by:
      partHidden in interface IPartListener2
      Parameters:
      partRef - the part that is hidden or obscured by another part
    • partInputChanged

      public void partInputChanged(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part's input was changed.
      Specified by:
      partInputChanged in interface IPartListener2
      Parameters:
      partRef - the part whose input was changed
    • partOpened

      public void partOpened(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part has been opened.

      Note that if other perspectives in the same page share the view, this notification is not sent. It is only sent when the view is being newly opened in the page (it is being created).

      Specified by:
      partOpened in interface IPartListener2
      Parameters:
      partRef - the part that was opened
      See Also:
    • partVisible

      public void partVisible(IWorkbenchPartReference partRef)
      Description copied from interface: IPartListener2
      Notifies this listener that the given part is visible.
      Specified by:
      partVisible in interface IPartListener2
      Parameters:
      partRef - the part that is visible
    • initDelegate

      protected void initDelegate()
      Description copied from class: PluginAction
      Initialize the action delegate by calling its lifecycle method. Subclasses may override but must call this implementation first.
      Overrides:
      initDelegate in class PluginAction
    • setActivePart

      public void setActivePart(IWorkbenchPart targetPart)
      Sets the active part for the delegate.

      This method will be called every time the action appears in a popup menu. The targetPart may change with each invocation.

      Parameters:
      targetPart - the new part target
    • getOverrideActionId

      public String getOverrideActionId()
      Returns the action identifier this action overrides.
      Overrides:
      getOverrideActionId in class PluginAction
      Returns:
      the action identifier to override or null
    • dispose

      public void dispose()
      Description copied from class: PluginAction
      Disposes this plugin action.
      Overrides:
      dispose in class PluginAction