com.dlsc.flexgantt.command

## Class CommandStackEvent

- java.lang.Object
- - java.util.EventObject
  - - com.dlsc.flexgantt.command.CommandStackEvent

- All Implemented Interfaces:
    Serializable

      public class CommandStackEvent
      extends EventObject

  A command stack event is fired by the command stack when commands are being executed, undone or redone.
  Since:
    1.0
  Version:
    $Revision: 1.9 $
  Author:
    Dirk Lemmermann
  See Also:
    `ICommandStack`, `ICommandStackListener`, Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CommandStackEvent.ID` The command stack event ID allows command stack listeners to distinguish between different types of command stack events.

  - ### Field Summary

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommandStackEvent(ICommandStack stack, ICommand command, CommandStackEvent.ID id)` Creates a new command stack event.
    `CommandStackEvent(ICommandStack stack, ICommand command, CommandStackEvent.ID id, Exception ex)` Creates a new command stack event.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ICommand` | `getCommand()` Returns the command that was executed, undone or redone.
    `Exception` | `getCommandException()` Returns an exception, which occurred during the execution time of the command.
    `ICommandStack` | `getCommandStack()` Returns the command stack that was the source of the event.
    `CommandStackEvent.ID` | `getId()` Returns an id, which specifies the type of event (command executed, undone, redone).
    `String` | `toString()`

    - ### Methods inherited from class java.util.EventObject

      `getSource`

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

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

- - ### Constructor Detail

    - #### CommandStackEvent

          public CommandStackEvent(ICommandStack stack,
                                   ICommand command,
                                   CommandStackEvent.ID id,
                                   Exception ex)

      Creates a new command stack event.
      Parameters:
        `stack` - the command stack that triggered the event (the source)
        `command` - the command executed/undone/redone via the stack
        `id` - the type of event (executed, undone, redone)
        `ex` - an exception, which might have occurred during the execution time of the command
      Since:
        1.1.3

    - #### CommandStackEvent

          public CommandStackEvent(ICommandStack stack,
                                   ICommand command,
                                   CommandStackEvent.ID id)

      Creates a new command stack event.
      Parameters:
        `stack` - the command stack that triggered the event (the source)
        `command` - the command executed/undone/redone via the stack
        `id` - the type of event (executed, undone, redone)
      Since:
        1.0

  - ### Method Detail

    - #### getCommand

          public ICommand getCommand()

      Returns the command that was executed, undone or redone.
      Returns:
        the command
      Since:
        1.0

    - #### getCommandStack

          public ICommandStack getCommandStack()

      Returns the command stack that was the source of the event.
      Returns:
        the command stack
      Since:
        1.0

    - #### getId

          public CommandStackEvent.ID getId()

      Returns an id, which specifies the type of event (command executed, undone, redone).
      Returns:
        the event type
      Since:
        1.0

    - #### getCommandException

          public Exception getCommandException()

      Returns an exception, which occurred during the execution time of the command. Such an exception object will only be available if an actual exception has indeed occurred. Otherwise this method returns NULL.
      Returns:
        the exception, which occured during the command execution time
      Since:
        1.1.3

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `EventObject`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.