de.jaret.util.ui.table.model
Class IndexColumn

java.lang.Object
  extended by de.jaret.util.ui.table.model.AbstractColumn
      extended by de.jaret.util.ui.table.model.IndexColumn
All Implemented Interfaces:
IColumn, java.util.Comparator<IRow>

public class IndexColumn
extends AbstractColumn
implements IColumn

A simple column displaying the row index.

Version:
$Id: IndexColumn.java 348 2007-04-07 15:11:12Z olk $
Author:
Peter Kliem

Field Summary
protected  java.lang.String _headerLabel
          haeder label for the column.
protected  JaretTable _table
          table the column is for.
static java.lang.String ID
          id of the index col.
 
Fields inherited from class de.jaret.util.ui.table.model.AbstractColumn
_listeners
 
Constructor Summary
IndexColumn(JaretTable table, java.lang.String headerLabel)
          Construct an index column.
 
Method Summary
 int compare(IRow r1, IRow r2)
          
 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.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()
          Deafult: cols are aditable.
 boolean isEditable(IRow row)
          Default: delegate to isEditable.
 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 class de.jaret.util.ui.table.model.AbstractColumn
addColumnListener, displayHeader, fireValueChanged, getContentClass, remColumnListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.jaret.util.ui.table.model.IColumn
addColumnListener, displayHeader, getContentClass, remColumnListener
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

ID

public static final java.lang.String ID
id of the index col.

See Also:
Constant Field Values

_table

protected JaretTable _table
table the column is for.


_headerLabel

protected java.lang.String _headerLabel
haeder label for the column.

Constructor Detail

IndexColumn

public IndexColumn(JaretTable table,
                   java.lang.String headerLabel)
Construct an index column.

Parameters:
table - table the indexcolumn is used for
headerLabel - hedare label to use
Method Detail

getId

public 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.

Specified by:
getId in interface IColumn
Returns:
unique id.

getHeaderLabel

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

Specified by:
getHeaderLabel in interface IColumn
Returns:
header label

getValue

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

Specified by:
getValue in interface IColumn
Parameters:
row - the row
Returns:
the column value for the given row.

setValue

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

Specified by:
setValue in interface IColumn
Parameters:
row - the row
value - value to set

compare

public int compare(IRow r1,
                   IRow r2)

Specified by:
compare in interface java.util.Comparator<IRow>

supportsSorting

public boolean supportsSorting()
Check whether the column supports sorting.

Specified by:
supportsSorting in interface IColumn
Returns:
true when sorting is supported.

getContentClass

public 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.

Specified by:
getContentClass in interface IColumn
Returns:
the contained class or null if the information is not available.

isEditable

public boolean isEditable()
Deafult: cols are aditable. Never editable.

Specified by:
isEditable in interface IColumn
Overrides:
isEditable in class AbstractColumn
Returns:
true

isEditable

public boolean isEditable(IRow row)
Default: delegate to isEditable. Check whether a a specific cell of the column can be edited. Never editable.

Specified by:
isEditable in interface IColumn
Overrides:
isEditable in class AbstractColumn
Parameters:
row - row specifying the cell in the column
Returns:
true if the ell can be changed


Copyright © 2012. All Rights Reserved.