com.google.gwt.user.client.ui
Class HTMLTable.CellFormatter

java.lang.Object
  extended bycom.google.gwt.user.client.ui.HTMLTable.CellFormatter
Direct Known Subclasses:
FlexTable.FlexCellFormatter
Enclosing class:
HTMLTable

public class HTMLTable.CellFormatter
extends Object

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


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
HTMLTable.CellFormatter()
           
 
Method Summary
 void addStyleName(int row, int column, String styleName)
          Adds a style to the specified cell.
protected  Element ensureElement(int row, int column)
          Gets the element associated with a cell.
protected  String getAttr(int row, int column, String attr)
          Convenience methods to get an attribute on a cell.
 Element getElement(int row, int column)
          Gets the TD element representing the specified cell.
 String getStyleName(int row, int column)
          Gets a style from a specified row.
 void removeStyleName(int row, int column, String styleName)
          Removes a style from the specified cell.
 void setAlignment(int row, int column, HasHorizontalAlignment.HorizontalAlignmentConstant hAlign, HasVerticalAlignment.VerticalAlignmentConstant vAlign)
          Sets the horizontal and vertical alignment of the specified cell's contents.
protected  void setAttr(int row, int column, String attrName, String value)
          Convenience methods to set an attribute on a cell.
 void setHeight(int row, int column, String height)
          Sets the height of the specified cell.
 void setHorizontalAlignment(int row, int column, HasHorizontalAlignment.HorizontalAlignmentConstant align)
          Sets the horizontal alignment of the specified cell.
 void setStyleName(int row, int column, String styleName)
          Sets the style name associated with the specified cell.
 void setVerticalAlignment(int row, int column, HasVerticalAlignment.VerticalAlignmentConstant align)
          Sets the vertical alignment of the specified cell.
 void setWidth(int row, int column, String width)
          Sets the width of the specified cell.
 void setWordWrap(int row, int column, boolean wrap)
          Sets whether the specified cell will allow word wrapping of its contents.
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 

Constructor Detail

HTMLTable.CellFormatter

public HTMLTable.CellFormatter()
Method Detail

addStyleName

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

Parameters:
row - the cell's row
column - the cell's column
styleName - the style name to be added
See Also:
UIObject.addStyleName(String)

getElement

public Element getElement(int row,
                          int column)
Gets the TD element representing the specified cell.

Parameters:
row - the row of the cell to be retrieved
column - the column of the cell to be retrieved
Returns:
the column's TD element
Throws:
IndexOutOfBoundsException

getStyleName

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

Parameters:
row - the row of the cell which the style while be added to
column - the column of the cell which the style will be added to
Throws:
IndexOutOfBoundsException
See Also:
UIObject#getStyleName(String)

removeStyleName

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

Parameters:
row - the cell's row
column - the cell's column
styleName - the style name to be removed
Throws:
IndexOutOfBoundsException
See Also:
UIObject.removeStyleName(String)

setAlignment

public void setAlignment(int row,
                         int column,
                         HasHorizontalAlignment.HorizontalAlignmentConstant hAlign,
                         HasVerticalAlignment.VerticalAlignmentConstant vAlign)
Sets the horizontal and vertical alignment of the specified cell's contents.

Parameters:
row - the row of the cell whose alignment is to be set
column - the cell whose alignment is to be set
hAlign - the cell's new horizontal alignment as specified in HasHorizontalAlignment
vAlign - the cell's new vertical alignment as specified in HasVerticalAlignment
Throws:
IndexOutOfBoundsException

setHeight

public void setHeight(int row,
                      int column,
                      String height)
Sets the height of the specified cell.

Parameters:
row - the row of the cell whose height is to be set
column - the cell whose height is to be set
height - the cell's new height, in CSS units
Throws:
IndexOutOfBoundsException

setHorizontalAlignment

public void setHorizontalAlignment(int row,
                                   int column,
                                   HasHorizontalAlignment.HorizontalAlignmentConstant align)
Sets the horizontal alignment of the specified cell.

Parameters:
row - the row of the cell whose alignment is to be set
column - the cell whose alignment is to be set
align - the cell's new horizontal alignment as specified in HasHorizontalAlignment.
Throws:
IndexOutOfBoundsException

setStyleName

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

Parameters:
row - the row of the cell whose style name is to be set
column - the column of the cell whose style name is to be set
styleName - the new style name
Throws:
IndexOutOfBoundsException
See Also:
UIObject.setStyleName(String)

setVerticalAlignment

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

Parameters:
row - the row of the cell whose alignment is to be set
column - the cell whose alignment is to be set
align - the cell's new vertical alignment as specified in HasVerticalAlignment.
Throws:
IndexOutOfBoundsException

setWidth

public void setWidth(int row,
                     int column,
                     String width)
Sets the width of the specified cell.

Parameters:
row - the row of the cell whose width is to be set
column - the cell whose width is to be set
width - the cell's new width, in CSS units
Throws:
IndexOutOfBoundsException

setWordWrap

public void setWordWrap(int row,
                        int column,
                        boolean wrap)
Sets whether the specified cell will allow word wrapping of its contents.

Parameters:
row - the row of the cell whose word-wrap is to be set
column - the cell whose word-wrap is to be set
wrap - false to disable word wrapping in this cell
Throws:
IndexOutOfBoundsException

ensureElement

protected Element ensureElement(int row,
                                int column)
Gets the element associated with a cell. If it does not exist and the subtype allows creation of elements, creates it.

Parameters:
row - the cell's row
column - the cell's column
Returns:
the cell's element
Throws:
IndexOutOfBoundsException

getAttr

protected String getAttr(int row,
                         int column,
                         String attr)
Convenience methods to get an attribute on a cell.

Parameters:
row - cell's row
column - cell's column
attr - attribute to get
Returns:
the attribute's value
Throws:
IndexOutOfBoundsException

setAttr

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

Parameters:
row - cell's row
column - cell's column
value - value to set
Throws:
IndexOutOfBoundsException


This javadoc distribution was not produced by Google. The official documentation is here.