Package org.eclipse.gef.commands
Class CommandStackEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.eclipse.gef.commands.CommandStackEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class CommandStackEvent extends java.util.EventObjectInstances of this class are sent whenever stack events occur. The type of event can be determined by callinggetDetail(), and comparing the return value to constants defined byCommandStack.Warning: this class is not intended to be subclassed.
- Since:
- 3.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommandStackEvent(CommandStack stack, Command c, int detail)Constructs a new event instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandgetCommand()Returnsnullor a Command if a command is relevant to the current event.intgetDetail()Returns an integer identifying the type of event which has occurred.booleanisPostChangeEvent()Returnstrueif this event is fired after the stack having changed.booleanisPreChangeEvent()Returnstrueif this event is fired prior to the stack changing.
-
-
-
Constructor Detail
-
CommandStackEvent
public CommandStackEvent(CommandStack stack, Command c, int detail)
Constructs a new event instance. The stack specifies the source of the event. If a command is relevant to the event context, one should be specified. The detail indicates the type of event occurring.- Parameters:
stack- the command stackc- a command ornulldetail- an integer identifier- Since:
- 3.1
-
-
Method Detail
-
getCommand
public Command getCommand()
Returnsnullor a Command if a command is relevant to the current event.- Returns:
nullor a command- Since:
- 3.1
-
isPreChangeEvent
public final boolean isPreChangeEvent()
Returnstrueif this event is fired prior to the stack changing.- Returns:
trueif pre-change event- Since:
- 3.2
-
isPostChangeEvent
public final boolean isPostChangeEvent()
Returnstrueif this event is fired after the stack having changed.- Returns:
trueif post-change event- Since:
- 3.2
-
getDetail
public int getDetail()
Returns an integer identifying the type of event which has occurred.- Returns:
- the detail of the event
- Since:
- 3.1
-
-