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_SUFFIXas 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.StringPROTOTYPE_SUFFIX
-
Constructor Summary
Constructors Constructor Description BeanListColumnConfiguration(DecoratedTable<?,?> table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndex(javax.swing.table.TableColumn column)Get the saved index for the table column.java.lang.ObjectgetPrototypeValue(javax.swing.table.TableColumn column)Get the prototype value to use for calculating the column width.java.lang.IntegergetWidth(javax.swing.table.TableColumn column)Get the saved width for the table column.voidsetIndex(javax.swing.table.TableColumn column, int index)Set the saved index for a table column setting.voidsetWidth(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:ColumnConfigurationGet the saved width for the table column.- Specified by:
getWidthin interfaceColumnConfiguration- Parameters:
column- the table column- Returns:
- the saved width or
nullif no width has been saved
-
setWidth
public void setWidth(javax.swing.table.TableColumn column, int width)Description copied from interface:ColumnConfigurationSet the saved width for a table column setting.- Specified by:
setWidthin interfaceColumnConfiguration- Parameters:
column- the table columnwidth- the width to save
-
getIndex
public int getIndex(javax.swing.table.TableColumn column)
Description copied from interface:ColumnConfigurationGet the saved index for the table column.- Specified by:
getIndexin interfaceColumnConfiguration- Parameters:
column- the table column- Returns:
- the saved index or
-1if no index has been saved
-
setIndex
public void setIndex(javax.swing.table.TableColumn column, int index)Description copied from interface:ColumnConfigurationSet the saved index for a table column setting.- Specified by:
setIndexin 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:ColumnConfigurationGet the prototype value to use for calculating the column width.- Specified by:
getPrototypeValuein interfaceColumnConfiguration
-
-