ilog.views.appframe.event
Class IlvSingleActionHandler

java.lang.Object
  extended by ilog.views.appframe.event.IlvSingleActionHandler
All Implemented Interfaces:
ActionHandler, ActionListener, EventListener
Direct Known Subclasses:
IlvCheckableActionHandler, IlvListActionHandler

public abstract class IlvSingleActionHandler
extends Object
implements ActionHandler

Defines action handlers that handle one action.


Constructor Summary
IlvSingleActionHandler(String command)
          Constructs a new IlvSingleActionHandler.
 
Method Summary
abstract  void actionPerformed(ActionEvent e)
          Invoked when an event for the action associated with this action handler occurs.
 Action getAction()
          Returns the action this object handles.
 String getCommand()
          Returns the command key of the action handled by this action handler.
 boolean isProcessingAction(String command)
          Determines whether this object handles the action with the specified command key.
 void setAction(Action action)
          Sets the action that this instance handles.
 void setCommand(String command)
          Sets the command key of the action handled by this object.
 boolean updateAction(Action action)
          Invoked by the application for updating the state of the specified action.
protected  boolean updateSingleAction(Action action)
          Invoked by the updateAction(javax.swing.Action) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvSingleActionHandler

public IlvSingleActionHandler(String command)
Constructs a new IlvSingleActionHandler.

Parameters:
command - The command key of the action that this object handles.
See Also:
setCommand(java.lang.String)
Method Detail

getCommand

public String getCommand()
Returns the command key of the action handled by this action handler.

See Also:
setCommand(java.lang.String)

setCommand

public void setCommand(String command)
Sets the command key of the action handled by this object.

Parameters:
command - The command key.
See Also:
getCommand()

isProcessingAction

public boolean isProcessingAction(String command)
Determines whether this object handles the action with the specified command key.

Specified by:
isProcessingAction in interface ActionHandler
Parameters:
command - The command key of the action.
Returns:
true if the specified command key is equal to the command key returned by getCommand(); false otherwise.

actionPerformed

public abstract void actionPerformed(ActionEvent e)
Invoked when an event for the action associated with this action handler occurs.

The command key returned by e.getActionCommand() is equal to the command key returned by getCommand().

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - The action event to process.

updateAction

public boolean updateAction(Action action)
Invoked by the application for updating the state of the specified action. This method should not be overridden. Instead, the method updateSingleAction(javax.swing.Action) should be overridden to update the state of the action handled by this object.

Specified by:
updateAction in interface ActionHandler
Parameters:
action - The action to update.
Returns:
true if the action handler has updated the state of the action; false otherwise.
See Also:
updateSingleAction(javax.swing.Action)

updateSingleAction

protected boolean updateSingleAction(Action action)
Invoked by the updateAction(javax.swing.Action) method. This method should be overridden instead of the updateAction(javax.swing.Action) method, since it is invoked only when the specified action corresponds to the action that this object handles.

Parameters:
action - The action to update the state of.
Returns:
true if the action has been updated or false to indicate that the default updating mechanism of the application should be used to disable the action if no action handler could be found for processing the state of the action.

getAction

public Action getAction()
Returns the action this object handles. This action is initialized after the updateAction(javax.swing.Action) has been invoked the first time, by using the command key returned by the getCommand() method.

Returns:
The action this instance handles or null if the action has not been initialized yet or if the command returned by the getCommand() method does not correspond to an existing action.
See Also:
setAction(javax.swing.Action), getCommand()

setAction

public void setAction(Action action)
Sets the action that this instance handles. This method overrides the command key previously set with the setCommand(java.lang.String) method.

Parameters:
action - The new action that this instance handles.
See Also:
getAction(), setCommand(java.lang.String)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.