Package com.iizigo.handler
Class CommonActions
java.lang.Object
com.iizigo.handler.CommonActions
- All Implemented Interfaces:
Runnable
,ISelectionChangedListener
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 Summary
Modifier and TypeFieldDescriptionstatic final int
Flag for creation of Standard Edit actions Cut, Copy, Paste.static final int
Flag for creation of Standard Edit action Delete.static final int
Flag for creation of Rename.static final int
Flag for creation of Select All.static final int
Flag for creation of Standard Edit actions Cut, Copy, Paste, Delete.static final int
Flag for creation of Undo/Redo.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Constructor Summary
ConstructorDescriptionCommonActions
(IWorkbenchPart part, Composite composite, IPropUndoRedo undoRedo, IUndoContext undoContext, ISelectionProvider selectionProvider, SelectionEnabler selectionEnabler, Runnable updateStatesRunnable, int flags) Constructor for a part.Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the actions.get
(int index) Gets the action of index.Gets the selection enabler instance.void
run()
Callback from undo/redo.void
Notifies that the selection has changed.void
Updates the states, call only at initialize of part, once everything is set-up.
Field Details
CREATE_UNDO_REDO
public static final int CREATE_UNDO_REDOFlag for creation of Undo/Redo.- See Also:
CREATE_EDIT_CUT_COPY_PASTE
public static final int CREATE_EDIT_CUT_COPY_PASTEFlag for creation of Standard Edit actions Cut, Copy, Paste.- See Also:
CREATE_EDIT_DELETE
public static final int CREATE_EDIT_DELETEFlag for creation of Standard Edit action Delete.- See Also:
CREATE_STANDARD_EDIT
public static final int CREATE_STANDARD_EDITFlag for creation of Standard Edit actions Cut, Copy, Paste, Delete.- See Also:
CREATE_SELECT_ALL
public static final int CREATE_SELECT_ALLFlag for creation of Select All.- See Also:
CREATE_RENAME
public static final int CREATE_RENAMEFlag for creation of Rename.- See Also:
INDEX_UNDO
public static final int INDEX_UNDO- See Also:
INDEX_REDO
public static final int INDEX_REDO- See Also:
INDEX_CUT
public static final int INDEX_CUT- See Also:
INDEX_COPY
public static final int INDEX_COPY- See Also:
INDEX_PASTE
public static final int INDEX_PASTE- See Also:
INDEX_DELETE
public static final int INDEX_DELETE- See Also:
INDEX_SELECT_ALL
public static final int INDEX_SELECT_ALL- See Also:
INDEX_RENAME
public static final int INDEX_RENAME- See Also:
Constructor Details
CommonActions
public CommonActions(IWorkbenchPart part, Composite composite, IPropUndoRedo undoRedo, IUndoContext undoContext, 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
Gets the selection enabler instance.selectionChanged
Notifies that the selection has changed.- Specified by:
selectionChanged
in interfaceISelectionChangedListener
- 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
Gets the action of index.- Returns:
- null If not created.
run
public void run()Callback from undo/redo.