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

All Superinterfaces:
java.util.Comparator<IRow>
All Known Implementing Classes:
AbstractColumn, HierarchyColumn, IndexColumn, PropCol, SimpleColumn

public interface IColumn
extends java.util.Comparator<IRow>

Interface for a column used in a jaret table model. The unique id is only used for storing view state information.

Version:
$Id: IColumn.java 608 2007-10-23 19:24:34Z kliem $
Author:
Peter Kliem

Method Summary
 void addColumnListener(IColumnListener cl)
          Add a listener to listen on changes on the column.
 boolean displayHeader()
          Should return true for a header to be painted.
 java.lang.Class<?> getContentClass()
          To allow null values as column value and to support cell editing and displaying a column may support this method for supplying the information.
 java.lang.Class<?> getContentClass(IRow row)
          To specify a content class per row this method may be implemented to reflect the appropriate class.
 java.lang.String getHeaderLabel()
          Return a textual label to be displayed as the column header label.
 java.lang.String getId()
          Id is used for storing the column width.
 java.lang.Object getValue(IRow row)
          Retrieve the value of the column for the given row.
 boolean isEditable()
          Check whether the column can be edited.
 boolean isEditable(IRow row)
          Check whether a a specific cell of the column can be edited.
 void remColumnListener(IColumnListener cl)
          Remove a column listener.
 void setValue(IRow row, java.lang.Object value)
          Set the value of the coloumn for a given row.
 boolean supportsSorting()
          Check whether the column supports sorting.
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Method Detail

getId

java.lang.String getId()
Id is used for storing the column width. It has to be unique among all columns if the use of the view state persisting support will be used.

Returns:
unique id.

getHeaderLabel

java.lang.String getHeaderLabel()
Return a textual label to be displayed as the column header label.

Returns:
header label

displayHeader

boolean displayHeader()
Should return true for a header to be painted. Note that this ia a small violation of the separation between viewstate and data. However this can be tolerated.

Returns:
true when a header should be painted

getValue

java.lang.Object getValue(IRow row)
Retrieve the value of the column for the given row.

Parameters:
row - the row
Returns:
the column value for the given row.

setValue

void setValue(IRow row,
              java.lang.Object value)
Set the value of the coloumn for a given row.

Parameters:
row - the row
value - value to set

supportsSorting

boolean supportsSorting()
Check whether the column supports sorting.

Returns:
true when sorting is supported.

getContentClass

java.lang.Class<?> getContentClass()
To allow null values as column value and to support cell editing and displaying a column may support this method for supplying the information.

Returns:
the contained class or null if the information is not available.

getContentClass

java.lang.Class<?> getContentClass(IRow row)
To specify a content class per row this method may be implemented to reflect the appropriate class.

Parameters:
row - row of which to get the content class
Returns:
contained class or null if the information is not available.

isEditable

boolean isEditable()
Check whether the column can be edited.

Returns:
true if the values of the columns can be changed

isEditable

boolean isEditable(IRow row)
Check whether a a specific cell of the column can be edited.

Parameters:
row - row specifying the cell in the column
Returns:
true if the ell can be changed

addColumnListener

void addColumnListener(IColumnListener cl)
Add a listener to listen on changes on the column.

Parameters:
cl - listener to add

remColumnListener

void remColumnListener(IColumnListener cl)
Remove a column listener.

Parameters:
cl - listener to remove


Copyright © 2012. All Rights Reserved.