|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.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 ITableViewStaterow - row to query the height for.
public void setRowHeight(IRow row,
int height)
setRowHeight in interface ITableViewStaterow - rowheight - heightpublic void setRowHeight(int height)
setRowHeight in interface ITableViewStateheight - heightpublic ITableViewState.RowHeightMode getRowHeigthMode(IRow row)
getRowHeigthMode in interface ITableViewStaterow - row to get the heigth mode for
public void setRowHeightMode(IRow row,
ITableViewState.RowHeightMode mode)
setRowHeightMode in interface ITableViewStaterow - row to set the height mode formode - mode to set.public void setRowHeightMode(ITableViewState.RowHeightMode mode)
setRowHeightMode in interface ITableViewStatemode - mode to be used.public ITableViewState.RowHeightMode getRowHeightMode()
getRowHeightMode in interface ITableViewStatepublic int getColumnWidth(IColumn column)
getColumnWidth in interface ITableViewStatecolumn - column
public void setColumnWidth(IColumn column,
int width)
setColumnWidth in interface ITableViewStatecolumn - columnwidth - width in pixelpublic boolean getColumnVisible(IColumn column)
getColumnVisible in interface ITableViewStatecolumn - column
public void setColumnVisible(IColumn column,
boolean visible)
setColumnVisible in interface ITableViewStatecolumn - columnvisible - true for visible
public void setColumnVisible(java.lang.String columnId,
boolean visible)
setColumnVisible in interface ITableViewStatecolumnId - id of the columnvisible - true for visiblepublic java.util.List<IColumn> getSortedColumns()
getSortedColumns in interface ITableViewStatepublic void setSortedColumns(java.util.List<IColumn> sortedColumns)
setSortedColumns in interface ITableViewStatesortedColumns - ordered list of columnspublic int getColumnSortingPosition(IColumn column)
getColumnSortingPosition in interface ITableViewStatecolumn - column
public boolean getColumnSortingDirection(IColumn column)
getColumnSortingDirection in interface ITableViewStatecolumn - column to check the sorting direction
public void setSorting(IColumn column)
setSorting in interface ITableViewStatecolumn - column to add to the sorting (or to reverse its sorting direction)public void addTableViewStateListener(ITableViewStateListener tvsl)
addTableViewStateListener in interface ITableViewStatetvsl - listener to addpublic void removeTableViewStateListener(ITableViewStateListener tvsl)
removeTableViewStateListener in interface ITableViewStatetvsl - listener to be removed
protected void fireRowHeightChanged(IRow row,
int newHeight)
row - rownewHeight - new row height
protected 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 ITableViewStatepublic void setMinimalRowHeight(int minimalRowHeight)
setMinimalRowHeight in interface ITableViewStateminimalRowHeight - value to setpublic int getMinimalColWidth()
getMinimalColWidth in interface ITableViewStatepublic void setMinimalColWidth(int minimalColumnWidth)
setMinimalColWidth in interface ITableViewStateminimalColumnWidth - width a column can be minimal sized topublic ICellStyleProvider getCellStyleProvider()
getCellStyleProvider in interface ITableViewStatepublic void setCellStyleProvider(ICellStyleProvider cellStyleProvider)
public ICellStyle getCellStyle(IRow row,
IColumn column)
getCellStyle in interface ITableViewStaterow - row of the cellcolumn - column of the cell
public void cellStyleChanged(IRow row,
IColumn column,
ICellStyle style)
cellStyleChanged in interface ICellStyleListenerrow - rowcolumn - columnstyle - changed stylepublic boolean columnResizingAllowed(IColumn column)
columnResizingAllowed in interface ITableViewStatecolumn - column
public void setColumnResizingAllowed(IColumn column,
boolean resizingAllowed)
setColumnResizingAllowed in interface ITableViewStatecolumn - columnresizingAllowed - true for allow resizingpublic ITableViewState.ColumnResizeMode getColumnResizeMode()
ITableViewState
getColumnResizeMode in interface ITableViewStatepublic void setColumnResizeMode(ITableViewState.ColumnResizeMode columnResizeMode)
ITableViewState
setColumnResizeMode in interface ITableViewStatecolumnResizeMode - The columnResizeMode to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||