org.bs.mdi
Interface CommandTrigger

All Known Implementing Classes:
SwingCommandTrigger

public interface CommandTrigger

Interface for GUI elements which trigger commands.


Method Summary
 void commandExecuted(CommandTrigger trigger)
          Informs this trigger that the associated command has been executed.
 void commandUpdated()
          Informs this trigger that the associated command has changed.
 void execute()
          Shortcut for getCommand().execute().
 Command getCommand()
          Gets the command which is associated with this command trigger.
 void setEnabled(boolean enabled)
          Enables or disables this command trigger.
 

Method Detail

getCommand

public Command getCommand()
Gets the command which is associated with this command trigger.

Returns:
the associated command

setEnabled

public void setEnabled(boolean enabled)
Enables or disables this command trigger.

Parameters:
enabled - true if this trigger should be enabled, false otherwise

execute

public void execute()
Shortcut for getCommand().execute().


commandExecuted

public void commandExecuted(CommandTrigger trigger)
Informs this trigger that the associated command has been executed. Note that the command may have been fired by either this trigger or another trigger which has been associated with the command.

Parameters:
trigger - the trigger which made the command execute

commandUpdated

public void commandUpdated()
Informs this trigger that the associated command has changed. This typically includes name or description changes. The trigger should update itself to reflect that changes.