org.displaytag.model
Class HeaderCell

java.lang.Object
  extended by org.displaytag.model.HeaderCell

public class HeaderCell
extends java.lang.Object

DataObject representing the column header. The header cell contains all the properties common to cells in the same column.

Version:
$Revision: 1135 $ ($Author: fgiust $)
Author:
Fabrizio Giustina

Constructor Summary
HeaderCell()
           
 
Method Summary
 void addCell(Column column)
          Add a new cell to this column.
 void addHeaderClass(java.lang.String cssClass)
          Adds a css class to the html "class" attribute.
 java.lang.String getBeanPropertyName()
          Getter for the name of the property to look up in the bean.
 java.lang.String getCloseTag()
          return the closing tag for a cell (td).
 DisplaytagColumnDecorator[] getColumnDecorators()
          Returns the columnDecorator object for this column.
 int getColumnNumber()
          Getter for the column number.
 java.util.Comparator getComparator()
          Get the comparator for sorting this column.
 SortOrderEnum getDefaultSortOrder()
          Sets the default sort order for this column
 int getGroup()
          getter for the grouping index.
 HtmlAttributeMap getHeaderAttributes()
          returns the HtmlAttributeMap containg all the html attributes for the th tag.
 java.lang.String getHeaderCloseTag()
          return the closing tag for a column header (th).
 java.lang.String getHeaderOpenTag()
          return the open tag for a column header (th).
 Href getHref()
          Getter for the href to be used for dinamic links in cells.
 HtmlAttributeMap getHtmlAttributes()
          Returns the HtmlAttributeMap containg all the html attributes for the td tags.
 int getMaxLength()
          getter for the max number of characters to display in the column.
 int getMaxWords()
          getter for the max number of words to display in the column.
 java.lang.String getParamName()
          Getter for the name of the param to add to links.
 java.lang.String getParamProperty()
          Getter for the name of the property to look up in bean to get the param value for links.
 boolean getShowNulls()
          Should null be displayed?
 boolean getSortable()
          Is the column sortable?
 java.lang.String getSortName()
          Get name given to server for sorting this column
 java.lang.String getSortProperty()
          Getter for the name of the property in the bean which will be used for sorting.
 java.lang.String getTitle()
          Gets the column title.
 double getTotal()
          Get the current total.
 boolean isAlreadySorted()
          Is the column already sorted?
 boolean isTotaled()
          Will we be keeping a total for this column?
 void setAlreadySorted()
          Setter for the sorted property (the column is actually sorted).
 void setBeanPropertyName(java.lang.String propertyName)
          Setter for the name of the property to look up in the bean.
 void setColumnDecorators(DisplaytagColumnDecorator[] decorator)
          Sets the columnDecorator object for this column.
 void setColumnNumber(int number)
          Setter for the column number.
 void setComparator(java.util.Comparator columnComparator)
          Set the column comparator.
 void setDefaultSortOrder(SortOrderEnum order)
          Gets the default sort order for this column
 void setGroup(int groupingOrder)
          setter for the grouping index.
 void setHeaderAttributes(HtmlAttributeMap attributes)
          Sets the HtmlAttributeMap containg all the html attributes for the th tag.
 void setHref(Href baseHref)
          Setter for the href to be used for dinamic links in cells.
 void setHtmlAttributes(HtmlAttributeMap attributes)
          Sets the HtmlAttributeMap containg all the html attributes for the td tags.
 void setMaxLength(int numOfChars)
          setter for the max number of characters to display in the column.
 void setMaxWords(int numOfWords)
          setter for the max number of words to display in the column.
 void setParamName(java.lang.String name)
          Setter for the name of the param to add to links.
 void setParamProperty(java.lang.String property)
          Setter for the name of the property to look up in bean to get the param value for links.
 void setShowNulls(boolean outputNulls)
          Enable or disable displaying of null values.
 void setSortable(boolean isSortable)
          is the column sortable?
 void setSortName(java.lang.String sortName)
          Set name given to server for sorting this column
 void setSortProperty(java.lang.String propertyName)
          Setter for the name of the property in the bean which will be used for sorting.
 void setTitle(java.lang.String value)
          Setter for the column title.
 void setTotaled(boolean isTotaled)
          Setter for totaled.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeaderCell

public HeaderCell()
Method Detail

getGroup

public int getGroup()
getter for the grouping index.

Returns:
0 if the column is not grouped or the grouping order

setGroup

public void setGroup(int groupingOrder)
setter for the grouping index.

Parameters:
groupingOrder - int grouping order (>0)

getMaxLength

public int getMaxLength()
getter for the max number of characters to display in the column.

Returns:
int number of characters to display in the column

setMaxLength

public void setMaxLength(int numOfChars)
setter for the max number of characters to display in the column.

Parameters:
numOfChars - number of characters to display in the column

getMaxWords

public int getMaxWords()
getter for the max number of words to display in the column.

Returns:
int number of words to display in the column

setMaxWords

public void setMaxWords(int numOfWords)
setter for the max number of words to display in the column.

Parameters:
numOfWords - number of words to display in the column

getShowNulls

public boolean getShowNulls()
Should null be displayed?

Returns:
true null will be displayed in cell content

setShowNulls

public void setShowNulls(boolean outputNulls)
Enable or disable displaying of null values.

Parameters:
outputNulls - boolean true if null should be displayed

getBeanPropertyName

