com.taursys.swing
Class ListSelectionBinder

java.lang.Object
  extended bycom.taursys.swing.ListSelectionBinder
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ListSelectionListener

public class ListSelectionBinder
extends java.lang.Object
implements javax.swing.event.ListSelectionListener

ListSelectionBinder synchronizes the position between a ListSelectionModel and a ListValueHolder. It is typically used by Tables and Lists.

Version:
1.0
Author:
Marty Phelan

Constructor Summary
ListSelectionBinder()
          Constructs a new ListSelectionBinder
 
Method Summary
 javax.swing.ListSelectionModel getListSelectionModel()
          Get the ListSelectionModel to synchronize positions with.
 ListValueHolder getListValueHolder()
          Get the ListValueHolder to synchronize positions with.
 void setListSelectionModel(javax.swing.ListSelectionModel newListSelectionModel)
          Set the ListSelectionModel to synchronize positions with.
 void setListValueHolder(ListValueHolder newListValueHolder)
          Set the ListValueHolder to synchronize positions with.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Notification method to sync positions between ListValueHolder and ListSelectionModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSelectionBinder

public ListSelectionBinder()
Constructs a new ListSelectionBinder

Method Detail

getListValueHolder

public ListValueHolder getListValueHolder()
Get the ListValueHolder to synchronize positions with.

Returns:
the ListValueHolder to synchronize positions with.

setListValueHolder

public void setListValueHolder(ListValueHolder newListValueHolder)
Set the ListValueHolder to synchronize positions with. This method also registers this ListSelectionBinder as a ListSelectionListener with the given ListValueHolder.

Parameters:
newListValueHolder - the ListValueHolder to synchronize positions with.

setListSelectionModel

public void setListSelectionModel(javax.swing.ListSelectionModel newListSelectionModel)
Set the ListSelectionModel to synchronize positions with. This method also registers this ListSelectionBinder as a ListSelectionListener with the given ListSelectionModel.

Parameters:
newListSelectionModel - the ListSelectionModel to synchronize positions with.

getListSelectionModel

public javax.swing.ListSelectionModel getListSelectionModel()
Get the ListSelectionModel to synchronize positions with.

Returns:
the ListSelectionModel to synchronize positions with.

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Notification method to sync positions between ListValueHolder and ListSelectionModel. This method is required by the ListSelectionListener interface. This ListSelectionBinder, registers itself with both the ListValueHolder and the ListSelectionModel to be notified of selection/position changes initiated by either source.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener


Copyright © 2007 Martin T Phelan. All Rights Reserved.