Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ledestin.swing
Class ListComboBoxModel  view ListComboBoxModel download ListComboBoxModel.java

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byledestin.swing.ListComboBoxModel
All Implemented Interfaces:
javax.swing.ComboBoxModel, javax.swing.ListModel, java.io.Serializable

public class ListComboBoxModel
extends javax.swing.AbstractListModel
implements javax.swing.ComboBoxModel


Field Summary
(package private)  java.util.List data
           
(package private)  java.lang.Object selected
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
ListComboBoxModel(java.util.List data)
           
 
Method Summary
 void fireContentsChanged()
           
 java.lang.Object getElementAt(int index)
          Retrieves a data element at a specified index.
protected  java.lang.String getElementText(java.lang.Object element)
          This method must be overriden depending on the type of the objects in the data.
 java.lang.Object getSelectedItem()
          Returns the currently selected item in the combo box.
 int getSize()
          Return the number of data elements in the list.
 void setSelectedItem(java.lang.Object anItem)
          Sets the selected item in the combo box.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Field Detail

data

java.util.List data

selected

java.lang.Object selected
Constructor Detail

ListComboBoxModel

public ListComboBoxModel(java.util.List data)
Method Detail

getSize

public int getSize()
Description copied from interface: javax.swing.ListModel
Return the number of data elements in the list.

Specified by:
getSize in interface javax.swing.ListModel

getElementText

protected java.lang.String getElementText(java.lang.Object element)
This method must be overriden depending on the type of the objects in the data.


getElementAt

public java.lang.Object getElementAt(int index)
Description copied from interface: javax.swing.ListModel
Retrieves a data element at a specified index.

Specified by:
getElementAt in interface javax.swing.ListModel

getSelectedItem

public java.lang.Object getSelectedItem()
Description copied from interface: javax.swing.ComboBoxModel
Returns the currently selected item in the combo box.

Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel

setSelectedItem

public void setSelectedItem(java.lang.Object anItem)
Description copied from interface: javax.swing.ComboBoxModel
Sets the selected item in the combo box. Classes implementing this interface should fire a javax.swing.event.ListDataEvent to all registered javax.swing.event.ListDataListeners to indicate that the selection has changed.

Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel

fireContentsChanged

public void fireContentsChanged()