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

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

public class HierarchyColumn
extends AbstractColumn

Dummy column for placement of the hierarchy.

Version:
$Id: HierarchyColumn.java 1075 2010-12-02 21:46:54Z kliem $
Author:
Peter Kliem

Field Summary
 
Fields inherited from class de.jaret.util.ui.table.model.AbstractColumn
_listeners
 
Constructor Summary
HierarchyColumn()
           
 
Method Summary
 int compare(IRow o1, IRow o2)
          
 boolean displayHeader()
          Header display always defaults to true.
 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.
 void setDisplayHeader(boolean displayHeader)
           
 void setHeaderLabel(java.lang.String headerLabel)
           
 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, fireValueChanged, getContentClass, 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

HierarchyColumn

public HierarchyColumn()
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.

Returns:
unique id.

getHeaderLabel

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

Returns:
header label

setHeaderLabel

public void setHeaderLabel(java.lang.String headerLabel)

displayHeader

public boolean displayHeader()
Header display always defaults to true. 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.

Specified by:
displayHeader in interface IColumn
Overrides:
displayHeader in class AbstractColumn
Returns:
true when a header should be painted

setDisplayHeader

public void setDisplayHeader(boolean displayHeader)

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.

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.

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

compare

public int compare(IRow o1,
                   IRow o2)


isEditable

public boolean isEditable()
Deafult: cols are aditable.

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


Copyright © 2012. All Rights Reserved.