public class DefaultEventTableViewer<E> extends java.lang.Object implements ListEventListener<E>
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 actual EventList to which this EventTableViewer is listening
|
Modifier | Constructor and Description |
---|---|
|
DefaultEventTableViewer(EventList<E> source,
Table table,
TableFormat<? super E> tableFormat)
Creates a new viewer for the given
Table that updates the table
contents in response to changes on the specified EventList . |
|
DefaultEventTableViewer(EventList<E> source,
Table table,
TableFormat<? super E> tableFormat,
TableItemConfigurer<? super E> tableItemConfigurer)
Creates a new viewer for the given
Table that updates the table
contents in response to changes on the specified EventList . |
protected |
DefaultEventTableViewer(EventList<E> source,
Table table,
TableFormat<? super E> tableFormat,
TableItemConfigurer<? super E> tableItemConfigurer,
boolean disposeSource)
Creates a new viewer for the given
Table that updates the table
contents in response to changes on the specified EventList . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases the resources consumed by this
DefaultEventTableViewer so that it
may eventually be garbage collected. |
java.util.List<E> |
getAllChecked()
Gets all checked items.
|
boolean |
getCheckedOnly()
Get whether this is showing only checked elements.
|
EventList<E> |
getDeselected()
Provides access to an
EventList that contains items from the
viewed Table that are not currently selected. |
EventList<E> |
getSelected()
Provides access to an
EventList that contains items from the
viewed Table that are currently selected. |
EventList<E> |
getSourceList()
Get the source of this
DefaultEventTableViewer . |
Table |
getTable()
Gets the
Table that is being managed by this
DefaultEventTableViewer . |
TableFormat<? super E> |
getTableFormat()
Gets the
TableFormat . |
TableItemConfigurer<? super E> |
getTableItemConfigurer()
Gets the
TableItemConfigurer . |
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 listChanges)
When the source list is changed, this forwards the change to the
displayed
Table . |
void |
setCheckedOnly(boolean checkedOnly)
Set whether this shall show only checked elements.
|
void |
setTableFormat(TableFormat<? super E> tableFormat)
Sets this
Table to be formatted by a different TableFormat . |
void |
setTableItemConfigurer(TableItemConfigurer<? super E> tableItemConfigurer)
Sets a new
TableItemConfigurer . |
public DefaultEventTableViewer(EventList<E> source, Table table, TableFormat<? super E> tableFormat)
Table
that updates the table
contents in response to changes on the specified EventList
. The
Table
is formatted with the specified TableFormat
.source
- the EventList that provides the row objectstable
- the Table viewing the source objectstableFormat
- the object responsible for extracting column data
from the row objectspublic DefaultEventTableViewer(EventList<E> source, Table table, TableFormat<? super E> tableFormat, TableItemConfigurer<? super E> tableItemConfigurer)
Table
that updates the table
contents in response to changes on the specified EventList
. The
Table
is formatted with the specified TableFormat
.source
- the EventList that provides the row objectstable
- the Table viewing the source objectstableFormat
- the object responsible for extracting column data
from the row objectstableItemConfigurer
- responsible for configuring table itemsprotected DefaultEventTableViewer(EventList<E> source, Table table, TableFormat<? super E> tableFormat, TableItemConfigurer<? super E> tableItemConfigurer, boolean disposeSource)
Table
that updates the table
contents in response to changes on the specified EventList
. The
Table
is formatted with the specified TableFormat
.source
- the EventList that provides the row objectstable
- the Table viewing the source objectstableFormat
- the object responsible for extracting column data
from the row objectstableItemConfigurer
- responsible for configuring table itemsdiposeSource
- true
if the source list should be disposed when disposing
this model, false
otherwisepublic TableFormat<? super E> getTableFormat()
TableFormat
.public void setTableFormat(TableFormat<? super E> tableFormat)
Table
to be formatted by a different TableFormat
.tableFormat
- the new TableFormatjava.lang.IllegalArgumentException
- if tableFormat is null
public TableItemConfigurer<? super E> getTableItemConfigurer()
TableItemConfigurer
.public void setTableItemConfigurer(TableItemConfigurer<? super E> tableItemConfigurer)
TableItemConfigurer
. The cell values of existing,
non-virtual table items will be reconfigured with the specified configurer.public Table getTable()
Table
that is being managed by this
DefaultEventTableViewer
.public void setCheckedOnly(boolean checkedOnly)
public boolean getCheckedOnly()
public java.util.List<E> getAllChecked()
public EventList<E> getSourceList()
DefaultEventTableViewer
.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 listChanges)
Table
.listChanged
in interface ListEventListener<E>
listChanges
- a ListEvent
describing the changes to the listpublic void invertSelection()
public void dispose()
DefaultEventTableViewer
so that it
may eventually be garbage collected.
An DefaultEventTableViewer
will be garbage collected without a call to
dispose()
, but not before its source EventList
is garbage
collected. By calling dispose()
, you allow the DefaultEventTableViewer
to be garbage collected before its source EventList
. This is
necessary for situations where an DefaultEventTableViewer
is short-lived but
its source EventList
is long-lived.
Warning: It is an error
to call any method on a DefaultEventTableViewer
after it has been disposed.
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by mockbuild at 2018-07-13 9:19