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 and Description
    `SafeHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and 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)

Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html