com.dlsc.flexgantt.command
Class CommandStackEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.dlsc.flexgantt.command.CommandStackEvent
All Implemented Interfaces:
java.io.Serializable

public class CommandStackEvent
extends java.util.EventObject

A command stack event is fired by the command stack when commands are being executed, undone or redone.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
ICommandStack, ICommandStackListener, Serialized Form

Nested Class Summary
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
CommandStackEvent(ICommandStack stack, ICommand command, CommandStackEvent.ID id)
          Creates a new command stack event.
 
Method Summary
 ICommand getCommand()
          Returns the command that was executed, undone or redone.
 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).
 java.lang.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)
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

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject