Package com.iizigo.handler
Class CommonHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
com.iizigo.handler.CommonHandler
- Direct Known Subclasses:
- Copy,- Cut,- Delete,- Link,- Move,- Open,- Paste,- PasteAfter,- PasteBefore,- PasteLink,- Rename
The common handler check for valid handled state and enabled state for the common action handlers.
- Author:
- Christopher Mindus
- Field SummaryFields
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- protected abstract voidPerforms the operation.- final Object- execute- (ExecutionEvent event) Performs the operation.- protected IStructuredSelectionGets the current selection.- protected Shell- getShell()Gets the shell.- static IUndoContext- getUndoContext- (IWorkbenchPart part) Gets the undo context out of a part.- protected IPropUndoRedoGets the IPropUndoRedo for an event.- protected RunnableGets the asynchronous update states runnable.- booleanWhether this handler is capable of handling delegated responsibilities at this time.- protected abstract voidSets the enabled state for the selection.- 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.- Methods inherited from class org.eclipse.core.commands.AbstractHandler- addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, removeHandlerListener, setBaseEnabled- Methods inherited from class org.eclipse.core.commands.common.EventManager- addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
- Field Details- selectionEnablerThe current selection enabler.
 
- Constructor Details- CommonHandlerpublic CommonHandler()
 
- Method Details- setEnabledCalled by the framework to allow the handler to update its enabled state by extracting the same information available at execution time.- Specified by:
- setEnabledin interface- IHandler2
- Overrides:
- setEnabledin class- AbstractHandler
- Parameters:
- evaluationContext- The application context. May be- null.
 
- isHandledpublic boolean isHandled()Whether this handler is capable of handling delegated responsibilities at this time. Subclasses may override this method.- Specified by:
- isHandledin interface- IHandler
- Overrides:
- isHandledin class- AbstractHandler
- Returns:
- true
 
- getCurrentSelectionGets the current selection.
- setEnabledSets the enabled state for the selection.
- executePerforms the operation.
- doExecuteprotected abstract void doExecute()Performs the operation.
- getUndoRedoGets the IPropUndoRedo for an event.
- getShellGets the shell.
- getUndoContextGets the undo context out of a part.
- getUpdateStatesRunnableGets the asynchronous update states runnable.