de.esprit.appsuite.task

## Class TaskEvent

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.TransferableObject
    - - de.esprit.common.gui.event.GenericEvent
      - - de.esprit.appsuite.task.TaskEvent

- All Implemented Interfaces:
    DeepCloneable, Dumpable, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    BatchTaskEvent, RemoteTaskEvent

      public class TaskEvent
      extends GenericEvent

  This event is used for notifying the state changes and the progress of an asynchronously running `AsyncTask` instance.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `TaskEvent.Listener`
    `static interface` | `TaskEvent.Source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskEvent(RunStateFlag stateFlag)`
    `TaskEvent(RunStateFlag stateFlag, java.lang.Object result)`
    `TaskEvent(RunStateFlag stateFlag, java.lang.Object result, int step, int maxSteps, java.lang.String message)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getChildCount()`
    `int` | `getChildNestingDepth()`
    `TaskId` | `getCurrentChild()`
    `java.lang.Exception` | `getError()`
    `int` | `getMaxChildTasks()`
    `int` | `getMaxProgressSteps()` Returns the estimated number of steps - used for displaying length of progress bar
    `java.lang.String` | `getProgressMessage()` Returns the current progress state message of the running action
    `int` | `getProgressPercentage()`
    `int` | `getProgressStep()` Returns the current step (of progressCount) of the running action
    `java.lang.Object` | `getResult()` Returns the result object if the run-state is SUCCEEDED or PROGRESS.
    `RunState` | `getRunState()`
    `RunStateFlag` | `getRunStateFlag()`
    `TaskId` | `getTaskId()`
    `java.lang.String` | `getTaskName()`
    `boolean` | `isCancellable()`
    `boolean` | `isCancelled()`
    `boolean` | `isChildEvent()`
    `boolean` | `isChildFinished()`
    `boolean` | `isChildStarted()`
    `boolean` | `isChildSucceeded()`
    `boolean` | `isFailed()`
    `boolean` | `isFinished()`
    `boolean` | `isProgress()`
    `boolean` | `isRunning()`
    `boolean` | `isStarted()`
    `boolean` | `isSucceeded()`
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.
    `boolean` | `wasCancelled()`
    `boolean` | `wasFailed()`
    `boolean` | `wasSucceeded()`

    - ### Methods inherited from class de.esprit.common.util.TransferableObject

      `clone, deepClone`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

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

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

- - ### Constructor Detail

    - #### TaskEvent

          public TaskEvent(RunStateFlag stateFlag)

    - #### TaskEvent

          public TaskEvent(RunStateFlag stateFlag,
                   java.lang.Object result)

    - #### TaskEvent

          public TaskEvent(RunStateFlag stateFlag,
                   java.lang.Object result,
                   int step,
                   int maxSteps,
                   java.lang.String message)

  - ### Method Detail

    - #### getTaskName

          public java.lang.String getTaskName()

    - #### getTaskId

          public TaskId getTaskId()

    - #### getRunStateFlag

          public RunStateFlag getRunStateFlag()

    - #### isStarted

          public boolean isStarted()

    - #### isProgress

          public boolean isProgress()

    - #### isSucceeded

          public boolean isSucceeded()

    - #### isCancelled

          public boolean isCancelled()

    - #### isFailed

          public boolean isFailed()

    - #### isFinished

          public boolean isFinished()

    - #### isRunning

          public boolean isRunning()

    - #### getRunState

          public RunState getRunState()

    - #### getProgressStep

          public int getProgressStep()

      Returns the current step (of progressCount) of the running action

    - #### getProgressPercentage

          public int getProgressPercentage()

    - #### getError

          public java.lang.Exception getError()

    - #### getMaxProgressSteps

          public int getMaxProgressSteps()

      Returns the estimated number of steps - used for displaying length of progress bar

    - #### getProgressMessage

          public java.lang.String getProgressMessage()

      Returns the current progress state message of the running action

    - #### isChildEvent

          public boolean isChildEvent()

    - #### isChildStarted

          public boolean isChildStarted()

    - #### isChildFinished

          public boolean isChildFinished()

    - #### isChildSucceeded

          public boolean isChildSucceeded()

    - #### getMaxChildTasks

          public int getMaxChildTasks()

    - #### getCurrentChild

          public TaskId getCurrentChild()

    - #### getChildNestingDepth

          public int getChildNestingDepth()

    - #### getChildCount

          public int getChildCount()

    - #### wasSucceeded

          public boolean wasSucceeded()

    - #### wasCancelled

          public boolean wasCancelled()

    - #### wasFailed

          public boolean wasFailed()

    - #### getResult

          public java.lang.Object getResult()

      Returns the result object if the run-state is SUCCEEDED or PROGRESS. May be null if the task did not produce any result.

    - #### isCancellable

          public boolean isCancellable()

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.