* Writes the open <tr> tag.
* @return String <tr> tag with the appropriate css class attribute
*/
public String getOpenTag()
{
Map rowAttributes = new HtmlAttributeMap();
MultipleHtmlAttribute cssAttribute = new MultipleHtmlAttribute(this.tableModel.getProperties().getCssRow(
this.rowNumber));
if (this.tableModel.getTableDecorator() != null)
{
try
{
String addStyle = this.tableModel.getTableDecorator().addRowClass();
if (StringUtils.isNotBlank(addStyle))
{
cssAttribute.addAttributeValue(addStyle);
}
String id = this.tableModel.getTableDecorator().addRowId();
if (StringUtils.isNotBlank(id))
{
rowAttributes.put(TagConstants.ATTRIBUTE_ID, id);
}
}
catch (NoSuchMethodError e)
{
// this catch is here to allow decorators compiled with displaytag 1.0 work with 1.1
// since the addRowClass() and addRowId() are new in displaytag 1.1 earlier decorators could throw
// a NoSuchMethodError... be nice with them till a next major release
}
}
if (!cssAttribute.isEmpty())
{
rowAttributes.put(TagConstants.ATTRIBUTE_CLASS, cssAttribute);
}
StringBuffer tag = new StringBuffer();
tag.append(TagConstants.TAG_OPEN);
tag.append(TagConstants.TAGNAME_ROW);
tag.append(rowAttributes.toString());
tag.append(TagConstants.TAG_CLOSE);
return tag.toString();
}