it.amattioli.applicate.commands
Interface Command

Show UML class diagram
All Superinterfaces:
it.amattioli.dominate.util.PropertyChangeEmitter
All Known Subinterfaces:
DynaCommand, ExecutorAwareCommand, UndoableCommand
All Known Implementing Classes:
AbstractCommand, CommandDecorator, HibernateEntityEditor, MultipleCommand, NullCommand, RepositoryEditor, TreeEditorCommand, UndoAvailableCommand, UndoCommand

public interface Command
extends it.amattioli.dominate.util.PropertyChangeEmitter

A command is a way to encapsulate an operation in an object. You can create a command object, set the operation parameters passing them to the constructor or using properties accessor methods, and then execute the operation calling doCommand(). Every time a command is executed a CommandEvent should be fired. Other objects can listen to these events adding a CommandListener to this command using addCommandListener(CommandListener) or addCommandListener(CommandListener, CommandResult...).

Author:
andrea

Method Summary
 void addCommandListener(CommandListener listener)
          Add a listener for this command events.
 void addCommandListener(CommandListener listener, CommandResult... results)
          Add a listener for this command events.
 void cancelCommand()
           
 void doCommand()
          Execute this command.
 
Methods inherited from interface it.amattioli.dominate.util.PropertyChangeEmitter
addPropertyChangeListener, removePropertyChangeListener
 

Method Detail

doCommand

void doCommand()
               throws ApplicationException
Execute this command.

Throws:
ApplicationException

cancelCommand

void cancelCommand()

addCommandListener

void addCommandListener(CommandListener listener)
Add a listener for this command events. Every time this command fires a CommandEvent the CommandListener.commandDone(CommandEvent) method will be called on all the added listeners.

Parameters:
listener - the listener to be added

addCommandListener

void addCommandListener(CommandListener listener,
                        CommandResult... results)
Add a listener for this command events. Every time this command fires a CommandEvent the CommandListener.commandDone(CommandEvent) method will be called on all the added listeners with result equals to one of the specified results.

Parameters:
listener - the listener to be added


Copyright © 2011. All Rights Reserved.