public final class GlazedListsSwing
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <E> TableModelEventAdapter.Factory<E> |
defaultEventAdapterFactory()
Gets a factory for creating a default
TableModelEventAdapter. |
static <E> DefaultEventComboBoxModel<E> |
eventComboBoxModel(EventList<E> source)
Creates a new combobox model that contains all objects located in the given
source and reacts to any changes in the given source. |
static <E> DefaultEventComboBoxModel<E> |
eventComboBoxModelWithThreadProxyList(EventList<E> source)
Creates a new combobox model that contains all objects located in the given
source and reacts to any changes in the given source. |
static <E> DefaultEventListModel<E> |
eventListModel(EventList<E> source)
Creates a new list model that contains all objects located in the given
source and reacts to any changes in the given source. |
static <E> DefaultEventListModel<E> |
eventListModelWithThreadProxyList(EventList<E> source)
Creates a new list model that contains all objects located in the given
source and reacts to any changes in the given source. |
static <E> AdvancedListSelectionModel<E> |
eventSelectionModel(EventList<E> source)
Creates a new selection model that also presents a list of the selection.
|
static <E> AdvancedListSelectionModel<E> |
eventSelectionModelWithThreadProxyList(EventList<E> source)
Creates a new selection model that also presents a list of the selection.
|
static <E> AdvancedTableModel<E> |
eventTableModel(EventList<E> source,
java.lang.String[] propertyNames,
java.lang.String[] columnLabels,
boolean[] writable)
Creates a new table model that renders the specified list with an automatically
generated
TableFormat. |
static <E> AdvancedTableModel<E> |
eventTableModel(EventList<E> source,
TableFormat<? super E> tableFormat)
Creates a new table model that extracts column data from the given
source using the the given tableFormat. |
static <E> AdvancedTableModel<E> |
eventTableModel(EventList<E> source,
TableFormat<? super E> tableFormat,
TableModelEventAdapter.Factory<E> eventAdapterFactory)
Creates a new table model that extracts column data from the given
source using the the given tableFormat. |
static <E> AdvancedTableModel<E> |
eventTableModelWithThreadProxyList(EventList<E> source,
java.lang.String[] propertyNames,
java.lang.String[] columnLabels,
boolean[] writable)
Creates a new table model that renders the specified list with an automatically
generated
TableFormat. |
static <E> AdvancedTableModel<E> |
eventTableModelWithThreadProxyList(EventList<E> source,
TableFormat<? super E> tableFormat)
Creates a new table model that extracts column data from the given
source
using the the given tableFormat. |
static <E> AdvancedTableModel<E> |
eventTableModelWithThreadProxyList(EventList<E> source,
TableFormat<? super E> tableFormat,
TableModelEventAdapter.Factory<E> eventAdapterFactory)
Creates a new table model that extracts column data from the given
source
using the the given tableFormat. |
static boolean |
isSwingThreadProxyList(EventList list)
Returns true iff
list is an EventList that fires
all of its update events from the Swing event dispatch thread. |
static javax.swing.BoundedRangeModel |
lowerRangeModel(ThresholdList target)
Creates a model that manipulates the lower bound of the specified
ThresholdList.
|
static <E> TableModelEventAdapter.Factory<E> |
manyToOneEventAdapterFactory()
Gets a factory for creating a non-default
TableModelEventAdapter. |
static <E> TransformedList<E,E> |
swingThreadProxyList(EventList<E> source)
Wraps the source in an
EventList that fires all of its update
events from the Swing event dispatch thread. |
static javax.swing.BoundedRangeModel |
upperRangeModel(ThresholdList target)
Creates a model that manipulates the upper bound of the specified
ThresholdList.
|
public static <E> TransformedList<E,E> swingThreadProxyList(EventList<E> source)
EventList that fires all of its update
events from the Swing event dispatch thread.public static boolean isSwingThreadProxyList(EventList list)
list is an EventList that fires
all of its update events from the Swing event dispatch thread.public static javax.swing.BoundedRangeModel lowerRangeModel(ThresholdList target)
public static javax.swing.BoundedRangeModel upperRangeModel(ThresholdList target)
public static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, TableFormat<? super E> tableFormat)
source using the the given tableFormat.
The returned table model is not thread-safe. Unless otherwise
noted, all methods are only safe to be called from the event dispatch thread.
To do this programmatically, use SwingUtilities.invokeAndWait(Runnable) and
wrap the source list (or some part of the source list's pipeline) using
swingThreadProxyList(EventList).
source - the EventList that provides the row objectstableFormat - the object responsible for extracting column data
from the row objectspublic static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, TableFormat<? super E> tableFormat)
source
using the the given tableFormat. While holding a read lock,
this method wraps the source list using
swingThreadProxyList(EventList).
The returned table model is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread.
source - the EventList that provides the row objectstableFormat - the object responsible for extracting column data from the row objectspublic static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, TableFormat<? super E> tableFormat, TableModelEventAdapter.Factory<E> eventAdapterFactory)
source using the the given tableFormat.
The eventAdapterFactory is used to create a TableModelEventAdapter,
which is then used by the created table model to convert list events to table model events.
The returned table model is not thread-safe. Unless otherwise
noted, all methods are only safe to be called from the event dispatch thread.
To do this programmatically, use SwingUtilities.invokeAndWait(Runnable) and
wrap the source list (or some part of the source list's pipeline) using
swingThreadProxyList(EventList).
source - the EventList that provides the row objectstableFormat - the object responsible for extracting column data
from the row objectseventAdapterFactory - factory for creating a TableModelEventAdapterpublic static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, TableFormat<? super E> tableFormat, TableModelEventAdapter.Factory<E> eventAdapterFactory)
source
using the the given tableFormat.
While holding a read lock, this method wraps the source list using
swingThreadProxyList(EventList).
The eventAdapterFactory is used to create a TableModelEventAdapter,
which is then used by the created table model to convert list events to table model events.
The returned table model is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread.
source - the EventList that provides the row objectstableFormat - the object responsible for extracting column data from the row objectseventAdapterFactory - factory for creating a TableModelEventAdapterpublic static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, java.lang.String[] propertyNames, java.lang.String[] columnLabels, boolean[] writable)
TableFormat. It uses JavaBeans and reflection to create
a TableFormat as specified.
Note that classes that will be obfuscated may not work with
reflection. In this case, implement a TableFormat manually.
The returned table model is not thread-safe. Unless otherwise
noted, all methods are only safe to be called from the event dispatch thread.
To do this programmatically, use SwingUtilities.invokeAndWait(Runnable) and
wrap the source list (or some part of the source list's pipeline) using
swingThreadProxyList(EventList).
source - the EventList that provides the row objectspropertyNames - an array of property names in the JavaBeans format.
For example, if your list contains Objects with the methods getFirstName(),
setFirstName(String), getAge(), setAge(Integer), then this array should
contain the two strings "firstName" and "age". This format is specified
by the JavaBeans PropertyDescriptor.columnLabels - the corresponding column names for the listed property
names. For example, if your columns are "firstName" and "age", then
your labels might be "First Name" and "Age".writable - an array of booleans specifying which of the columns in
your table are writable.public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, java.lang.String[] propertyNames, java.lang.String[] columnLabels, boolean[] writable)
TableFormat. It uses JavaBeans and reflection to create
a TableFormat as specified. While holding a read lock,
this method wraps the source list using
swingThreadProxyList(EventList).
Note that classes that will be obfuscated may not work with
reflection. In this case, implement a TableFormat manually.
The returned table model is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread.
source - the EventList that provides the row objectspropertyNames - an array of property names in the JavaBeans format.
For example, if your list contains Objects with the methods getFirstName(),
setFirstName(String), getAge(), setAge(Integer), then this array should
contain the two strings "firstName" and "age". This format is specified
by the JavaBeans PropertyDescriptor.columnLabels - the corresponding column names for the listed property
names. For example, if your columns are "firstName" and "age", then
your labels might be "First Name" and "Age".writable - an array of booleans specifying which of the columns in
your table are writable.public static <E> TableModelEventAdapter.Factory<E> defaultEventAdapterFactory()
TableModelEventAdapter.
The default strategy to convert list events to table model events is to be as accurate as possible.
In particular, each list event block as converted to and fired as a separate TableModelEvent.
So, one list event can cause multiple table model events.
In some cases, this conversion strategy can lead to undesirable effects, such as table repainting issues.
One known case is when the table property fillsViewportHeight is true.
Using the other standard factory is then recommended.
TableModelEventAdaptermanyToOneEventAdapterFactory(),
TableModelEventAdapter.Factory,
ListEvent,
TableModelEventpublic static <E> TableModelEventAdapter.Factory<E> manyToOneEventAdapterFactory()
TableModelEventAdapter.
Whereas the default TableModelEventAdapter converts each ListEvent block to a TableModelEvent, this strategy tries to create only one TableModelEvent for a ListEvent, if it does not represent a reorder. If the ListEvent contains multiple blocks, a special data changed TableModelEvent will be fired, indicating that all row data has changed. Note, that such a data changed TableModelEvent can lead to a loss of the table selection.
Therefore you should use this strategy only, when the
default strategy doesn't fit your
needs or causes undesirable effects/behaviour.
TableModelEventAdapterdefaultEventAdapterFactory(),
TableModelEventAdapter.Factory,
ListEvent,
TableModelEventpublic static <E> AdvancedListSelectionModel<E> eventSelectionModel(EventList<E> source)
AdvancedListSelectionModel listens to this EventList in order
to adjust selection when the EventList is modified. For example,
when an element is added to the EventList, this may offset the
selection of the following elements.
The returned selection model is not thread-safe. Unless otherwise
noted, all methods are only safe to be called from the event dispatch thread.
To do this programmatically, use SwingUtilities.invokeAndWait(Runnable) and
wrap the source list (or some part of the source list's pipeline) using
swingThreadProxyList(EventList).
source - the EventList whose selection will be managed. This should
be the same EventList passed to the constructor of your
AdvancedTableModel or EventListModel.public static <E> AdvancedListSelectionModel<E> eventSelectionModelWithThreadProxyList(EventList<E> source)
swingThreadProxyList(EventList). The
AdvancedListSelectionModel listens to this EventList in order to adjust
selection when the EventList is modified. For example, when an element is added to
the EventList, this may offset the selection of the following elements.
The returned selection model is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread.
source - the EventList whose selection will be managed. This should be the
same EventList passed to the constructor of your
AdvancedTableModel or EventListModel.public static <E> DefaultEventListModel<E> eventListModel(EventList<E> source)
source and reacts to any changes in the given source.
The returned selection model is not thread-safe. Unless otherwise
noted, all methods are only safe to be called from the event dispatch thread.
To do this programmatically, use SwingUtilities.invokeAndWait(Runnable) and
wrap the source list (or some part of the source list's pipeline) using
swingThreadProxyList(EventList).
source - the EventList that provides the elementspublic static <E> DefaultEventListModel<E> eventListModelWithThreadProxyList(EventList<E> source)
source and reacts to any changes in the given source.
While holding a read lock, it wraps the source list using
swingThreadProxyList(EventList).
The returned selection model is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread.
source - the EventList that provides the elementspublic static <E> DefaultEventComboBoxModel<E> eventComboBoxModel(EventList<E> source)
source and reacts to any changes in the given source.
The returned combobox model is not thread-safe. Unless otherwise
noted, all methods are only safe to be called from the event dispatch thread.
To do this programmatically, use SwingUtilities.invokeAndWait(Runnable) and
wrap the source list (or some part of the source list's pipeline) using
swingThreadProxyList(EventList).
source - the EventList that provides the elementspublic static <E> DefaultEventComboBoxModel<E> eventComboBoxModelWithThreadProxyList(EventList<E> source)
source and reacts to any changes in the given source.
While holding a read lock, it wraps the source list using
swingThreadProxyList(EventList).
The returned combobox model is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread.
source - the EventList that provides the elementsGlazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by swimmesberger at Wed Feb 13 09:45:20 CET 2019