public java.lang.String getBeanPropertyName()
Getter for the name of the property to look up in the bean.

Returns:
String name of the property to look up in the bean

setBeanPropertyName

public void setBeanPropertyName(java.lang.String propertyName)
Setter for the name of the property to look up in the bean.

Parameters:
propertyName - - name of the property to look up in the bean

isAlreadySorted

public boolean isAlreadySorted()
Is the column already sorted?

Returns:
true if the column already sorted

setAlreadySorted

public void setAlreadySorted()
Setter for the sorted property (the column is actually sorted).


getColumnNumber

public int getColumnNumber()
Getter for the column number.

Returns:
int column number

setColumnNumber

public void setColumnNumber(int number)
Setter for the column number.

Parameters:
number - - int column number

getColumnDecorators

public DisplaytagColumnDecorator[] getColumnDecorators()
Returns the columnDecorator object for this column.

Returns:
DisplaytagColumnDecorator

setColumnDecorators

public void setColumnDecorators(DisplaytagColumnDecorator[] decorator)
Sets the columnDecorator object for this column.

Parameters:
decorator - - the DisplaytagColumnDecorator

getSortable

public boolean getSortable()
Is the column sortable?

Returns:
true if the column is sortable

setSortable

public void setSortable(boolean isSortable)
is the column sortable?

Parameters:
isSortable - - true if the column can be sorted

getSortName

public java.lang.String getSortName()
Get name given to server for sorting this column

Returns:
name given to server for sorting this column

setSortName

public void setSortName(java.lang.String sortName)
Set name given to server for sorting this column

Parameters:
sortName - name given to server for sorting this column

getTitle

public java.lang.String getTitle()
Gets the column title.

Returns:
the column title. If no title is specified the capitalized bean property name is returned

setTitle

public void setTitle(java.lang.String value)
Setter for the column title.

Parameters:
value - - the column title

getHtmlAttributes

public HtmlAttributeMap getHtmlAttributes()
Returns the HtmlAttributeMap containg all the html attributes for the td tags.

Returns:
HtmlAttributeMap with td attributes

setHtmlAttributes

public void setHtmlAttributes(HtmlAttributeMap attributes)
Sets the HtmlAttributeMap containg all the html attributes for the td tags.

Parameters:
attributes - HtmlAttributeMap

getHeaderAttributes

public HtmlAttributeMap getHeaderAttributes()
returns the HtmlAttributeMap containg all the html attributes for the th tag.

Returns:
HtmlAttributeMap with th attributes

setHeaderAttributes

public void setHeaderAttributes(HtmlAttributeMap attributes)
Sets the HtmlAttributeMap containg all the html attributes for the th tag.

Parameters:
attributes - HtmlAttributeMap

addHeaderClass

public void addHeaderClass(java.lang.String cssClass)
Adds a css class to the html "class" attribute.

Parameters:
cssClass - String

getHeaderOpenTag

public java.lang.String getHeaderOpenTag()
return the open tag for a column header (th).

Returns:
String <th> tag with attributes

getCloseTag

public java.lang.String getCloseTag()
return the closing tag for a cell (td).

Returns:
String </td>

getHeaderCloseTag

public java.lang.String getHeaderCloseTag()
return the closing tag for a column header (th).

Returns:
String </th>

setHref

public void setHref(Href baseHref)
Setter for the href to be used for dinamic links in cells.

Parameters:
baseHref - base href for links

getHref

public Href getHref()
Getter for the href to be used for dinamic links in cells.

Returns:
Href base href for links

setParamName

public void setParamName(java.lang.String name)
Setter for the name of the param to add to links.

Parameters:
name - name of the param

getParamName

public java.lang.String getParamName()
Getter for the name of the param to add to links.

Returns:
String name of the param

setParamProperty

public void setParamProperty(java.lang.String property)
Setter for the name of the property to look up in bean to get the param value for links.

Parameters:
property - name of the property to look up in bean to get the param value for links

getParamProperty

public java.lang.String getParamProperty()
Getter for the name of the property to look up in bean to get the param value for links.

Returns:
String name of the property to look up in bean to get the param value for links

getSortProperty

public java.lang.String getSortProperty()
Getter for the name of the property in the bean which will be used for sorting.

Returns:
String name of the property in the bean which will be used for sorting

setSortProperty

public void setSortProperty(java.lang.String propertyName)
Setter for the name of the property in the bean which will be used for sorting.

Parameters:
propertyName - - name of the property in the bean which will be used for sorting

getDefaultSortOrder

public SortOrderEnum getDefaultSortOrder()
Sets the default sort order for this column

Returns:
default order

setDefaultSortOrder

public void setDefaultSortOrder(SortOrderEnum order)
Gets the default sort order for this column

Parameters:
order - default order

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

setComparator

public void setComparator(java.util.Comparator columnComparator)
Set the column comparator.

Parameters:
columnComparator - the value

getComparator

public java.util.Comparator getComparator()
Get the comparator for sorting this column.

Returns:
the comparator

isTotaled

public boolean isTotaled()
Will we be keeping a total for this column?

Returns:
true if we are totaling

setTotaled

public void setTotaled(boolean isTotaled)
Setter for totaled.

Parameters:
isTotaled - the value

getTotal

public double getTotal()
Get the current total.

Returns:
the current total.

addCell

public void addCell(Column column)
Add a new cell to this column.

Parameters:
column - the value


Copyright © 2002-2010 the Displaytag team. All Rights Reserved.