jaxx.runtime.swing.model
Class GenericListModel<B>

java.lang.Object
  extended by javax.swing.DefaultListSelectionModel
      extended by jaxx.runtime.swing.model.GenericListModel<B>
All Implemented Interfaces:
Serializable, Cloneable, ComboBoxModel, ListModel, ListSelectionModel

public class GenericListModel<B>
extends DefaultListSelectionModel
implements ComboBoxModel

Author:
sletellier
See Also:
Serialized Form

Field Summary
protected  DefaultListModel delegate
           
protected  EventListenerList listenerList
           
protected  PropertyChangeSupport pcs
           
static String PROPERTY_SELECTED_VALUE
           
protected  List<B> selectedValues
           
 
Fields inherited from class javax.swing.DefaultListSelectionModel
leadAnchorNotificationEnabled
 
Fields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
GenericListModel()
           
GenericListModel(Collection<B> values)
           
 
Method Summary
 void addElement(B valueToAdd)
           
 void addElement(int index, B valueToAdd)
           
 void addElements(Collection<B> valuesToAdd)
           
 void addGenericListListener(GenericListListener l)
           
 void addListDataListener(ListDataListener l)
           
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void addSelectedItem(B toSelect)
           
 void addSelectionInterval(int index0, int index1)
           
protected  void addSelectionIntervalWithFire(int index0, int index1)
           
 void clearElements()
           
 void clearSelection()
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
protected  void fireSelectionAdded(Collection<B> selectedValues)
           
protected  void fireSelectionRemoved(Collection<B> selectedValues)
           
protected  void fireValuesAdded(Collection<B> values)
           
protected  void fireValuesRemoved(Collection<B> values)
           
 Object getElementAt(int index)
           
 Collection<B> getElements()
           
 Object getSelectedItem()
           
 B getSelectedValue()
           
 Collection<B> getSelectedValues()
           
 int getSelectionMode()
           
 int getSize()
           
 boolean hasSelectedIndex()
           
 void removeElements(Collection<B> values)
           
 void removeGenericListListener(GenericListListener l)
           
 void removeListDataListener(ListDataListener l)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void removeSelectionInterval(int index0, int index1)
           
protected  void removeSelectionIntervalWithoutFire(int index0, int index1)
           
 void setElements(Collection<B> values)
           
 void setSelectedItem(Object anItem)
           
 void setSelectionInterval(int index0, int index1)
           
protected  void unSelectItem(B value)
           
protected  void unSelectItems(Collection<B> values)
           
 
Methods inherited from class javax.swing.DefaultListSelectionModel
addListSelectionListener, clone, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeIndexInterval, removeListSelectionListener, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionMode, setValueIsAdjusting, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList

pcs

protected final PropertyChangeSupport pcs

PROPERTY_SELECTED_VALUE

public static final String PROPERTY_SELECTED_VALUE
See Also:
Constant Field Values

delegate

protected DefaultListModel delegate

selectedValues

protected List<B> selectedValues
Constructor Detail

GenericListModel

public GenericListModel()

GenericListModel

public GenericListModel(Collection<B> values)
Method Detail

setElements

public void setElements(Collection<B> values)

clearElements

public void clearElements()

getElements

public Collection<B> getElements()

addElement

public void addElement(int index,
                       B valueToAdd)

addElement

public void addElement(B valueToAdd)

addElements

public void addElements(Collection<B> valuesToAdd)

getSelectedValue

public B getSelectedValue()

getSelectedValues

public Collection<B> getSelectedValues()

removeElements

public void removeElements(Collection<B> values)

unSelectItems

protected void unSelectItems(Collection<B> values)

unSelectItem

protected void unSelectItem(B value)

addSelectedItem

public void addSelectedItem(B toSelect)

hasSelectedIndex

public boolean hasSelectedIndex()

addSelectionInterval

public void addSelectionInterval(int index0,
                                 int index1)
Specified by:
addSelectionInterval in interface ListSelectionModel
Overrides:
addSelectionInterval in class DefaultListSelectionModel

setSelectionInterval

public void setSelectionInterval(int index0,
                                 int index1)
Specified by:
setSelectionInterval in interface ListSelectionModel
Overrides:
setSelectionInterval in class DefaultListSelectionModel

removeSelectionInterval

public void removeSelectionInterval(int index0,
                                    int index1)
Specified by:
removeSelectionInterval in interface ListSelectionModel
Overrides:
removeSelectionInterval in class DefaultListSelectionModel

removeSelectionIntervalWithoutFire

protected void removeSelectionIntervalWithoutFire(int index0,
                                                  int index1)

addSelectionIntervalWithFire

protected void addSelectionIntervalWithFire(int index0,
                                            int index1)

clearSelection

public void clearSelection()
Specified by:
clearSelection in interface ListSelectionModel
Overrides:
clearSelection in class DefaultListSelectionModel

getSelectionMode

public int getSelectionMode()
Specified by:
getSelectionMode in interface ListSelectionModel
Overrides:
getSelectionMode in class DefaultListSelectionModel

setSelectedItem

public void setSelectedItem(Object anItem)
Specified by:
setSelectedItem in interface ComboBoxModel

getSelectedItem

public Object getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel

getSize

public int getSize()
Specified by:
getSize in interface ListModel

getElementAt

public Object getElementAt(int index)
Specified by:
getElementAt in interface ListModel

addListDataListener

public void addListDataListener(ListDataListener l)
Specified by:
addListDataListener in interface ListModel

removeListDataListener

public void removeListDataListener(ListDataListener l)
Specified by:
removeListDataListener in interface ListModel

addGenericListListener

public void addGenericListListener(GenericListListener l)

removeGenericListListener

public void removeGenericListListener(GenericListListener l)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)

fireValuesAdded

protected void fireValuesAdded(Collection<B> values)

fireValuesRemoved

protected void fireValuesRemoved(Collection<B> values)

fireSelectionAdded

protected void fireSelectionAdded(Collection<B> selectedValues)

fireSelectionRemoved

protected void fireSelectionRemoved(Collection<B> selectedValues)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)


Copyright © 2008-2012 CodeLutin. All Rights Reserved.