Class TaskEvent

java.lang.Object
java.util.EventObject
javafx.event.Event
cl.obcom.desktopfx.core.TaskEvent
All Implemented Interfaces:
Serializable, Cloneable

public class TaskEvent extends Event
The root event class for all DesktopTask events.
See Also:
  • Field Details

    • ANY

      public static final EventType<TaskEvent> ANY
      Common supertype for all DesktopTask event types.
    • TASK_STATE_REQUEST

      public static final EventType<TaskEvent> TASK_STATE_REQUEST
      This event occurs when the state of the DesktopTask is required. The handler of this event must call the setTaskState method to return the required state object.
    • TASK_TERMINATING

      public static final EventType<TaskEvent> TASK_TERMINATING
      This event occurs just before a DesktopTask is terminated. If the event is not consumed by any installed event handler, the default handler for this event terminates the DesktopTask.
    • TASK_TERMINATED

      public static final EventType<TaskEvent> TASK_TERMINATED
      This event occurs just after a DesktopTask is terminated.
    • RELEASE_RESOURCES

      public static final EventType<TaskEvent> RELEASE_RESOURCES
      This event occurs when internal resources of a DesktopTask must be released.
  • Constructor Details

    • TaskEvent

      public TaskEvent(DesktopTask source, EventType<? extends TaskEvent> eventType)
      Construct a new TaskEvent with the specified event source and event type. The target of the event is set to NULL_SOURCE_TARGET.
      Parameters:
      source - the source of the event.
      eventType - the event type.
    • TaskEvent

      public TaskEvent(DesktopTask source, EventTarget target, EventType<? extends TaskEvent> eventType)
      Construct a new TaskEvent with the specified event source, target and type. If the source or target is set to null, it is replaced by the NULL_SOURCE_TARGET value.
      Parameters:
      source - the source of the event.
      target - the target of the event.
      eventType - the event type.
  • Method Details

    • getTask

      public final DesktopTask getTask()
      The DesktopTask on which this event occurred.
      Returns:
      the DesktopTask on which this event occurred.
    • getTaskState

      public final Object getTaskState()
      The state object of the Task of this event.
      Returns:
      the state object of the Task of this event.
    • setTaskState

      public final void setTaskState(Object value)
      Changes the state of the Task of this event.
      Parameters:
      value - the state of the Task of this event.