|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jaret.util.ui.table.model.DefaultTableViewState
public class DefaultTableViewState
Default implementation of a TableViewState for the jaret table.
Nested Class Summary | |
---|---|
class |
DefaultTableViewState.ColumnConfiguration
Simple helper class holding the onfiguration information for a column. |
class |
DefaultTableViewState.RowConfiguration
Simple helper class holding the configuration for a row. |
Nested classes/interfaces inherited from interface de.jaret.util.ui.table.model.ITableViewState |
---|
ITableViewState.ColumnResizeMode, ITableViewState.HAlignment, ITableViewState.RowHeightMode, ITableViewState.VAlignment |
Field Summary | |
---|---|
protected ICellStyleProvider |
_cellStyleProvider
the cell style provider used. |
protected java.util.Map<IColumn,DefaultTableViewState.ColumnConfiguration> |
_colConfigurations
map of column configurations. |
protected ITableViewState.ColumnResizeMode |
_columnResizeMode
The colummn resize mode used by the table. |
protected int |
_defaultColumnWidth
|
protected int |
_defaultRowHeight
|
protected ITableViewState.RowHeightMode |
_defaultRowHeightMode
Default row height mode for new rows. |
protected java.util.List<ITableViewStateListener> |
_listeners
listener list for the tableviewstate listeners. |
protected int |
_maximalColumnWidth
|
protected int |
_maximalRowHeight
|
protected int |
_minimalColumnWidth
|
protected int |
_minimalRowHeight
|
protected java.util.Map<IRow,DefaultTableViewState.RowConfiguration> |
_rowConfiguations
map of row configurations. |
protected java.util.List<IColumn> |
_sortedColumns
the sorted list (for display) of columns. |
Constructor Summary | |
---|---|
DefaultTableViewState()
Constructor. |
Method Summary | |
---|---|
void |
addTableViewStateListener(ITableViewStateListener tvsl)
Add a listener to be informed about changes on the viewstate. |
void |
cellStyleChanged(IRow row,
IColumn column,
ICellStyle style)
Will be called whenever a style changed. |
boolean |
columnResizingAllowed(IColumn column)
Check whether resizing of a column is allowed. |
protected void |
fireCellStyleChanged(IRow row,
IColumn column,
ICellStyle cellStyle)
|
protected void |
fireColumnOrderChanged()
|
protected void |
fireColumnVisibilityChanged(IColumn column,
boolean visible)
|
protected void |
fireColumnWidthChanged(IColumn column,
int newWidth)
|
protected void |
fireColumnWidthsChanged()
|
protected void |
fireRowHeightChanged(IRow row,
int newHeight)
Inform listeners about a change in the height of a row. |
protected void |
fireRowHeightModeChanged(IRow row,
ITableViewState.RowHeightMode newMode)
|
protected void |
fireSortingChanged()
|
ICellStyle |
getCellStyle(IRow row,
IColumn column)
Retrieve the cell style for a specified cell. |
ICellStyleProvider |
getCellStyleProvider()
Retrieve the cell style provider of the viewstate. |
ITableViewState.ColumnResizeMode |
getColumnResizeMode()
Retrieve the mode used when resizing a column. |
boolean |
getColumnSortingDirection(IColumn column)
Retrieve the sorting direction for a column. |
int |
getColumnSortingPosition(IColumn column)
Retrieve the position in the sorting order set. |
boolean |
getColumnVisible(IColumn column)
Check whether a column is visible. |
int |
getColumnWidth(IColumn column)
retrive the width of a column. |
int |
getMinimalColWidth()
Retrieve the minimum column width. |
int |
getMinimalRowHeight()
Get the configured minimal row heigth. |
int |
getRowHeight(IRow row)
Retrieve the current height of a row. |
ITableViewState.RowHeightMode |
getRowHeightMode()
Retrieve the default row heigth mode. |
ITableViewState.RowHeightMode |
getRowHeigthMode(IRow row)
Retrieve the row heigth mode for a specific row. |
java.util.List<IColumn> |
getSortedColumns()
Retrieve the list of columns in their display order. |
void |
removeTableViewStateListener(ITableViewStateListener tvsl)
Remove a listener from the viewstate. |
void |
setCellStyleProvider(ICellStyleProvider cellStyleProvider)
|
void |
setColumnResizeMode(ITableViewState.ColumnResizeMode columnResizeMode)
Set the mode to use when the size of a column changes. |
void |
setColumnResizingAllowed(IColumn column,
boolean resizingAllowed)
Set whether resizing a column is allowed. |
void |
setColumnVisible(IColumn column,
boolean visible)
Set the visibility of a column. |
void |
setColumnVisible(java.lang.String columnId,
boolean visible)
Set the visibility of a column. |
void |
setColumnWidth(IColumn column,
int width)
Set the width of a column. |
void |
setMinimalColWidth(int minimalColumnWidth)
Set the minimum col width. |
void |
setMinimalRowHeight(int minimalRowHeight)
Set the minimal row height. |
void |
setRowHeight(int height)
Set the row height for ALL rows. |
void |
setRowHeight(IRow row,
int height)
Set the height of a row. |
void |
setRowHeightMode(IRow row,
ITableViewState.RowHeightMode mode)
Set the row height mode for a specific row. |
void |
setRowHeightMode(ITableViewState.RowHeightMode mode)
Set the row heigth mode for all rows and the mode to use as the default for new rows. |
void |
setSortedColumns(java.util.List<IColumn> sortedColumns)
Set the order of the columns. |
void |
setSorting(IColumn column)
Handle the slection of a column for sorting (handle a click). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<IRow,DefaultTableViewState.RowConfiguration> _rowConfiguations
protected java.util.Map<IColumn,DefaultTableViewState.ColumnConfiguration> _colConfigurations
protected java.util.List<ITableViewStateListener> _listeners
protected int _minimalRowHeight
protected int _maximalRowHeight
protected int _defaultRowHeight
protected int _minimalColumnWidth
protected int _maximalColumnWidth
protected int _defaultColumnWidth
protected java.util.List<IColumn> _sortedColumns
protected ICellStyleProvider _cellStyleProvider
protected ITableViewState.ColumnResizeMode _columnResizeMode
protected ITableViewState.RowHeightMode _defaultRowHeightMode
Constructor Detail |
---|
public DefaultTableViewState()
Method Detail |
---|
public int getRowHeight(IRow row)
getRowHeight
in interface ITableViewState
row
- row to query the height for.
public void setRowHeight(IRow row, int height)
setRowHeight
in interface ITableViewState
row
- rowheight
- heightpublic void setRowHeight(int height)
setRowHeight
in interface ITableViewState
height
- heightpublic ITableViewState.RowHeightMode getRowHeigthMode(IRow row)
getRowHeigthMode
in interface ITableViewState
row
- row to get the heigth mode for
public void setRowHeightMode(IRow row, ITableViewState.RowHeightMode mode)
setRowHeightMode
in interface ITableViewState
row
- row to set the height mode formode
- mode to set.public void setRowHeightMode(ITableViewState.RowHeightMode mode)
setRowHeightMode
in interface ITableViewState
mode
- mode to be used.public ITableViewState.RowHeightMode getRowHeightMode()
getRowHeightMode
in interface ITableViewState
public int getColumnWidth(IColumn column)
getColumnWidth
in interface ITableViewState
column
- column
public void setColumnWidth(IColumn column, int width)
setColumnWidth
in interface ITableViewState
column
- columnwidth
- width in pixelpublic boolean getColumnVisible(IColumn column)
getColumnVisible
in interface ITableViewState
column
- column
public void setColumnVisible(IColumn column, boolean visible)
setColumnVisible
in interface ITableViewState
column
- columnvisible
- true for visiblepublic void setColumnVisible(java.lang.String columnId, boolean visible)
setColumnVisible
in interface ITableViewState
columnId
- id of the columnvisible
- true for visiblepublic java.util.List<IColumn> getSortedColumns()
getSortedColumns
in interface ITableViewState
public void setSortedColumns(java.util.List<IColumn> sortedColumns)
setSortedColumns
in interface ITableViewState
sortedColumns
- ordered list of columnspublic int getColumnSortingPosition(IColumn column)
getColumnSortingPosition
in interface ITableViewState
column
- column
public boolean getColumnSortingDirection(IColumn column)
getColumnSortingDirection
in interface ITableViewState
column
- column to check the sorting direction
public void setSorting(IColumn column)
setSorting
in interface ITableViewState
column
- column to add to the sorting (or to reverse its sorting direction)public void addTableViewStateListener(ITableViewStateListener tvsl)
addTableViewStateListener
in interface ITableViewState
tvsl
- listener to addpublic void removeTableViewStateListener(ITableViewStateListener tvsl)
removeTableViewStateListener
in interface ITableViewState
tvsl
- listener to be removedprotected void fireRowHeightChanged(IRow row, int newHeight)
row
- rownewHeight
- new row heightprotected void fireRowHeightModeChanged(IRow row, ITableViewState.RowHeightMode newMode)
protected void fireColumnWidthChanged(IColumn column, int newWidth)
protected void fireColumnWidthsChanged()
protected void fireColumnVisibilityChanged(IColumn column, boolean visible)
protected void fireSortingChanged()
protected void fireColumnOrderChanged()
protected void fireCellStyleChanged(IRow row, IColumn column, ICellStyle cellStyle)
public int getMinimalRowHeight()
getMinimalRowHeight
in interface ITableViewState
public void setMinimalRowHeight(int minimalRowHeight)
setMinimalRowHeight
in interface ITableViewState
minimalRowHeight
- value to setpublic int getMinimalColWidth()
getMinimalColWidth
in interface ITableViewState
public void setMinimalColWidth(int minimalColumnWidth)
setMinimalColWidth
in interface ITableViewState
minimalColumnWidth
- width a column can be minimal sized topublic ICellStyleProvider getCellStyleProvider()
getCellStyleProvider
in interface ITableViewState
public void setCellStyleProvider(ICellStyleProvider cellStyleProvider)
public ICellStyle getCellStyle(IRow row, IColumn column)
getCellStyle
in interface ITableViewState
row
- row of the cellcolumn
- column of the cell
public void cellStyleChanged(IRow row, IColumn column, ICellStyle style)
cellStyleChanged
in interface ICellStyleListener
row
- rowcolumn
- columnstyle
- changed stylepublic boolean columnResizingAllowed(IColumn column)
columnResizingAllowed
in interface ITableViewState
column
- column
public void setColumnResizingAllowed(IColumn column, boolean resizingAllowed)
setColumnResizingAllowed
in interface ITableViewState
column
- columnresizingAllowed
- true for allow resizingpublic ITableViewState.ColumnResizeMode getColumnResizeMode()
ITableViewState
getColumnResizeMode
in interface ITableViewState
public void setColumnResizeMode(ITableViewState.ColumnResizeMode columnResizeMode)
ITableViewState
setColumnResizeMode
in interface ITableViewState
columnResizeMode
- The columnResizeMode to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |