Class ListDataModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.ComboBoxModel, javax.swing.ListModel, javax.swing.MutableComboBoxModel

    public class ListDataModel
    extends javax.swing.DefaultComboBoxModel
    A model that captures the notion of a list of elements with a single selected element. This is really just a DefaultComboBoxModel, because that class happens to fit our requirements. We subclass DefaultComboBoxModel so we can modify it if any of the behavior should not be quite right.
    Version:
    $Id$
    Author:
    John Reekie
    See Also:
    Serialized Form
    Pt.AcceptedRating:
    Red
    • Field Summary

      • Fields inherited from class javax.swing.AbstractListModel

        listenerList
    • Constructor Summary

      Constructors 
      Constructor Description
      ListDataModel()
      Create a new model.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.Object o)
      Return whether or not the given item is contained by the model
      java.util.List getList()
      Return this model as a list.
      java.util.Iterator iterator()
      Return an iterator over the elements in the model.
      • Methods inherited from class javax.swing.DefaultComboBoxModel

        addAll, addAll, addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt, setSelectedItem
      • 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
    • Constructor Detail

      • ListDataModel

        public ListDataModel()
        Create a new model.
    • Method Detail

      • getList

        public java.util.List getList()
        Return this model as a list.
      • iterator

        public java.util.Iterator iterator()
        Return an iterator over the elements in the model.
      • contains

        public boolean contains​(java.lang.Object o)
        Return whether or not the given item is contained by the model