Package com.google.gwt.user.client.ui

## Class HTMLTable.RowFormatter

- java.lang.Object
- - com.google.gwt.user.client.ui.HTMLTable.RowFormatter

- Enclosing class:
    HTMLTable

      public class HTMLTable.RowFormatter
      extends java.lang.Object

  This class contains methods used to format a table's rows.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RowFormatter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addStyleName​(int row, java.lang.String styleName)` | Adds a style to the specified row.
    `protected Element` | `ensureElement​(int row)` | Ensure the TR element representing the specified row exists for subclasses that allow dynamic addition of elements.
    `Element` | `getElement​(int row)` | Gets the TR element representing the specified row.
    `protected Element` | `getRow​(Element tbody, int row)` |
    `protected Element` | `getRow​(Element tbody, int row)` | Deprecated. Call and override `getRow(Element, int)` instead.
    `java.lang.String` | `getStyleName​(int row)` | Gets the style of the specified row.
    `java.lang.String` | `getStylePrimaryName​(int row)` | Gets the primary style of the specified row.
    `boolean` | `isVisible​(int row)` | Determines whether or not this row is visible via the display style attribute.
    `void` | `removeStyleName​(int row, java.lang.String styleName)` | Removes a style from the specified row.
    `protected void` | `setAttr​(int row, java.lang.String attrName, java.lang.String value)` | Convenience methods to set an attribute on a row.
    `void` | `setStyleName​(int row, java.lang.String styleName)` | Sets the style name associated with the specified row.
    `void` | `setStylePrimaryName​(int row, java.lang.String styleName)` | Sets the primary style name associated with the specified row.
    `void` | `setVerticalAlign​(int row, HasVerticalAlignment.VerticalAlignmentConstant align)` | Sets the vertical alignment of the specified row.
    `void` | `setVisible​(int row, boolean visible)` | Sets whether this row is visible.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RowFormatter

          public RowFormatter()

  - ### Method Detail

    - #### addStyleName

          public void addStyleName​(int row,
                                   java.lang.String styleName)

      Adds a style to the specified row.
      Parameters:
        `row` - the row to which the style will be added
        `styleName` - the style name to be added
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `UIObject.addStyleName(String)`

    - #### 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
      Returns:
        the row's TR element
      Throws:
        `java.lang.IndexOutOfBoundsException`

    - #### getStyleName

          public java.lang.String getStyleName​(int row)

      Gets the style of the specified row.
      Parameters:
        `row` - the row to be queried
      Returns:
        the style name
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `UIObject.getStyleName()`

    - #### getStylePrimaryName

          public java.lang.String getStylePrimaryName​(int row)

      Gets the primary style of the specified row.
      Parameters:
        `row` - the row to be queried
      Returns:
        the style name
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `UIObject.getStylePrimaryName()`

    - #### 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
      Returns:
        `true` if the row is visible

    - #### removeStyleName

          public void removeStyleName​(int row,
                                      java.lang.String styleName)

      Removes a style from the specified row.
      Parameters:
        `row` - the row from which the style will be removed
        `styleName` - the style name to be removed
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `UIObject.removeStyleName(String)`

    - #### setStyleName

          public void setStyleName​(int row,
                                   java.lang.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
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `UIObject.setStyleName(String)`

    - #### setStylePrimaryName

          public void setStylePrimaryName​(int row,
                                          java.lang.String styleName)

      Sets the primary style name associated with the specified row.
      Parameters:
        `row` - the row whose style name is to be set
        `styleName` - the new style name
      Throws:
        `java.lang.IndexOutOfBoundsException`
      See Also:
        `UIObject.setStylePrimaryName(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`
      Throws:
        `java.lang.IndexOutOfBoundsException`

    - #### 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

    - #### 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
      Returns:
        the row's TR element
      Throws:
        `java.lang.IndexOutOfBoundsException`

    - #### getRow

          protected Element getRow​(Element tbody,
                                   int row)

    - #### getRow

          @Deprecated
          protected Element getRow​(Element tbody,
                                   int row)

      Deprecated.
      Call and override `getRow(Element, int)` instead.

    - #### setAttr

          protected void setAttr​(int row,
                                 java.lang.String attrName,
                                 java.lang.String value)

      Convenience methods to set an attribute on a row.
      Parameters:
        `row` - cell's row
        `attrName` - attribute to set
        `value` - value to set
      Throws:
        `java.lang.IndexOutOfBoundsException`