org.lyra.Widgets
Class EnhancedListSelectionModel

java.lang.Object
  extended by javax.swing.DefaultListSelectionModel
      extended by org.lyra.Widgets.EnhancedListSelectionModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.ListSelectionModel

public class EnhancedListSelectionModel
extends javax.swing.DefaultListSelectionModel

ListSelectionModels provide no inherent ability to identify which model is called from which element. They also do not provide the capability to return to the JTable/JList which makes use of it. This variant provides both.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster
See Also:
Serialized Form

Field Summary
private  java.lang.String myName
           
private  javax.swing.JTable mySource
           
private static long serialVersionUID
           
 
Fields inherited from class javax.swing.DefaultListSelectionModel
leadAnchorNotificationEnabled, listenerList
 
Fields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
EnhancedListSelectionModel()
          Default constructor which will not provide any additional capability unless it is added manually through setName and setSource methods.
EnhancedListSelectionModel(javax.swing.JTable source)
          Constructor method which will take the source element and adjust both source and identifier elements.
EnhancedListSelectionModel(javax.swing.JTable source, java.lang.String name)
          More complex constructor which will enable specifying both elements.
 
Method Summary
 java.lang.String getName()
          Gets the identifier name.
 javax.swing.JTable getSource()
          Gets the source element attached to this model.
 void setName(java.lang.String name)
          Sets the identifier name.
 void setSource(javax.swing.JTable source)
          Sets the source element attached to the this model.
 
Methods inherited from class javax.swing.DefaultListSelectionModel
addListSelectionListener, addSelectionInterval, clearSelection, clone, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionInterval, setSelectionMode, setValueIsAdjusting, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

myName

private java.lang.String myName

mySource

private javax.swing.JTable mySource
Constructor Detail

EnhancedListSelectionModel

public EnhancedListSelectionModel()
Default constructor which will not provide any additional capability unless it is added manually through setName and setSource methods.


EnhancedListSelectionModel

public EnhancedListSelectionModel(javax.swing.JTable source)
Constructor method which will take the source element and adjust both source and identifier elements.

Parameters:
source - Source JTable attached.

EnhancedListSelectionModel

public EnhancedListSelectionModel(javax.swing.JTable source,
                                  java.lang.String name)
More complex constructor which will enable specifying both elements.

Parameters:
source - Source JTable attached.
name - Identifier string.
Method Detail

getSource

public javax.swing.JTable getSource()
Gets the source element attached to this model.

Returns:
JTable source instance.

setSource

public void setSource(javax.swing.JTable source)
Sets the source element attached to the this model.

Parameters:
source - JTable instance as source.

getName

public java.lang.String getName()
Gets the identifier name.

Returns:
String containing identifier.

setName

public void setName(java.lang.String name)
Sets the identifier name.

Parameters:
name - String containing identifier.