DataObject representing the column header. The header cell contains all the properties common to cells in the same
column.
| Method from org.displaytag.model.HeaderCell Detail: |
public void addCell(Column column) {
// Not actually going to hold a reference to the added cell - we just need access for the totals
if (this.totaled)
{
try
{
Object val = column.getValue(false);
addToTotal(val);
}
catch (ObjectLookupException e)
{
throw new RuntimeException(e);
}
catch (DecoratorException e)
{
throw new RuntimeException(e);
}
}
}
Add a new cell to this column. |
public void addHeaderClass(String cssClass) {
// null safe
if (StringUtils.isBlank(cssClass))
{
return;
}
// if headerAttributes has not been set, instantiates a new map
if (headerAttributes == null)
{
headerAttributes = new HtmlAttributeMap();
}
Object classAttributes = this.headerAttributes.get(TagConstants.ATTRIBUTE_CLASS);
// handle multiple values
if (classAttributes == null)
{
this.headerAttributes.put(TagConstants.ATTRIBUTE_CLASS, new MultipleHtmlAttribute(cssClass));
}
else
{
((MultipleHtmlAttribute) classAttributes).addAttributeValue(cssClass);
}
}
Adds a css class to the html "class" attribute. |
public String getBeanPropertyName() {
return this.beanPropertyName;
}
Getter for the name of the property to look up in the bean. |
public String getCloseTag() {
return TagConstants.TAG_OPENCLOSING + TagConstants.TAGNAME_COLUMN + TagConstants.TAG_CLOSE;
}
return the closing tag for a cell (td). |
public DisplaytagColumnDecorator[] getColumnDecorators() {
return this.columnDecorators != null ? this.columnDecorators : new DisplaytagColumnDecorator[0];
}
Returns the columnDecorator object for this column. |
public int getColumnNumber() {
return this.columnNumber;
}
Getter for the column number. |
public Comparator getComparator() {
return this.comparator;
}
Get the comparator for sorting this column. |
public SortOrderEnum getDefaultSortOrder() {
return this.defaultSortOrder;
}
Sets the default sort order for this column |
public int getGroup() {
return this.group;
}
getter for the grouping index. |
public HtmlAttributeMap getHeaderAttributes() {
return this.headerAttributes;
}
returns the HtmlAttributeMap containg all the html attributes for the th tag. |
public String getHeaderCloseTag() {
return TagConstants.TAG_OPENCLOSING + TagConstants.TAGNAME_COLUMN_HEADER + TagConstants.TAG_CLOSE;
}
return the closing tag for a column header (th). |
public String getHeaderOpenTag() {
return HtmlTagUtil.createOpenTagString(TagConstants.TAGNAME_COLUMN_HEADER, this.headerAttributes);
}
return the open tag for a column header (th). |
public Href getHref() {
return this.href;
}
Getter for the href to be used for dinamic links in cells. |
public HtmlAttributeMap getHtmlAttributes() {
return this.htmlAttributes;
}
Returns the HtmlAttributeMap containg all the html attributes for the td tags. |
public int getMaxLength() {
return this.maxLength;
}
getter for the max number of characters to display in the column. |
public int getMaxWords() {
return this.maxWords;
}
getter for the max number of words to display in the column. |
public String getParamName() {
return this.paramName;
}
Getter for the name of the param to add to links. |
public String getParamProperty() {
return this.paramProperty;
}
Getter for the name of the property to look up in bean to get the param value for links. |
public boolean getShowNulls() {
return this.showNulls;
}
Should null be displayed? |
public String getSortName() {
return sortName;
}
Get name given to server for sorting this column |
public String getSortProperty() {
return this.sortPropertyName;
}
Getter for the name of the property in the bean which will be used for sorting. |
public boolean getSortable() {
return this.sortable;
}
|
public String getTitle() {
if (this.title != null)
{
return this.title;
}
else if (this.beanPropertyName != null)
{
return StringUtils.capitalize(this.beanPropertyName);
}
return TagConstants.EMPTY_STRING;
}
|
public double getTotal() {
return this.total;
}
|
public boolean isAlreadySorted() {
return this.alreadySorted;
}
Is the column already sorted? |
public boolean isTotaled() {
return totaled;
}
Will we be keeping a total for this column? |
public void setAlreadySorted() {
this.alreadySorted = true;
}
Setter for the sorted property (the column is actually sorted). |
public void setBeanPropertyName(String propertyName) {
this.beanPropertyName = propertyName;
}
Setter for the name of the property to look up in the bean. |
public void setColumnDecorators(DisplaytagColumnDecorator[] decorator) {
this.columnDecorators = decorator;
}
Sets the columnDecorator object for this column. |
public void setColumnNumber(int number) {
this.columnNumber = number;
}
Setter for the column number. |
public void setComparator(Comparator columnComparator) {
this.comparator = columnComparator;
}
Set the column comparator. |
public void setDefaultSortOrder(SortOrderEnum order) {
this.defaultSortOrder = order;
}
Gets the default sort order for this column |
public void setGroup(int groupingOrder) {
this.group = groupingOrder;
}
setter for the grouping index. |
public void setHeaderAttributes(HtmlAttributeMap attributes) {
this.headerAttributes = attributes;
}
Sets the HtmlAttributeMap containg all the html attributes for the th tag. |
public void setHref(Href baseHref) {
this.href = baseHref;
}
Setter for the href to be used for dinamic links in cells. |
public void setHtmlAttributes(HtmlAttributeMap attributes) {
this.htmlAttributes = attributes;
}
Sets the HtmlAttributeMap containg all the html attributes for the td tags. |
public void setMaxLength(int numOfChars) {
this.maxLength = numOfChars;
}
setter for the max number of characters to display in the column. |
public void setMaxWords(int numOfWords) {
this.maxWords = numOfWords;
}
setter for the max number of words to display in the column. |
public void setParamName(String name) {
this.paramName = name;
}
Setter for the name of the param to add to links. |
public void setParamProperty(String property) {
this.paramProperty = property;
}
Setter for the name of the property to look up in bean to get the param value for links. |
public void setShowNulls(boolean outputNulls) {
this.showNulls = outputNulls;
}
Enable or disable displaying of null values. |
public void setSortName(String sortName) {
this.sortName = sortName;
}
Set name given to server for sorting this column |
public void setSortProperty(String propertyName) {
this.sortPropertyName = propertyName;
}
Setter for the name of the property in the bean which will be used for sorting. |
public void setSortable(boolean isSortable) {
this.sortable = isSortable;
}
|
public void setTitle(String value) {
this.title = value;
}
Setter for the column title. |
public void setTotaled(boolean isTotaled) {
this.totaled = isTotaled;
}
|
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
.append("columnNumber", this.columnNumber) //$NON-NLS-1$
.append("title", this.title) //$NON-NLS-1$
.append("beanPropertyName", this.beanPropertyName) //$NON-NLS-1$
.toString();
}
|