Google Web Toolkit (Beta)
Search this site:

# Class HTMLTable.RowFormatter

public class HTMLTable.RowFormatter
extends Object
This class contains methods used to format a table's rows.

## Methods

addStyleName(int, String) | Adds a style to the specified row.
ensureElement(int) | Ensure the TR element representing the specified row exists for subclasses that allow dynamic addition of elements.
getElement(int) | Gets the TR element representing the specified row.
getRow(Element, int) |
getStyleName(int) | Gets a style from a specified row.
isVisible(int) | Determines whether or not this row is visible via the display style attribute.
removeStyleName(int, String) | Removes a style from the specified row.
setAttr(int, String, String) | Convenience methods to set an attribute on a row.
setStyleName(int, String) | Sets the style name associated with the specified row.
setVerticalAlign(int, HasVerticalAlignment.VerticalAlignmentConstant) | Sets the vertical alignment of the specified row.
setVisible(int, boolean) | Sets whether this row is visible.

## Method Detail

### addStyleName

public void addStyleName(int row, String styleName)
Adds a style to the specified row.

#### Parameters

row
  the row to which the style while be added
styleName
  the style name to be added

#### See Also

UIObject.addStyleName(String)

### ensureElement

protected Element ensureElement(int row)
Ensure the TR element representing the specified row exists for subclasses that allow dynamic addition of elements.

#### Parameters

row
  the row whose TR element is to be retrieved

#### Return Value

the row's TR element

### getElement

public Element getElement(int row)
Gets the TR element representing the specified row.

#### Parameters

row
  the row whose TR element is to be retrieved

#### Return Value

the row's TR element

### getRow

protected Element getRow(Element elem, int row)

#### Parameters

elem
row

### getStyleName

public String getStyleName(int row)
Gets a style from a specified row.

#### Parameters

row
  the row to which the style while be added

#### Return Value

the style name

#### See Also

UIObject.getStyleName()

### isVisible

public boolean isVisible(int row)
Determines whether or not this row is visible via the display style attribute.

#### Parameters

row
  the row whose visibility is to be set

#### Return Value

`true` if the row is visible

### removeStyleName

public void removeStyleName(int row, String styleName)
Removes a style from the specified row.

#### Parameters

row
  the row to which the style while be removed
styleName
  the style name to be removed

#### See Also

UIObject.removeStyleName(String)

### setAttr

protected void setAttr(int row, String attrName, String value)
Convenience methods to set an attribute on a row.

#### Parameters

row
  cell's row
attrName
  attribute to set
value
  value to set

### setStyleName

public void setStyleName(int row, String styleName)
Sets the style name associated with the specified row.

#### Parameters

row
  the row whose style name is to be set
styleName
  the new style name

#### See Also

UIObject.setStyleName(String)

### setVerticalAlign

public void setVerticalAlign(int row, HasVerticalAlignment.VerticalAlignmentConstant align)
Sets the vertical alignment of the specified row.

#### Parameters

row
  the row whose alignment is to be set
align
  the row's new vertical alignment as specified in HasVerticalAlignment

### setVisible

public void setVisible(int row, boolean visible)
Sets whether this row is visible.

#### Parameters

row
  the row whose visibility is to be set
visible
  `true` to show the row, `false` to hide it