Class CommonHandler

All Implemented Interfaces:
IHandler, IHandler2
Direct Known Subclasses:
Copy, Cut, Delete, Link, Move, Open, Paste, PasteAfter, PasteBefore, PasteLink, Rename

public abstract class CommonHandler extends AbstractHandler
The common handler check for valid handled state and enabled state for the common action handlers.
Author:
Christopher Mindus
  • Field Details Link icon

    • selectionEnabler Link icon

      protected SelectionEnabler selectionEnabler
      The current selection enabler.
  • Constructor Details Link icon

    • CommonHandler Link icon

      public CommonHandler()
  • Method Details Link icon

    • setEnabled Link icon

      public final void setEnabled(Object evaluationContext)
      Called by the framework to allow the handler to update its enabled state by extracting the same information available at execution time.
      Specified by:
      setEnabled in interface IHandler2
      Overrides:
      setEnabled in class AbstractHandler
      Parameters:
      evaluationContext - The application context. May be null.
    • isHandled Link icon

      public boolean isHandled()
      Whether this handler is capable of handling delegated responsibilities at this time. Subclasses may override this method.
      Specified by:
      isHandled in interface IHandler
      Overrides:
      isHandled in class AbstractHandler
      Returns:
      true
    • getCurrentSelection Link icon

      protected IStructuredSelection getCurrentSelection()
      Gets the current selection.
    • setEnabled Link icon

      protected abstract void setEnabled(SelectionEnabler se)
      Sets the enabled state for the selection.
    • execute Link icon

      public final Object execute(ExecutionEvent event)
      Performs the operation.
    • doExecute Link icon

      protected abstract void doExecute()
      Performs the operation.
    • getUndoRedo Link icon

      protected IPropUndoRedo getUndoRedo()
      Gets the IPropUndoRedo for an event.
    • getShell Link icon

      protected Shell getShell()
      Gets the shell.
    • getUndoContext Link icon

      public static IUndoContext getUndoContext(IWorkbenchPart part)
      Gets the undo context out of a part.
    • getUpdateStatesRunnable Link icon

      protected Runnable getUpdateStatesRunnable()
      Gets the asynchronous update states runnable.