Class SelectionEnabler

java.lang.Object
com.iizigo.handler.SelectionEnabler

public class SelectionEnabler extends Object
The enabler class processes selection changes from handlers, viewers, etc, and sets the state of the commands accordingly.
Author:
Christopher Mindus
  • Field Details Link icon

    • isHandled Link icon

      public boolean isHandled
      The current states.
    • canCut Link icon

      public boolean canCut
      The current states.
    • canCopy Link icon

      public boolean canCopy
      The current states.
    • canPaste Link icon

      public boolean canPaste
      The current states.
    • canPasteBefore Link icon

      public boolean canPasteBefore
      The current states.
    • canPasteAfter Link icon

      public boolean canPasteAfter
      The current states.
    • canDelete Link icon

      public boolean canDelete
      The current states.
    • canRename Link icon

      public boolean canRename
      The current states.
    • canOpen Link icon

      public boolean canOpen
      The current states.
    • canMove Link icon

      public boolean canMove
      The current states.
    • isNonModuleProject Link icon

      public boolean isNonModuleProject
      The current states.
    • containsModuleRoot Link icon

      public boolean containsModuleRoot
      The current states.
    • containsModuleFolder Link icon

      public boolean containsModuleFolder
      The current states.
    • targets Link icon

      public ArrayList<DesignerProp> targets
      The currently selected properties as a DesignerProp list, never null.
    • props Link icon

      public GProp<?>[] props
      The currently selected properties as a property array, never null.
    • target Link icon

      public DesignerProp target
      The single designer property target, null when multiple are defined.
  • Constructor Details Link icon

    • SelectionEnabler Link icon

      public SelectionEnabler()
      Creates an instance with all disabled.
    • SelectionEnabler Link icon

      public SelectionEnabler(IWorkbenchPart part, IStructuredSelection selection)
      Creates an instance for a selection synthesizing all other instanced, used for the Common Navigator and the Common Actions.
    • SelectionEnabler Link icon

      public SelectionEnabler(Shell shell, IWorkbenchPart part, ISelectionEnablerHandler selectionEnablerHandler, IPropUndoRedo undoRedo, IUndoContext undoContext, IStructuredSelection selection)
      Constructor.
      Parameters:
      shell - The shell, null for none present.
      part - The workbench part, null if none is present.
      selectionEnablerHandler - The selection enabler handler, null not to use the handler.
      undoRedo - The undo/redo instance, may be null.
      undoContext - The undo context, null for workspace common undo context.
      selection - The selection.
  • Method Details Link icon

    • get Link icon

      public static SelectionEnabler get(Object evaluationContext)
      Gets the SelectionEnabler instance from an evaluation context. An attempt to use a cached context is done. If not possible, get a new one.
    • getSelection Link icon

      public IStructuredSelection getSelection()
      Gets the selection.
      Returns:
      The selection or null for failure.
    • update Link icon

      public void update(IStructuredSelection selection)
      Updates the selection.
    • setUndoContext Link icon

      public void setUndoContext(IUndoContext undoContext)
      Sets the undo context.
    • getUndoContext Link icon

      public IUndoContext getUndoContext()
      Gets the undo context.
    • getWorkbenchPart Link icon

      public IWorkbenchPart getWorkbenchPart()
      Gets the workbench part.
    • invalidate Link icon

      public void invalidate()
      Invalidates this selection enabler, e.g. when clipboard has been changed, or selection, and the requirement to call update is needed.