📄 headercell.java
字号:
/**
* Licensed under the Artistic License; you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://displaytag.sourceforge.net/license.html
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
package org.displaytag.model;
import java.util.Comparator;
import org.apache.commons.beanutils.Converter;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.displaytag.decorator.DisplaytagColumnDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.exception.ObjectLookupException;
import org.displaytag.properties.SortOrderEnum;
import org.displaytag.util.Href;
import org.displaytag.util.HtmlAttributeMap;
import org.displaytag.util.HtmlTagUtil;
import org.displaytag.util.MultipleHtmlAttribute;
import org.displaytag.util.TagConstants;
/**
* DataObject representing the column header. The header cell contains all the properties common to cells in the same
* column.
* @author Fabrizio Giustina
* @version $Revision: 987 $ ($Author: fgiust $)
*/
public class HeaderCell
{
/**
* Map containing the html tag attributes for cells (td).
*/
private HtmlAttributeMap htmlAttributes;
/**
* Map containing the html tag attributes for header cells (td).
*/
private HtmlAttributeMap headerAttributes;
/**
* base href for creating dinamic links.
*/
private Href href;
/**
* param name used in adding a link.
*/
private String paramName;
/**
* property of the object where to get the param value from.
*/
private String paramProperty;
/**
* column title.
*/
private String title;
/**
* is the column sortable?
*/
private boolean sortable;
/**
* Name given to the server when sorting this column
*/
private String sortName;
/**
* ColumnDecorators.
*/
private DisplaytagColumnDecorator[] columnDecorators;
/**
* column number.
*/
private int columnNumber;
/**
* is the column sorted?
*/
private boolean alreadySorted;
/**
* property name to look up in the bean.
*/
private String beanPropertyName;
/**
* show null values?
*/
private boolean showNulls;
/**
* max length of cell content.
*/
private int maxLength;
/**
* max number of words for cell content.
*/
private int maxWords;
/**
* group the column?
*/
private int group;
/**
* Name of the non-decorated property used during sorting.
*/
private String sortPropertyName;
/**
* Should we be attempting to tabulate the totals?
*/
private boolean totaled;
/**
* Defalt sort order for this column.
*/
private SortOrderEnum defaultSortOrder;
/**
* The running total for the column.
*/
private double total;
/**
* Use this comparator for sorting.
*/
private Comparator comparator;
/**
* getter for the grouping index.
* @return 0 if the column is not grouped or the grouping order
*/
public int getGroup()
{
return this.group;
}
/**
* setter for the grouping index.
* @param groupingOrder int grouping order (>0)
*/
public void setGroup(int groupingOrder)
{
this.group = groupingOrder;
}
/**
* getter for the max number of characters to display in the column.
* @return int number of characters to display in the column
*/
public int getMaxLength()
{
return this.maxLength;
}
/**
* setter for the max number of characters to display in the column.
* @param numOfChars number of characters to display in the column
*/
public void setMaxLength(int numOfChars)
{
this.maxLength = numOfChars;
}
/**
* getter for the max number of words to display in the column.
* @return int number of words to display in the column
*/
public int getMaxWords()
{
return this.maxWords;
}
/**
* setter for the max number of words to display in the column.
* @param numOfWords number of words to display in the column
*/
public void setMaxWords(int numOfWords)
{
this.maxWords = numOfWords;
}
/**
* Should null be displayed?
* @return true null will be displayed in cell content
*/
public boolean getShowNulls()
{
return this.showNulls;
}
/**
* Enable or disable displaying of null values.
* @param outputNulls boolean true if null should be displayed
*/
public void setShowNulls(boolean outputNulls)
{
this.showNulls = outputNulls;
}
/**
* Getter for the name of the property to look up in the bean.
* @return String name of the property to look up in the bean
*/
public String getBeanPropertyName()
{
return this.beanPropertyName;
}
/**
* Setter for the name of the property to look up in the bean.
* @param propertyName - name of the property to look up in the bean
*/
public void setBeanPropertyName(String propertyName)
{
this.beanPropertyName = propertyName;
}
/**
* Is the column already sorted?
* @return true if the column already sorted
*/
public boolean isAlreadySorted()
{
return this.alreadySorted;
}
/**
* Setter for the sorted property (the column is actually sorted).
*/
public void setAlreadySorted()
{
this.alreadySorted = true;
}
/**
* Getter for the column number.
* @return int column number
*/
public int getColumnNumber()
{
return this.columnNumber;
}
/**
* Setter for the column number.
* @param number - int column number
*/
public void setColumnNumber(int number)
{
this.columnNumber = number;
}
/**
* Returns the columnDecorator object for this column.
* @return DisplaytagColumnDecorator
*/
public DisplaytagColumnDecorator[] getColumnDecorators()
{
return this.columnDecorators != null ? this.columnDecorators : new DisplaytagColumnDecorator[0];
}
/**
* Sets the columnDecorator object for this column.
* @param decorator - the DisplaytagColumnDecorator
*/
public void setColumnDecorators(DisplaytagColumnDecorator[] decorator)
{
this.columnDecorators = decorator;
}
/**
* Is the column sortable?
* @return true if the column is sortable
*/
public boolean getSortable()
{
return this.sortable;
}
/**
* is the column sortable?
* @param isSortable - true if the column can be sorted
*/
public void setSortable(boolean isSortable)
{
this.sortable = isSortable;
}
/**
* Get name given to server for sorting this column
* @return name given to server for sorting this column
*/
public String getSortName()
{
return sortName;
}
/**
* Set name given to server for sorting this column
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -