ca.odell.glazedlists.swing

Class EventComboBoxModel<E>

Implemented Interfaces:
ComboBoxModel, EventListener, ListEventListener<E>, 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 setSelectedItem(Object) and getSelectedItem() 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<E>

listDataEvent

Constructor Summary

EventComboBoxModel(EventList source)
Creates a new combo box model that contains the elements of the given source and tracks further changes made to it.

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<E>

addListDataListener, dispose, fireListDataEvent, getElementAt, getSize, listChanged, removeListDataListener

Constructor Details

EventComboBoxModel

public EventComboBoxModel(EventList source)
Creates a new combo box model that contains the elements of the given source and tracks further changes made to it.

Method Details

getSelectedItem

public Object getSelectedItem()
Gets the currently selected item.

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.


Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by pbuilder at 2009-07-14 22:05