|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.odell.glazedlists.swing.GlazedListsSwing
public final class GlazedListsSwing
A factory for creating all sorts of objects to be used with Glazed Lists.
Method Summary | ||
---|---|---|
static
|
defaultEventAdapterFactory()
Gets a factory for creating a default TableModelEventAdapter . |
|
static
|
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
|
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
|
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
|
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
|
eventSelectionModel(EventList<E> source)
Creates a new selection model that also presents a list of the selection. |
|
static
|
eventSelectionModelWithThreadProxyList(EventList<E> source)
Creates a new selection model that also presents a list of the selection. |
|
static
|
eventTableModel(EventList<E> source,
String[] propertyNames,
String[] columnLabels,
boolean[] writable)
Creates a new table model that renders the specified list with an automatically generated TableFormat . |
|
static
|
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
|
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
|
eventTableModelWithThreadProxyList(EventList<E> source,
String[] propertyNames,
String[] columnLabels,
boolean[] writable)
Creates a new table model that renders the specified list with an automatically generated TableFormat . |
|
static
|
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
|
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 BoundedRangeModel |
lowerRangeModel(ThresholdList target)
Creates a model that manipulates the lower bound of the specified ThresholdList. |
|
static
|
manyToOneEventAdapterFactory()
Gets a factory for creating a non-default TableModelEventAdapter . |
|
static
|
swingThreadProxyList(EventList<E> source)
Wraps the source in an EventList that fires all of its update
events from the Swing event dispatch thread. |
|
static BoundedRangeModel |
upperRangeModel(ThresholdList target)
Creates a model that manipulates the upper bound of the specified ThresholdList. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 BoundedRangeModel lowerRangeModel(ThresholdList target)
public static 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 TableModelEventAdapter
public 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 TableModelEventAdapter
public static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, String[] propertyNames, 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, String[] propertyNames, 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.
TableModelEventAdapter
manyToOneEventAdapterFactory()
,
TableModelEventAdapter.Factory
,
ListEvent
,
TableModelEvent
public 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.
TableModelEventAdapter
defaultEventAdapterFactory()
,
TableModelEventAdapter.Factory
,
ListEvent
,
TableModelEvent
public 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 elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |