de.jaret.util.ui.table.model
Interface ITableViewState

All Known Subinterfaces:
IHierarchicalTableViewState
All Known Implementing Classes:
DefaultHierarchicalTableViewState, DefaultTableViewState

public interface ITableViewState

View state of a jaret table. The viewstate controls the rendering of the model (i.e. row heights).

Version:
$Id: ITableViewState.java 472 2007-05-22 22:30:07Z olk $
Author:
Peter Kliem

Nested Class Summary
static class ITableViewState.ColumnResizeMode
          Enumeration for the possible resize behaviours: NONE: resize will only have an effect on the resized column SUBSEQUENT: resize will take/give the space from the next visible column (unless minwidth is reached) ALLSUBSEQUENT: resize will take/give the space from all following visible columns (unless minwidth of those is reached) ALL: width is interpreted as a weight; all columns will be resized Recommended mode is NONE since the other modes result in heavy redraw activity.
static class ITableViewState.HAlignment
           
static class ITableViewState.RowHeightMode
          Enumeration for the row height mode of a table row.
static class ITableViewState.VAlignment
           
 
Method Summary
 void addTableViewStateListener(ITableViewStateListener tvsl)
          Add a listener to be informed about changes on the viewstate.
 boolean columnResizingAllowed(IColumn column)
          Check whether resizing of a column is allowed.
 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 setColumnResizeMode(ITableViewState.ColumnResizeMode resizeMode)
          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> columns)
          Set the order of the columns.
 void setSorting(IColumn column)
          Handle the slection of a column for sorting (handle a click).
 

Method Detail

getRowHeight

int getRowHeight(IRow row)
Retrieve the current height of a row.

Parameters:
row - row to query the height for.
Returns:
height in pixel.

setRowHeight

void setRowHeight(IRow row,
                  int height)
Set the height of a row.

Parameters:
row - row
height - height

setRowHeight

void setRowHeight(int height)
Set the row height for ALL rows.

Parameters:
height - height

getMinimalRowHeight

int getMinimalRowHeight()
Get the configured minimal row heigth.

Returns:
minimal row height

setMinimalRowHeight

void setMinimalRowHeight(int minimalRowHeight)
Set the minimal row height.

Parameters:
minimalRowHeight - value to set

getRowHeigthMode

ITableViewState.RowHeightMode getRowHeigthMode(IRow row)
Retrieve the row heigth mode for a specific row.

Parameters:
row - row to get the heigth mode for
Returns:
the row height mode

setRowHeightMode

void setRowHeightMode(IRow row,
                      ITableViewState.RowHeightMode mode)
Set the row height mode for a specific row.

Parameters:
row - row to set the height mode for
mode - mode to set.

setRowHeightMode

void setRowHeightMode(ITableViewState.RowHeightMode mode)
Set the row heigth mode for all rows and the mode to use as the default for new rows.

Parameters:
mode - mode to be used.

getRowHeightMode

ITableViewState.RowHeightMode getRowHeightMode()
Retrieve the default row heigth mode.

Returns:
the default row height mode.

getColumnWidth

int getColumnWidth(IColumn column)
retrive the width of a column.

Parameters:
column - column
Returns:
the width in pixel

setColumnWidth

void setColumnWidth(IColumn column,
                    int width)
Set the width of a column.

Parameters:
column - column
width - width in pixel

getMinimalColWidth

int getMinimalColWidth()
Retrieve the minimum column width.

Returns:
the minimum width a col can be shrinked to

setMinimalColWidth

void setMinimalColWidth(int minimalColumnWidth)
Set the minimum col width.

Parameters:
minimalColumnWidth - width a column can be minimal sized to

getColumnVisible

boolean getColumnVisible(IColumn column)
Check whether a column is visible.

Parameters:
column - column
Returns:
true if the col is visible

setColumnVisible

void setColumnVisible(IColumn column,
                      boolean visible)
Set the visibility of a column.

Parameters:
column - column
visible - true for visible

setColumnVisible

void setColumnVisible(java.lang.String columnID,
                      boolean visible)
Set the visibility of a column.

Parameters:
columnID - id of the column
visible - true for visible

columnResizingAllowed

boolean columnResizingAllowed(IColumn column)
Check whether resizing of a column is allowed.

Parameters:
column - column
Returns:
true if resizing is allowed

setColumnResizingAllowed

void setColumnResizingAllowed(IColumn column,
                              boolean resizingAllowed)
Set whether resizing a column is allowed.

Parameters:
column - column
resizingAllowed - true for allow resizing

getColumnResizeMode

ITableViewState.ColumnResizeMode getColumnResizeMode()
Retrieve the mode used when resizing a column.

Returns:
the current column resizing mode

setColumnResizeMode

void setColumnResizeMode(ITableViewState.ColumnResizeMode resizeMode)
Set the mode to use when the size of a column changes.

Parameters:
resizeMode - the resize mode.

getSortedColumns

java.util.List<IColumn> getSortedColumns()
Retrieve the list of columns in their display order.

Returns:
List of columnsin their display order

setSortedColumns

void setSortedColumns(java.util.List<IColumn> columns)
Set the order of the columns.

Parameters:
columns - ordered list of columns

getColumnSortingPosition

int getColumnSortingPosition(IColumn column)
Retrieve the position in the sorting order set.

Parameters:
column - column
Returns:
position

getColumnSortingDirection

boolean getColumnSortingDirection(IColumn column)
Retrieve the sorting direction for a column.

Parameters:
column - column to check the sorting direction
Returns:
true for ascending, false for descending

setSorting

void setSorting(IColumn column)
Handle the slection of a column for sorting (handle a click).

Parameters:
column - column to add to the sorting (or to reverse its sorting direction)

getCellStyleProvider

ICellStyleProvider getCellStyleProvider()
Retrieve the cell style provider of the viewstate.

Returns:
the cell style provider

getCellStyle

ICellStyle getCellStyle(IRow row,
                        IColumn column)
Retrieve the cell style for a specified cell.

Parameters:
row - row of the cell
column - column of the cell
Returns:
the cellstyle for the cell

addTableViewStateListener

void addTableViewStateListener(ITableViewStateListener tvsl)
Add a listener to be informed about changes on the viewstate.

Parameters:
tvsl - listener to add

removeTableViewStateListener

void removeTableViewStateListener(ITableViewStateListener tvsl)
Remove a listener from the viewstate.

Parameters:
tvsl - listener to be removed


Copyright © 2012. All Rights Reserved.