javax.swing.text.html
Class OptionComboBoxModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byjavax.swing.DefaultComboBoxModel
          extended byjavax.swing.text.html.OptionComboBoxModel
All Implemented Interfaces:
ComboBoxModel, ListModel, MutableComboBoxModel, Serializable

class OptionComboBoxModel
extends DefaultComboBoxModel
implements Serializable

OptionComboBoxModel extends the capabilities of the DefaultComboBoxModel, to store the Option that is initially marked as selected. This is stored, in order to enable an accurate reset of the ComboBox that represents the SELECT form element when the user requests a clear/reset. Given that a combobox only allow for one item to be selected, the last OPTION that has the attribute set wins.

Author:
Sunita Mani

Field Summary
private  Option selectedOption
           
 
Fields inherited from class javax.swing.DefaultComboBoxModel
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
(package private) OptionComboBoxModel()
           
 
Method Summary
 Option getInitialSelection()
          Fetches the Option item that represents that was initially set to a selected state.
 void setInitialSelection(Option option)
          Stores the Option that has been marked its selected attribute set.
 
Methods inherited from class javax.swing.DefaultComboBoxModel
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
 

Field Detail

selectedOption

private Option selectedOption
Constructor Detail

OptionComboBoxModel

OptionComboBoxModel()
Method Detail

setInitialSelection

public void setInitialSelection(Option option)
Stores the Option that has been marked its selected attribute set.


getInitialSelection

public Option getInitialSelection()
Fetches the Option item that represents that was initially set to a selected state.