edu.neu.ccs.gui
Class ListSelectionActionAdapter

java.lang.Object
  extended byedu.neu.ccs.gui.ListSelectionActionAdapter
All Implemented Interfaces:
Cloneable, EventListener, ListSelectionListener, Serializable

public class ListSelectionActionAdapter
extends Object
implements ListSelectionListener, Cloneable, Serializable

An adapter class for receiving list selection events, and performing action listeners in response to those events.

Since:
2.1
Version:
2.3.3
See Also:
Serialized Form

Field Summary
protected  ActionSequence selectionActions
          List of action listeners to be performed upon the notification of list selection events.
 
Constructor Summary
ListSelectionActionAdapter()
          Constructs a list selection action adapter.
ListSelectionActionAdapter(ListSelectionModel model)
          Constructs a list selection action adapter listening for list selection events generated by the given list selection model.
 
Method Summary
 void addListSelectionAction(ActionListener a)
          Adds an action listener to this adapter so that it will be performed when a list selection is made.
 ActionSequence getListSelectionActions()
          Returns the action sequence for list selection events.
 void removeListSelectionAction(ActionListener a)
          Removes the given action listener from this adapter so that it will be no longer be performed when a list selection is made.
 void setListSelectionActions(ActionSequence sequence)
          Sets the action sequence for list selection events to the provided action sequence.
 void valueChanged(ListSelectionEvent evt)
          Performs the stored action listener sequence when a list selection has been made.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectionActions

protected ActionSequence selectionActions
List of action listeners to be performed upon the notification of list selection events.

Constructor Detail

ListSelectionActionAdapter

public ListSelectionActionAdapter()
Constructs a list selection action adapter.


ListSelectionActionAdapter

public ListSelectionActionAdapter(ListSelectionModel model)
Constructs a list selection action adapter listening for list selection events generated by the given list selection model. If null, this adapter does not listen to a particular list selection model by default.

Parameters:
model - the list selection model to listen to
Method Detail

valueChanged

public final void valueChanged(ListSelectionEvent evt)
Performs the stored action listener sequence when a list selection has been made.

Specified by:
valueChanged in interface ListSelectionListener
Parameters:
evt - the list selection event to be handled

addListSelectionAction

public void addListSelectionAction(ActionListener a)
Adds an action listener to this adapter so that it will be performed when a list selection is made.

Parameters:
a - the action listener to be performed
See Also:
removeListSelectionAction(ActionListener), setListSelectionActions(ActionSequence), getListSelectionActions()

removeListSelectionAction

public void removeListSelectionAction(ActionListener a)
Removes the given action listener from this adapter so that it will be no longer be performed when a list selection is made.

Parameters:
a - the action listener to be removed
See Also:
addListSelectionAction(ActionListener), setListSelectionActions(ActionSequence), getListSelectionActions()

setListSelectionActions

public void setListSelectionActions(ActionSequence sequence)
Sets the action sequence for list selection events to the provided action sequence. If null, the action sequence for list selection events is cleared.

Parameters:
sequence - the desired action sequence
See Also:
getListSelectionActions(), addListSelectionAction(ActionListener), removeListSelectionAction(ActionListener)

getListSelectionActions

public ActionSequence getListSelectionActions()
Returns the action sequence for list selection events.

See Also:
setListSelectionActions(ActionSequence), addListSelectionAction(ActionListener), removeListSelectionAction(ActionListener)