org.eclipse.net4j.util.ui.handlers

## Class LongRunningHandler

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

- All Implemented Interfaces:
    IHandler, IHandler2
  Direct Known Subclasses:
    AbstractBaseHandler

      public abstract class LongRunningHandler
      extends SafeHandler

  Since:
    3.4
  Author:
    Eike Stepper, Christian W. Damus (CEA LIST)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LongRunningHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `cancel()`
    `protected void` | `checkCancelation(IProgressMonitor monitor)`
    `protected void` | `doExecute(ExecutionEvent event, IProgressMonitor progressMonitor)` Executes the long-running handler in a background job.
    `protected void` | `doExecute(IProgressMonitor progressMonitor)`
    `protected java.lang.String` | `getBundleID()`
    `protected int` | `getTotalWork()` Deprecated. Not supported anymore.
    `protected void` | `preRun()`
    `protected void` | `preRun(ExecutionEvent event)`
    `protected java.lang.Object` | `safeExecute(ExecutionEvent event)`
    `protected void` | `setTotalWork(int totalWork)` Deprecated. Not supported anymore.

    - ### Methods inherited from class org.eclipse.net4j.util.ui.handlers.SafeHandler

      `execute, extractEventDetails, getCommand, getSelection, getText, setEnabled, updateSelection`

    - ### 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

    - #### LongRunningHandler

          public LongRunningHandler()

  - ### Method Detail

    - #### getTotalWork

          @Deprecated
          protected final int getTotalWork()

      Deprecated. Not supported anymore.

    - #### setTotalWork

          @Deprecated
          protected final void setTotalWork(int totalWork)

      Deprecated. Not supported anymore.

    - #### cancel

          protected final void cancel()

    - #### safeExecute

          protected final java.lang.Object safeExecute(ExecutionEvent event)
                                                throws java.lang.Exception

      Specified by:
        `safeExecute` in class `SafeHandler`
      Throws:
        `java.lang.Exception`

    - #### preRun

          protected void preRun(ExecutionEvent event)
                         throws java.lang.Exception

      Throws:
        `java.lang.Exception`
      Since:
        3.5

    - #### preRun

          protected void preRun()
                         throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getBundleID

          protected java.lang.String getBundleID()

    - #### doExecute

          protected void doExecute(ExecutionEvent event,
                                   IProgressMonitor progressMonitor)
                            throws java.lang.Exception

      Executes the long-running handler in a background job. Note that the original `ExecutionEvent` is not available because it is only valid during the execution of the handler call-back on the UI thread. Any details required from it must be extracted before the job is scheduled.
      Throws:
        `java.lang.Exception`
      Since:
        3.5

    - #### doExecute

          protected void doExecute(IProgressMonitor progressMonitor)
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### checkCancelation

          protected final void checkCancelation(IProgressMonitor monitor)

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