Class CommonActions

java.lang.Object
com.iizigo.handler.CommonActions
All Implemented Interfaces:
Runnable, org.eclipse.jface.viewers.ISelectionChangedListener

public class CommonActions extends Object implements org.eclipse.jface.viewers.ISelectionChangedListener, Runnable
The Common Actions are Undo, Redo, Cut, Copy, Paste, Delete, Select All, Rename. This class is instantiated for parts requiring these actions in form of "global action bars" implementation.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • CommonActions

      public CommonActions(org.eclipse.ui.IWorkbenchPart part, org.eclipse.swt.widgets.Composite composite, IPropUndoRedo undoRedo, org.eclipse.core.commands.operations.IUndoContext undoContext, org.eclipse.jface.viewers.ISelectionProvider selectionProvider, SelectionEnabler selectionEnabler, Runnable updateStatesRunnable, int flags)
      Constructor for a part. The part must be either a IViewPart or an IEditorPart, and it must implement a working selection provider.
      Parameters:
      part - The workbench part, can be null if no part is used.
      composite - The composite.
      undoRedo - The undo/redo instance.
      undoContext - The undo context.
      selectionProvider - The selection provider.
      selectionEnabler - A created SelectionEnabler, if null one will be created.
      updateStatesRunnable - Callback to update states, null for none.
      flags - Creation flags.
  • Method Details

    • dispose

      public void dispose()
      Disposes of the actions.
    • getSelectionEnabler

      public SelectionEnabler getSelectionEnabler()
      Gets the selection enabler instance.
    • selectionChanged

      public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
      Notifies that the selection has changed.
      Specified by:
      selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListener
      Parameters:
      event - Event object describing the change.
    • updateStates

      public void updateStates()
      Updates the states, call only at initialize of part, once everything is set-up. It is not required afterwards, the state is checked by itself using listeners.
    • get

      public org.eclipse.jface.action.IAction get(int index)
      Gets the action of index.
      Returns:
      null If not created.
    • run

      public void run()
      Callback from undo/redo.
      Specified by:
      run in interface Runnable