|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.CommandDispatcher
public class CommandDispatcher
CommandDispatcher is a class to execute a specified Command when an event is fired. It implements the ItemListener and the ActionListener interfaces to handle ItemEvents and ActionEvents. When an event is fired that the CommandDispatcher is registered as a listener on, it will call the execute(Object) method on its command property passing in the objectData as the parameter. This dispatcher can be used with Buttons, PopupMenus or any other component which fires an ItemEvent or ActionEvent to cause a Command to be executed.
Field Summary | |
---|---|
protected com.sas.util.Command |
command
|
protected java.lang.Object |
commandData
|
protected ErrorHandlerInterface |
errHandler
|
protected GenericErrorHandlerInterface |
genericErrHandler
|
Constructor Summary | |
---|---|
CommandDispatcher()
Default Constructor. |
|
CommandDispatcher(com.sas.util.Command cmd)
Constructor that sets the Command to execute. |
|
CommandDispatcher(com.sas.util.Command cmd,
java.lang.Object cmdData)
Constructor that sets the Command to execute and the data to send to that command in the execute() method. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
ActionListener method to handle ActionEvent. |
void |
executeCommand()
Execute the command associated with this dispatcher. |
com.sas.util.Command |
getCommand()
Get the command to be executed when an event is received. |
ErrorHandlerInterface |
getErrorHandler()
Get the error handler that is set on the command if it implements the SupportsErrorHandlerInterface. |
GenericErrorHandlerInterface |
getGenericErrorHandler()
Get the generic error handler that is set on the command if it implements the SupportsGenericErrorHandlerInterface. |
java.lang.Object |
getObjectData()
Get the object passed to the execute(Object) method when the Command is executed. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
ItemListener method to handle ItemEvents. |
void |
setCommand(com.sas.util.Command cmd)
Set the command to be executed when an event is received. |
void |
setErrorHandler(ErrorHandlerInterface errorHandler)
Set the error handler that is set on the command if it implements the SupportsErrorHandlerInterface. |
void |
setGenericErrorHandler(GenericErrorHandlerInterface genericErrorHandler)
Set the generic error handler that is set on the command if it implements the SupportsGenericErrorHandlerInterface. |
void |
setObjectData(java.lang.Object cmdData)
Set the object passed to the execute(Object) method when the Command is executed. |
Field Detail |
---|
protected com.sas.util.Command command
protected java.lang.Object commandData
protected ErrorHandlerInterface errHandler
protected GenericErrorHandlerInterface genericErrHandler
Constructor Detail |
---|
public CommandDispatcher()
public CommandDispatcher(com.sas.util.Command cmd)
public CommandDispatcher(com.sas.util.Command cmd, java.lang.Object cmdData)
Method Detail |
---|
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void executeCommand()
public java.lang.Object getObjectData()
getObjectData
in interface com.sas.lang.ObjectDataInterface
public void setObjectData(java.lang.Object cmdData)
setObjectData
in interface com.sas.lang.ObjectDataInterface
public com.sas.util.Command getCommand()
public void setCommand(com.sas.util.Command cmd)
public void setErrorHandler(ErrorHandlerInterface errorHandler)
setErrorHandler
in interface SupportsErrorHandlerInterface
errorHandler
- The error handler.public ErrorHandlerInterface getErrorHandler()
getErrorHandler
in interface SupportsErrorHandlerInterface
public void setGenericErrorHandler(GenericErrorHandlerInterface genericErrorHandler)
setGenericErrorHandler
in interface SupportsGenericErrorHandlerInterface
errorHandler
- The generic error handler.public GenericErrorHandlerInterface getGenericErrorHandler()
getGenericErrorHandler
in interface SupportsGenericErrorHandlerInterface
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |