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 SummaryFieldsModifier and TypeFieldDescription- static final intFlag for creation of Standard Edit actions Cut, Copy, Paste.- static final intFlag for creation of Standard Edit action Delete.- static final intFlag for creation of Rename.- static final intFlag for creation of Select All.- static final intFlag for creation of Standard Edit actions Cut, Copy, Paste, Delete.- static final intFlag 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 SummaryConstructorsConstructorDescription- CommonActions- (IWorkbenchPart part, Composite composite, IPropUndoRedo undoRedo, IUndoContext undoContext, ISelectionProvider selectionProvider, SelectionEnabler selectionEnabler, Runnable updateStatesRunnable, int flags) Constructor for a part.
- Method SummaryModifier and TypeMethodDescription- void- dispose()Disposes of the actions.- get- (int index) Gets the action of index.Gets the selection enabler instance.- void- run()Callback from undo/redo.- voidNotifies that the selection has changed.- voidUpdates the states, call only at initialize of part, once everything is set-up.
- Field Details- CREATE_UNDO_REDOpublic static final int CREATE_UNDO_REDOFlag for creation of Undo/Redo.- See Also:
 
- CREATE_EDIT_CUT_COPY_PASTEpublic static final int CREATE_EDIT_CUT_COPY_PASTEFlag for creation of Standard Edit actions Cut, Copy, Paste.- See Also:
 
- CREATE_EDIT_DELETEpublic static final int CREATE_EDIT_DELETEFlag for creation of Standard Edit action Delete.- See Also:
 
- CREATE_STANDARD_EDITpublic static final int CREATE_STANDARD_EDITFlag for creation of Standard Edit actions Cut, Copy, Paste, Delete.- See Also:
 
- CREATE_SELECT_ALLpublic static final int CREATE_SELECT_ALLFlag for creation of Select All.- See Also:
 
- CREATE_RENAMEpublic static final int CREATE_RENAMEFlag for creation of Rename.- See Also:
 
- INDEX_UNDOpublic static final int INDEX_UNDO- See Also:
 
- INDEX_REDOpublic static final int INDEX_REDO- See Also:
 
- INDEX_CUTpublic static final int INDEX_CUT- See Also:
 
- INDEX_COPYpublic static final int INDEX_COPY- See Also:
 
- INDEX_PASTEpublic static final int INDEX_PASTE- See Also:
 
- INDEX_DELETEpublic static final int INDEX_DELETE- See Also:
 
- INDEX_SELECT_ALLpublic static final int INDEX_SELECT_ALL- See Also:
 
- INDEX_RENAMEpublic static final int INDEX_RENAME- See Also:
 
 
- Constructor Details- CommonActionspublic 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- disposepublic void dispose()Disposes of the actions.
- getSelectionEnablerGets the selection enabler instance.
- selectionChangedNotifies that the selection has changed.- Specified by:
- selectionChangedin interface- ISelectionChangedListener
- Parameters:
- event- Event object describing the change.
 
- updateStatespublic 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.
- getGets the action of index.- Returns:
- null If not created.
 
- runpublic void run()Callback from undo/redo.