public class DefaultEventListViewer<E> extends java.lang.Object implements ListEventListener<E>
EventList
in a List
.
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 proxy moves events to the SWT user interface thread
|
Modifier | Constructor and Description |
---|---|
|
DefaultEventListViewer(EventList<E> source,
List list)
Creates a new List that displays and responds to changes in the source list.
|
|
DefaultEventListViewer(EventList<E> source,
List list,
ItemFormat<? super E> itemFormat)
Creates a new List that displays and responds to changes in the source list.
|
protected |
DefaultEventListViewer(EventList<E> source,
List list,
ItemFormat<? super E> itemFormat,
boolean disposeSource)
Creates a new List that displays and responds to changes in the source list.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases the resources consumed by this
DefaultEventListViewer so that it
may eventually be garbage collected. |
EventList<E> |
getDeselected()
Provides access to an
EventList that contains items from the
viewed Table that are not currently selected. |
ItemFormat<? super E> |
getItemFormat()
Gets the List's
ItemFormat . |
List |
getList()
Gets the List being managed by this
DefaultEventListViewer . |
EventList<E> |
getSelected()
Provides access to an
EventList that contains items from the
viewed Table that are currently selected. |
EventList<E> |
getTogglingDeselected()
Gets an
EventList that contains only deselected values and
modifies the selection state on mutation. |
EventList<E> |
getTogglingSelected()
Gets an
EventList that contains only selected
values and modifies the selection state on mutation. |
void |
invertSelection()
Inverts the current selection.
|
void |
listChanged(ListEvent<E> listChanges)
When the source list is changed, this forwards the change to the
displayed List.
|
public DefaultEventListViewer(EventList<E> source, List list)
source
- the EventList that provides the elementslist
- the listpublic DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat)
ItemFormat
.source
- the EventList that provides the elementslist
- the listitemFormat
- an ItemFormat
for formatting the displayed valuesItemFormat
,
GlazedListsSWT.beanItemFormat(String)
protected DefaultEventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat, boolean disposeSource)
ItemFormat
.source
- the EventList that provides the elementslist
- the listitemFormat
- 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 ItemFormat<? super E> getItemFormat()
ItemFormat
.public List getList()
DefaultEventListViewer
.public EventList<E> getDeselected()
EventList
that contains items from the
viewed Table that are not currently selected.public EventList<E> getTogglingDeselected()
EventList
that contains only deselected values and
modifies the selection state on mutation.
Adding an item to this list deselects it and removing an item selects it.
If an item not in the source list is added an
IllegalArgumentException
is thrownpublic EventList<E> getSelected()
EventList
that contains items from the
viewed Table that are currently selected.public EventList<E> getTogglingSelected()
EventList
that contains only selected
values and modifies the selection state on mutation.
Adding an item to this list selects it and removing an item deselects it.
If an item not in the source list is added an
IllegalArgumentException
is thrown.public void listChanged(ListEvent<E> listChanges)
listChanged
in interface ListEventListener<E>
listChanges
- a ListEvent
describing the changes to the listpublic void invertSelection()
public void dispose()
DefaultEventListViewer
so that it
may eventually be garbage collected.
An DefaultEventListViewer
will be garbage collected without a call to
dispose()
, but not before its source EventList
is garbage
collected. By calling dispose()
, you allow the DefaultEventListViewer
to be garbage collected before its source EventList
. This is
necessary for situations where an DefaultEventListViewer
is short-lived but
its source EventList
is long-lived.
Warning: It is an error
to call any method on a DefaultEventListViewer
after it has been disposed.
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by mockbuild at 2016-06-08 1:09