Class SafeHandler
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.core.commands.AbstractHandler
-
- org.eclipse.net4j.util.ui.handlers.SafeHandler
-
- Direct Known Subclasses:
LongRunningHandler
public abstract class SafeHandler extends AbstractHandler
- Since:
- 3.4
- Author:
- Eike Stepper, Christian W. Damus (CEA LIST)
-
-
Constructor Summary
Constructors Constructor Description SafeHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Objectexecute(ExecutionEvent event)protected voidextractEventDetails(ExecutionEvent event)Extracts details from theeventthat we may need later, for example on a background thread when the original execution context is no longer valid.CommandgetCommand()ISelectiongetSelection()protected java.lang.StringgetText()protected abstract java.lang.ObjectsafeExecute(ExecutionEvent event)voidsetEnabled(java.lang.Object evaluationContext)protected booleanupdateSelection(ISelection selection)-
Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Method Detail
-
getCommand
public Command getCommand()
-
getSelection
public ISelection getSelection()
-
execute
public java.lang.Object execute(ExecutionEvent event) throws ExecutionException
- Throws:
ExecutionException
-
setEnabled
public void setEnabled(java.lang.Object evaluationContext)
- Specified by:
setEnabledin interfaceIHandler2- Overrides:
setEnabledin classAbstractHandler
-
extractEventDetails
protected void extractEventDetails(ExecutionEvent event)
Extracts details from theeventthat we may need later, for example on a background thread when the original execution context is no longer valid.
-
safeExecute
protected abstract java.lang.Object safeExecute(ExecutionEvent event) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getText
protected java.lang.String getText()
-
updateSelection
protected boolean updateSelection(ISelection selection)
-
-