ca.odell.glazedlists.swing
Class EventComboBoxModel<E>

java.lang.Object
  extended by ca.odell.glazedlists.swing.EventListModel<E>
      extended by ca.odell.glazedlists.swing.EventComboBoxModel<E>
All Implemented Interfaces:
ListEventListener<E>, EventListener, ComboBoxModel, ListModel

public class EventComboBoxModel<E>
extends EventListModel<E>
implements ComboBoxModel

A combo box model for displaying Glazed Lists in a combo box.

The implementation of setSelection and getSelection is not in any way tied to the contents of the list.

Author:
Jesse Wilson
See Also:
Glazed Lists Tutorial

Field Summary
 
Fields inherited from class ca.odell.glazedlists.swing.EventListModel
changeSizeRepaintAllThreshhold, listDataEvent
 
Constructor Summary
EventComboBoxModel(EventList<E> source)
          Creates a new combo box model that displays the specified source list in the combo box.
 
Method Summary
 Object getSelectedItem()
          Gets the currently selected item.
 void setSelectedItem(Object selected)
          Sets the currently selected item.
 
Methods inherited from class ca.odell.glazedlists.swing.EventListModel
addListDataListener, dispose, fireListDataEvent, getElementAt, getSize, listChanged, 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, getElementAt, getSize, removeListDataListener
 

Constructor Detail

EventComboBoxModel

public EventComboBoxModel(EventList<E> source)
Creates a new combo box model that displays the specified source list in the combo box.

Method Detail

getSelectedItem

public Object getSelectedItem()
Gets the currently selected item.

Specified by:
getSelectedItem in interface ComboBoxModel

setSelectedItem

public void setSelectedItem(Object selected)
Sets the currently selected item.

The selection notification process is very much a hack. This fires a ListDataEvent where the range is between -1 and -1. This is identical to the notification process used by the DefaultComboBoxModel.

Specified by:
setSelectedItem in interface ComboBoxModel


Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by jessewilson at 2006-08-09 23:05