|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.widget.table.PropertyColumnTableDescription
public class PropertyColumnTableDescription
PropertyColumnTableDescription is the default implementation of TableDescription
which uses class
introspection to create columns. Each column is based on a property of the class and thus should be
accessible through an isXXX or getXXX method.
Additionally writing capabilities are available by providing a specific TableCellEditor
. When
using this table description with a detail form and a backing formModel, take a look at the
ValueModelTableCellEditor
.
Nested properties can be accessed using the dot notation: 'propertyA.propertyB'. At any point in this chaining getting a null value will stop evaluating the expression and returns null.
Typical usage of aPropertyColumnTableDescription
:
PropertyColumnTableDescription tableDesc = new PropertyColumnTableDescription("id", MyType.class); tableDesc.addPropertyColumn("propertyA"); tableDesc.addPropertyColumn("propertyB").addRenderer(MySpecificTableCellRenderer); tableDesc.addPropertyColumn("propertyC").addMinWidth(25).addMaxWidth(100);
More possibilities and additional addXXX methods can be found in the PropertyColumn
class.
PropertyColumnTableDescription
class and the adding of new features, a new way of column creation
has been implemented with the addXXX methods on the PropertyColumn
class. New features will be
exclusive to the addXXX methods.
Constructor Summary | |
---|---|
PropertyColumnTableDescription(Class forEntityType)
|
|
PropertyColumnTableDescription(Class forEntityType,
Comparator defaultComparator)
|
|
PropertyColumnTableDescription(String id,
Class forEntityType)
|
|
PropertyColumnTableDescription(String id,
Class forEntityType,
Comparator defaultComparator)
|
|
PropertyColumnTableDescription(String id,
Class forEntityType,
int numberOfColumns)
|
|
PropertyColumnTableDescription(String id,
Class forEntityType,
int numberOfColumns,
Comparator defaultComparator)
Constructor creating a PropertyColumnTableDescription based on the given type. |
Method Summary | |
---|---|
PropertyColumn |
addPropertyColumn(String propertyName)
|
PropertyColumn |
addPropertyColumn(String propertyName,
Class<?> propertyType)
Create and add a column for the given property. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
int minWidth,
int maxWidth)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
int minWidth,
int maxWidth,
boolean resizable,
TableCellRenderer renderer)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
int minWidth,
int maxWidth,
boolean resizable,
TableCellRenderer renderer,
Comparator comparator)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
int width,
TableCellRenderer renderer,
boolean visible)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
String[] headerKeys,
int minWidth,
int maxWidth,
boolean resizable,
Boolean isInTextFilter)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
String[] headerKeys,
int minWidth,
int maxWidth,
boolean resizable,
TableCellRenderer renderer,
Boolean isInTextFilter)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
String[] headerKeys,
int minWidth,
int maxWidth,
boolean resizable,
TableCellRenderer renderer,
Boolean isInTextFilter,
Comparator comparator)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
TableCellEditor editor)
Deprecated. |
void |
addPropertyColumn(String propertyName,
Class propertyType,
TableCellRenderer renderer)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int width)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int width,
boolean visible)
Deprecated. |
PropertyColumn |
addPropertyColumn(String propertyName,
int width,
Comparator comparator)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int minWidth,
int maxWidth)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int minWidth,
int maxWidth,
boolean resizable,
TableCellRenderer renderer)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int minWidth,
int maxWidth,
boolean resizable,
TableCellRenderer renderer,
Comparator comparator)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int width,
TableCellRenderer renderer)
Deprecated. |
void |
addPropertyColumn(String propertyName,
int width,
TableCellRenderer renderer,
boolean visible)
Deprecated. |
PropertyColumn |
addPropertyColumn(String propertyName,
TableCellRenderer renderer)
Deprecated. |
void |
addSelectPropertyColumn(String propertyName)
|
void |
addSelectPropertyColumn(String propertyName,
Comparator<?> comparator)
|
void |
addSelectPropertyColumn(String propertyName,
int width)
|
void |
addSelectPropertyColumn(String propertyName,
int minWidth,
int maxWidth)
|
void |
addSelectPropertyColumn(String propertyName,
int minWidth,
int maxWidth,
Comparator comparator)
|
void |
addSelectPropertyColumn(String propertyName,
String[] headerKeys,
int minWidth,
int maxWidth,
boolean resizable,
Comparator comparator)
|
void |
addSelectPropertyColumn(String propertyName,
String[] headerKeys,
int minWidth,
int maxWidth,
boolean resizable,
Comparator comparator,
boolean visible)
|
Comparator |
getColumnComparator(int propertyIndex)
The comparator for a column |
int |
getColumnCount()
Returns the column count |
TableCellEditor |
getColumnEditor(int propertyIndex)
The cell editorr for a column |
TableCellRenderer |
getColumnRenderer(int propertyIndex)
The column renderer for a column |
Class<?> |
getDataType()
|
Comparator<?> |
getDefaultComparator()
The default comparator |
String |
getHeader(int propertyIndex)
Column header. |
int |
getMaxColumnWidth(int propertyIndex)
Maximum width for a column |
int |
getMinColumnWidth(int propertyIndex)
Minimum width for a column |
String[] |
getPropertiesInTextFilter()
De properties to be included in the text filter |
Class |
getType(int propertyIndex)
Datatype for a column |
Object |
getValue(Object rowObject,
int propertyIndex)
Value of a columnn for a certain row object |
boolean |
hasSelectColumn()
|
boolean |
isResizable(int propertyIndex)
If the column is resizable |
boolean |
isSelectColumn(int propertyIndex)
Whether this column is a selection column |
boolean |
isVisible(int propertyIndex)
Whether the column is initially visible or not |
void |
setDefaultComparator(Comparator<?> defaultComparator)
Set the comparator to use as default (when table is filled or other specific sorting is removed). |
void |
setPropertyColumns(Collection<PropertyColumn> propertyColumns)
|
void |
setValue(Object rowObject,
int propertyIndex,
Object newValue)
Sets the value of a column of a certain row object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyColumnTableDescription(Class forEntityType)
PropertyColumnTableDescription(String, Class, int, Comparator)
public PropertyColumnTableDescription(Class forEntityType, Comparator defaultComparator)
PropertyColumnTableDescription(String, Class, int, Comparator)
public PropertyColumnTableDescription(String id, Class forEntityType, Comparator defaultComparator)
PropertyColumnTableDescription(String, Class, int, Comparator)
public PropertyColumnTableDescription(String id, Class forEntityType)
PropertyColumnTableDescription(String, Class, int, Comparator)
public PropertyColumnTableDescription(String id, Class forEntityType, int numberOfColumns)
PropertyColumnTableDescription(String, Class, int, Comparator)
public PropertyColumnTableDescription(String id, Class forEntityType, int numberOfColumns, Comparator defaultComparator)
PropertyColumnTableDescription
based on the given type. Each column
created will need to have a corresponding property path on this type.
id
- id used to fetch messages for the column headers.forEntityType
- type of the row item.numberOfColumns
- expected number of columns.defaultComparator
- comparator for the default sorting. Initial table will be sorted according to this
comparator as well as when all other specific sorting is removed.Method Detail |
---|
public PropertyColumn addPropertyColumn(String propertyName)
addPropertyColumn(String, Class)
public PropertyColumn addPropertyColumn(String propertyName, Class<?> propertyType)
null
) by examining the Accessor
and headerKeys are added based upon the id of
the PropertyColumnTableDescription
, the propertyName and the postfix "HEADER".
propertyName
- name of the property.propertyType
- type of the property. If null
a type will be determined by examining the
accessor method.public void setPropertyColumns(Collection<PropertyColumn> propertyColumns)
public PropertyColumn addPropertyColumn(String propertyName, int width, Comparator comparator)
addPropertyColumn(String)
,
PropertyColumn.withComparator(Comparator)
,
PropertyColumn.withFixedWidth(int)
public PropertyColumn addPropertyColumn(String propertyName, TableCellRenderer renderer)
addPropertyColumn(String)
,
PropertyColumn.withRenderer(javax.swing.table.TableCellRenderer)
public void addPropertyColumn(String propertyName, Class propertyType, TableCellEditor editor)
addPropertyColumn(String)
,
PropertyColumn.withEditor(javax.swing.table.TableCellEditor)
public void addPropertyColumn(String propertyName, Class propertyType, TableCellRenderer renderer)
addPropertyColumn(String)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addPropertyColumn(String propertyName, Class propertyType, int minWidth, int maxWidth)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
public void addPropertyColumn(String propertyName, int width)
addPropertyColumn(String)
,
PropertyColumn.withFixedWidth(int)
public void addPropertyColumn(String propertyName, int width, boolean visible)
addPropertyColumn(String)
,
PropertyColumn.withFixedWidth(int)
,
PropertyColumn.withVisible(boolean)
public void addPropertyColumn(String propertyName, int width, TableCellRenderer renderer, boolean visible)
addPropertyColumn(String)
,
PropertyColumn.withFixedWidth(int)
,
PropertyColumn.withRenderer(TableCellRenderer)
,
PropertyColumn.withVisible(boolean)
public void addPropertyColumn(String propertyName, Class propertyType, int width, TableCellRenderer renderer, boolean visible)
addPropertyColumn(String)
,
PropertyColumn.withFixedWidth(int)
,
PropertyColumn.withRenderer(TableCellRenderer)
,
PropertyColumn.withVisible(boolean)
public void addPropertyColumn(String propertyName, int width, TableCellRenderer renderer)
addPropertyColumn(String)
,
PropertyColumn.withFixedWidth(int)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addPropertyColumn(String propertyName, int minWidth, int maxWidth)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
public void addPropertyColumn(String propertyName, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addPropertyColumn(String propertyName, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer, Comparator comparator)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
,
PropertyColumn.withRenderer(TableCellRenderer)
,
PropertyColumn.withComparator(Comparator)
public void addPropertyColumn(String propertyName, Class propertyType, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addPropertyColumn(String propertyName, Class propertyType, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer, Comparator comparator)
addPropertyColumn(String)
,
PropertyColumn.withComparator(Comparator)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addPropertyColumn(String propertyName, Class propertyType, String[] headerKeys, int minWidth, int maxWidth, boolean resizable, Boolean isInTextFilter)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
public void addPropertyColumn(String propertyName, Class propertyType, String[] headerKeys, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer, Boolean isInTextFilter)
addPropertyColumn(String)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addPropertyColumn(String propertyName, Class propertyType, String[] headerKeys, int minWidth, int maxWidth, boolean resizable, TableCellRenderer renderer, Boolean isInTextFilter, Comparator comparator)
addPropertyColumn(String)
,
PropertyColumn.withComparator(Comparator)
,
PropertyColumn.withMinWidth(int)
,
PropertyColumn.withMaxWidth(int)
,
PropertyColumn.withResizable(boolean)
,
PropertyColumn.withRenderer(TableCellRenderer)
public void addSelectPropertyColumn(String propertyName)
public void addSelectPropertyColumn(String propertyName, Comparator<?> comparator)
public void addSelectPropertyColumn(String propertyName, int width)
public void addSelectPropertyColumn(String propertyName, int minWidth, int maxWidth)
public void addSelectPropertyColumn(String propertyName, int minWidth, int maxWidth, Comparator comparator)
public void addSelectPropertyColumn(String propertyName, String[] headerKeys, int minWidth, int maxWidth, boolean resizable, Comparator comparator)
public void addSelectPropertyColumn(String propertyName, String[] headerKeys, int minWidth, int maxWidth, boolean resizable, Comparator comparator, boolean visible)
public Class<?> getDataType()
getDataType
in interface TableDescription
public Comparator<?> getDefaultComparator()
TableDescription
getDefaultComparator
in interface TableDescription
public void setDefaultComparator(Comparator<?> defaultComparator)
public boolean hasSelectColumn()
hasSelectColumn
in interface TableDescription
public String[] getPropertiesInTextFilter()
getPropertiesInTextFilter
in interface TableDescription
public int getColumnCount()
getColumnCount
in interface TableDescription
public Object getValue(Object rowObject, int propertyIndex)
getValue
in interface TableDescription
public void setValue(Object rowObject, int propertyIndex, Object newValue)
setValue
in interface TableDescription
public String getHeader(int propertyIndex)
TableDescription
getHeader
in interface TableDescription
public Class getType(int propertyIndex)
getType
in interface TableDescription
public int getMinColumnWidth(int propertyIndex)
TableDescription
getMinColumnWidth
in interface TableDescription
public int getMaxColumnWidth(int propertyIndex)
TableDescription
getMaxColumnWidth
in interface TableDescription
public boolean isResizable(int propertyIndex)
TableDescription
isResizable
in interface TableDescription
public boolean isVisible(int propertyIndex)
isVisible
in interface TableDescription
public TableCellRenderer getColumnRenderer(int propertyIndex)
TableDescription
getColumnRenderer
in interface TableDescription
public TableCellEditor getColumnEditor(int propertyIndex)
TableDescription
getColumnEditor
in interface TableDescription
public boolean isSelectColumn(int propertyIndex)
TableDescription
isSelectColumn
in interface TableDescription
public Comparator getColumnComparator(int propertyIndex)
TableDescription
getColumnComparator
in interface TableDescription
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |