Package io.github.jonestimd.swing.table
Class BeanListColumnConfiguration
- java.lang.Object
-
- io.github.jonestimd.swing.table.BeanListColumnConfiguration
-
- All Implemented Interfaces:
ColumnConfiguration
public class BeanListColumnConfiguration extends java.lang.Object implements ColumnConfiguration
Provides column configuration for a table that usesBeanListTableModel
. The configuration values are saved/loaded to System properties. The property names are derived from the class name of the table model and the value returned byColumnAdapter.getColumnId()
. Column prototype values are retrieved usingColumnAdapter.getResource(String, String)
withPROTOTYPE_SUFFIX
as the resource name and the column header value as the default.- See Also:
DecoratedTable
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROTOTYPE_SUFFIX
-
Constructor Summary
Constructors Constructor Description BeanListColumnConfiguration(DecoratedTable<?,?> table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIndex(javax.swing.table.TableColumn column)
Get the saved index for the table column.java.lang.Object
getPrototypeValue(javax.swing.table.TableColumn column)
Get the prototype value to use for calculating the column width.java.lang.Integer
getWidth(javax.swing.table.TableColumn column)
Get the saved width for the table column.void
setIndex(javax.swing.table.TableColumn column, int index)
Set the saved index for a table column setting.void
setWidth(javax.swing.table.TableColumn column, int width)
Set the saved width for a table column setting.
-
-
-
Field Detail
-
PROTOTYPE_SUFFIX
public static final java.lang.String PROTOTYPE_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BeanListColumnConfiguration
public BeanListColumnConfiguration(DecoratedTable<?,?> table)
-
-
Method Detail
-
getWidth
public java.lang.Integer getWidth(javax.swing.table.TableColumn column)
Description copied from interface:ColumnConfiguration
Get the saved width for the table column.- Specified by:
getWidth
in interfaceColumnConfiguration
- Parameters:
column
- the table column- Returns:
- the saved width or
null
if no width has been saved
-
setWidth
public void setWidth(javax.swing.table.TableColumn column, int width)
Description copied from interface:ColumnConfiguration
Set the saved width for a table column setting.- Specified by:
setWidth
in interfaceColumnConfiguration
- Parameters:
column
- the table columnwidth
- the width to save
-
getIndex
public int getIndex(javax.swing.table.TableColumn column)
Description copied from interface:ColumnConfiguration
Get the saved index for the table column.- Specified by:
getIndex
in interfaceColumnConfiguration
- Parameters:
column
- the table column- Returns:
- the saved index or
-1
if no index has been saved
-
setIndex
public void setIndex(javax.swing.table.TableColumn column, int index)
Description copied from interface:ColumnConfiguration
Set the saved index for a table column setting.- Specified by:
setIndex
in interfaceColumnConfiguration
- Parameters:
column
- the table columnindex
- the index to save
-
getPrototypeValue
public java.lang.Object getPrototypeValue(javax.swing.table.TableColumn column)
Description copied from interface:ColumnConfiguration
Get the prototype value to use for calculating the column width.- Specified by:
getPrototypeValue
in interfaceColumnConfiguration
-
-