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 Summary
FieldsConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprotected abstract voidPerforms the operation.final Objectexecute(ExecutionEvent event) Performs the operation.protected IStructuredSelectionGets the current selection.protected ShellgetShell()Gets the shell.static IUndoContextgetUndoContext(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 voidsetEnabled(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, setBaseEnabledMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.commands.IHandler
getHandlerLabel
Field Details
selectionEnabler
The current selection enabler.
Constructor Details
CommonHandler
public CommonHandler()
Method Details
setEnabled
Called by the framework to allow the handler to update its enabled state by extracting the same information available at execution time.- Specified by:
setEnabledin interfaceIHandler2- Overrides:
setEnabledin classAbstractHandler- Parameters:
evaluationContext- The application context. May benull.
isHandled
public boolean isHandled()Whether this handler is capable of handling delegated responsibilities at this time. Subclasses may override this method.- Specified by:
isHandledin interfaceIHandler- Overrides:
isHandledin classAbstractHandler- Returns:
true
getCurrentSelection
Gets the current selection.setEnabled
Sets the enabled state for the selection.execute
Performs the operation.doExecute
protected abstract void doExecute()Performs the operation.getUndoRedo
Gets the IPropUndoRedo for an event.getShell
Gets the shell.getUndoContext
Gets the undo context out of a part.getUpdateStatesRunnable
Gets the asynchronous update states runnable.