public class DefaultEventComboViewer<E> extends java.lang.Object implements ListEventListener<E>
EventList
in a Combo
component.
This class is not thread safe. It must be used exclusively with the SWT event handler thread.
Modifier and Type | Field and Description |
---|---|
protected EventList<E> |
source
the EventList to respond to
|
Modifier | Constructor and Description |
---|---|
|
DefaultEventComboViewer(EventList<E> source,
Combo combo)
Binds the contents of a
Combo component to an EventList
source. |
|
DefaultEventComboViewer(EventList<E> source,
Combo combo,
ItemFormat<? super E> itemFormat)
Binds the contents of a
Combo component to an EventList
source. |
protected |
DefaultEventComboViewer(EventList<E> source,
Combo combo,
ItemFormat<? super E> itemFormat,
boolean disposeSource)
Binds the contents of a
Combo component to an EventList
source. |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases the resources consumed by this
DefaultEventComboViewer so that it
may eventually be garbage collected. |
Combo |
getCombo()
Gets the Combo being managed by this
DefaulEventComboViewer . |
ItemFormat<? super E> |
getItemFormat()
Gets the Combo's
ItemFormat . |
void |
listChanged(ListEvent<E> listChanges)
When the source combo is changed, this forwards the change to the
displayed combo.
|
public DefaultEventComboViewer(EventList<E> source, Combo combo)
Combo
component to an EventList
source. This allows the selection choices in a Combo
to change
dynamically to reflect chances to the source EventList
. The
String
values displayed in the Combo
component will be
the result of calling toString() on the Objects found in source.source
- the EventList that provides the elementscombo
- the combo boxpublic DefaultEventComboViewer(EventList<E> source, Combo combo, ItemFormat<? super E> itemFormat)
Combo
component to an EventList
source. This allows the selection choices in a Combo
to change
dynamically to reflect chances to the source EventList
. The
String
values displayed in the Combo
component will be
formatted using the provided ItemFormat
.source
- the EventList that provides the elementscombo
- the combo boxitemFormat
- an ItemFormat
for formatting the displayed valuesItemFormat
,
GlazedListsSWT.beanItemFormat(String)
protected DefaultEventComboViewer(EventList<E> source, Combo combo, ItemFormat<? super E> itemFormat, boolean disposeSource)
Combo
component to an EventList
source. This allows the selection choices in a Combo
to change
dynamically to reflect chances to the source EventList
. The
String
values displayed in the Combo
component will be
formatted using the provided ItemFormat
.source
- the EventList that provides the elementscombo
- the combo boxitemFormat
- an optional ItemFormat
for formatting the displayed valuesdiposeSource
- true
if the source list should be disposed when disposing
this model, false
otherwiseItemFormat
,
GlazedListsSWT.beanItemFormat(String)
public Combo getCombo()
DefaulEventComboViewer
.public ItemFormat<? super E> getItemFormat()
ItemFormat
.public void listChanged(ListEvent<E> listChanges)
listChanged
in interface ListEventListener<E>
listChanges
- a ListEvent
describing the changes to the listpublic void dispose()
DefaultEventComboViewer
so that it
may eventually be garbage collected.
An DefaultEventComboViewer
will be garbage collected without a call to
dispose()
, but not before its source EventList
is garbage
collected. By calling dispose()
, you allow the DefaultEventComboViewer
to be garbage collected before its source EventList
. This is
necessary for situations where an DefaultEventComboViewer
is short-lived but
its source EventList
is long-lived.
Warning: It is an error
to call any method on a DefaultEventComboViewer
after it has been disposed.
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by mockbuild at 2017-07-26 15:03