Package org.eclipse.net4j.util.ui.handlers

## Class SafeHandler

- java.lang.Object
- - org.eclipse.core.commands.common.EventManager
  - - org.eclipse.core.commands.AbstractHandler
    - - org.eclipse.net4j.util.ui.handlers.SafeHandler

- All Implemented Interfaces:
    `IHandler`, `IHandler2`
  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.Object` | `execute​(ExecutionEvent event)` |
    `protected void` | `extractEventDetails​(ExecutionEvent event)` | Extracts details from the `event` that we may need later, for example on a background thread when the original execution context is no longer valid.
    `Command` | `getCommand()` |
    `ISelection` | `getSelection()` |
    `protected java.lang.String` | `getText()` |
    `protected abstract java.lang.Object` | `safeExecute​(ExecutionEvent event)` |
    `void` | `setEnabled​(java.lang.Object evaluationContext)` |
    `protected boolean` | `updateSelection​(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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SafeHandler

          public SafeHandler()

  - ### 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:
        `setEnabled` in interface `IHandler2`
      Overrides:
        `setEnabled` in class `AbstractHandler`

    - #### extractEventDetails

          protected void extractEventDetails​(ExecutionEvent event)

      Extracts details from the `event` that 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)