de.jaret.util.ui.table.model.simple
Class SimpleColumn

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

public class SimpleColumn
extends AbstractColumn

Simple implementation of a column for use in the SimpleJaretTableModel.

Version:
$Id: SimpleColumn.java 180 2007-01-07 18:44:01Z olk $
Author:
kliem

Field Summary
 
Fields inherited from class de.jaret.util.ui.table.model.AbstractColumn
_listeners
 
Constructor Summary
SimpleColumn(int index, SimpleJaretTableModel model)
          Construct a column.
 
Method Summary
 int compare(IRow o1, IRow o2)
           Sorting set null < non-null, non comparables are equal.
 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.
 void setHeaderLabel(java.lang.String label)
          Allow setting of the header label.
 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, isEditable, isEditable, remColumnListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SimpleColumn

public SimpleColumn(int index,
                    SimpleJaretTableModel model)
Construct a column.

Parameters:
index - index
model - table model the column is part of
Method Detail

setHeaderLabel

public void setHeaderLabel(java.lang.String label)
Allow setting of the header label.

Parameters:
label - the label

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. Always assume different classes and rely on the object tht is the value.

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

getHeaderLabel

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

Returns:
header label

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.

Returns:
unique id.

getValue

public 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

public 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

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

Returns:
true when sorting is supported.

compare

public int compare(IRow o1,
                   IRow o2)
Sorting set null < non-null, non comparables are equal.



Copyright © 2012. All Rights Reserved.