T - The type of the class contained within the TableColumn cells.public class MapValueFactory<T> extends java.lang.Object implements Callback<TableColumn.CellDataFeatures<java.util.Map,T>,ObservableValue<T>>
TableColumn
cell value factory. An example
of how to use this class is:
ObservableList
In this example, there is a list of Map instances, where each Map instance
representsa single row in the TableView. The "firstName" string is used as a
key into this map, and the value corresponding to this key is returned, if
one exists. If the value is an ObservableValue, then this is returned
directly, otherwise the value is wrapped in a ReadOnlyObjectWrapper.
TableColumn,
TableView,
TableCell,
PropertyValueFactory| Constructor and Description |
|---|
MapValueFactory(java.lang.Object key)
Creates a default MapValueFactory, which will use the provided key to
lookup the value for cells in the
TableColumn in which this
MapValueFactory is installed (via the
cell value factory property. |
| Modifier and Type | Method and Description |
|---|---|
ObservableValue<T> |
call(TableColumn.CellDataFeatures<java.util.Map,T> cdf)
The
call method is called when required, and is given a
single argument of type P, with a requirement that an object of type R
is returned. |
public MapValueFactory(java.lang.Object key)
TableColumn in which this
MapValueFactory is installed (via the
cell value factory property.key - The key to use to lookup the value in the Map.public ObservableValue<T> call(TableColumn.CellDataFeatures<java.util.Map,T> cdf)
Callbackcall method is called when required, and is given a
single argument of type P, with a requirement that an object of type R
is returned.call in interface Callback<TableColumn.CellDataFeatures<java.util.Map,T>,ObservableValue<T>>cdf - The single argument upon which the returned value should be
determined.Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.