public class HTMLTable.CellFormatter
extends java.lang.Object
Constructor and Description |
---|
CellFormatter() |
Modifier and Type | Method and Description |
---|---|
void |
addStyleName(int row,
int column,
java.lang.String styleName)
Adds a style to the specified cell.
|
protected Element |
ensureElement(int row,
int column)
Gets the element associated with a cell.
|
protected java.lang.String |
getAttr(int row,
int column,
java.lang.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.
|
java.lang.String |
getStyleName(int row,
int column)
Gets the style of a specified cell.
|
java.lang.String |
getStylePrimaryName(int row,
int column)
Gets the primary style of a specified cell.
|
boolean |
isVisible(int row,
int column)
Determines whether or not this cell is visible.
|
void |
removeStyleName(int row,
int column,
java.lang.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,
java.lang.String attrName,
java.lang.String value)
Convenience methods to set an attribute on a cell.
|
void |
setHeight(int row,
int column,
java.lang.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,
java.lang.String styleName)
Sets the style name associated with the specified cell.
|
void |
setStylePrimaryName(int row,
int column,
java.lang.String styleName)
Sets the primary 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 |
setVisible(int row,
int column,
boolean visible)
Sets whether this cell is visible via the display style property.
|
void |
setWidth(int row,
int column,
java.lang.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.
|
public void addStyleName(int row, int column, java.lang.String styleName)
row
- the cell's rowcolumn
- the cell's columnstyleName
- the style name to be addedUIObject.addStyleName(String)
public Element getElement(int row, int column)
row
- the row of the cell to be retrievedcolumn
- the column of the cell to be retrievedjava.lang.IndexOutOfBoundsException
public java.lang.String getStyleName(int row, int column)
row
- the cell's rowcolumn
- the cell's columnjava.lang.IndexOutOfBoundsException
UIObject.getStyleName()
public java.lang.String getStylePrimaryName(int row, int column)
row
- the cell's rowcolumn
- the cell's columnjava.lang.IndexOutOfBoundsException
UIObject.getStylePrimaryName()
public boolean isVisible(int row, int column)
row
- the row of the cell whose visibility is to be setcolumn
- the column of the cell whose visibility is to be settrue
if the object is visiblepublic void removeStyleName(int row, int column, java.lang.String styleName)
row
- the cell's rowcolumn
- the cell's columnstyleName
- the style name to be removedjava.lang.IndexOutOfBoundsException
UIObject.removeStyleName(String)
public void setAlignment(int row, int column, HasHorizontalAlignment.HorizontalAlignmentConstant hAlign, HasVerticalAlignment.VerticalAlignmentConstant vAlign)
row
- the row of the cell whose alignment is to be setcolumn
- the column of the cell whose alignment is to be sethAlign
- the cell's new horizontal alignment as specified in
HasHorizontalAlignment
vAlign
- the cell's new vertical alignment as specified in
HasVerticalAlignment
java.lang.IndexOutOfBoundsException
public void setHeight(int row, int column, java.lang.String height)
row
- the row of the cell whose height is to be setcolumn
- the column of the cell whose height is to be setheight
- the cell's new height, in CSS unitsjava.lang.IndexOutOfBoundsException
public void setHorizontalAlignment(int row, int column, HasHorizontalAlignment.HorizontalAlignmentConstant align)
row
- the row of the cell whose alignment is to be setcolumn
- the column of the cell whose alignment is to be setalign
- the cell's new horizontal alignment as specified in
HasHorizontalAlignment
.java.lang.IndexOutOfBoundsException
public void setStyleName(int row, int column, java.lang.String styleName)
row
- the row of the cell whose style name is to be setcolumn
- the column of the cell whose style name is to be setstyleName
- the new style namejava.lang.IndexOutOfBoundsException
UIObject.setStyleName(String)
public void setStylePrimaryName(int row, int column, java.lang.String styleName)
row
- the row of the cell whose style name is to be setcolumn
- the column of the cell whose style name is to be setstyleName
- the new style namejava.lang.IndexOutOfBoundsException
UIObject.setStylePrimaryName(String)
public void setVerticalAlignment(int row, int column, HasVerticalAlignment.VerticalAlignmentConstant align)
row
- the row of the cell whose alignment is to be setcolumn
- the column of the cell whose alignment is to be setalign
- the cell's new vertical alignment as specified in
HasVerticalAlignment
.java.lang.IndexOutOfBoundsException
public void setVisible(int row, int column, boolean visible)
row
- the row of the cell whose visibility is to be setcolumn
- the column of the cell whose visibility is to be setvisible
- true
to show the cell, false
to
hide itpublic void setWidth(int row, int column, java.lang.String width)
row
- the row of the cell whose width is to be setcolumn
- the column of the cell whose width is to be setwidth
- the cell's new width, in CSS unitsjava.lang.IndexOutOfBoundsException
public void setWordWrap(int row, int column, boolean wrap)
row
- the row of the cell whose word-wrap is to be setcolumn
- the column of the cell whose word-wrap is to be setwrap
- false
to disable word wrapping in this celljava.lang.IndexOutOfBoundsException
protected Element ensureElement(int row, int column)
row
- the cell's rowcolumn
- the cell's columnjava.lang.IndexOutOfBoundsException
protected java.lang.String getAttr(int row, int column, java.lang.String attr)
row
- cell's rowcolumn
- cell's columnattr
- attribute to getjava.lang.IndexOutOfBoundsException
protected void setAttr(int row, int column, java.lang.String attrName, java.lang.String value)
row
- cell's rowcolumn
- cell's columnattrName
- attribute to setvalue
- value to setjava.lang.IndexOutOfBoundsException