javax.swing.plaf.metal
Class MetalFileChooserUI.FilterComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by javax.swing.plaf.metal.MetalFileChooserUI.FilterComboBoxModel
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, ComboBoxModel, ListModel
Enclosing class:
MetalFileChooserUI

protected class MetalFileChooserUI.FilterComboBoxModel
extends AbstractListModel
implements ComboBoxModel, PropertyChangeListener

A combo box model for the file selection filters.

See Also:
Serialized Form

Field Summary
protected  FileFilter[] filters
          Storage for the filters in the model.
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
protected MetalFileChooserUI.FilterComboBoxModel()
          Creates a new model.
 
Method Summary
 Object getElementAt(int index)
          Returns the item at the specified index.
 Object getSelectedItem()
          Returns the selected file filter.
 int getSize()
          Returns the number of items in the model.
 void propertyChange(PropertyChangeEvent e)
          Handles property changes.
 void setSelectedItem(Object filter)
          Sets the selected filter.
 
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

filters

protected FileFilter[] filters
Storage for the filters in the model.

Constructor Detail

MetalFileChooserUI.FilterComboBoxModel

protected MetalFileChooserUI.FilterComboBoxModel()
Creates a new model.

Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent e)
Handles property changes.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
e - the property change event.

setSelectedItem

public void setSelectedItem(Object filter)
Sets the selected filter.

Specified by:
setSelectedItem in interface ComboBoxModel
Parameters:
filter - the filter (null ignored).

getSelectedItem

public Object getSelectedItem()
Returns the selected file filter.

Specified by:
getSelectedItem in interface ComboBoxModel
Returns:
The selected file filter.

getSize

public int getSize()
Returns the number of items in the model.

Specified by:
getSize in interface ListModel
Returns:
The number of items in the model.

getElementAt

public Object getElementAt(int index)
Returns the item at the specified index.

Specified by:
getElementAt in interface ListModel
Parameters:
index - the item index.
Returns:
The item at the specified index.