com.sas.servlet.tbeans.tableview.html
Class BaseTableCell

com.sas.servlet.tbeans.tableview.html.BaseTableCell
All Implemented Interfaces:
HttpConstants, StyleInterface, TableCell, javax.swing.SwingConstants
Direct Known Subclasses:
DefaultOLAPTableDataCellRenderer, DefaultOLAPTableLabelCellRenderer, DefaultTableCellEditor, DefaultTableCellRenderer

public abstract class BaseTableCell
implements TableCell, HttpConstants, StyleInterface

Abstract class for rendering a cell for a TableView.


Field Summary
 
Fields inherited from interface com.sas.servlet.tbeans.HttpConstants
ALL, BASELINE, CHAR, COL, COLGROUP, JUSTIFY, MULTIPLE, NONE, ROW, ROWGROUP, SINGLE
 
Constructor Summary
BaseTableCell()
          Constructs a new BaseTableCell
 
Method Summary
 java.lang.String getBgColor()
          Gets the background color of the cell.
 int getColSpan()
          Gets the number of columns for the cell to span.
 java.lang.String getCustomAttributes()
          Gets the custom attributes
 java.lang.String getHeaders()
          Gets the headers String.
 int getHeight()
          Gets the height of the cell in pixels.
 int getHeightPercentage()
          Gets the height of the cell as a percentage.
 int getHorizontalAlignment()
          Gets the horizontal alignment of the cell.
 java.lang.String getId()
          Gets the id String.
 java.util.Locale getLocale()
          Gets the locale.
 int getRowSpan()
          Gets the number of rows for the cell to span.
 int getScope()
          Gets the scope attribute for the cell.
 StyleInfo getStyleInfo()
          Gets the StyleInfo for this class.
 int getVerticalAlignment()
          Gets the vertical alignment of the cell.
 int getWidth()
          Gets the width of the cell in pixels.
 int getWidthPercentage()
          Gets the width of the cell as a percentage.
 boolean isHeader()
          Returns true if the cell is a header cell.
 boolean isNoWrap()
          Returns true is automatic text wrapping for the cell is disabled.
 void setBgColor(java.lang.String color)
          Sets the background color of the cell.
 void setColSpan(int span)
          Sets the number of columns for the cell to span.
 void setCustomAttributes(java.lang.String value)
          Sets any custom attributes.
 void setHeader(boolean headerCell)
          Sets whether the cell is a header cell.
 void setHeaders(java.lang.String headers)
          Sets the headers String.
 void setHeight(int pixels)
          Sets the height of the cell in pixels.
 void setHeightPercentage(int percentage)
          Sets the height of the cell as a percentage.
 void setHorizontalAlignment(int alignment)
          Sets the horizontal alignment of the cell.
 void setId(java.lang.String id)
          Sets the id String.
 void setLocale(java.util.Locale loc)
          Sets the locale.
 void setNoWrap(boolean nowrap)
          Determines if automatic text wrapping for the cell is disabled.
 void setRowSpan(int span)
          Sets the number of rows for the cell to span.
 void setScope(int newScope)
          Sets the scope attribute for the cell.
 void setStyleInfo(StyleInfo styleInfo)
          Sets the StyleInfo for this class.
 void setVerticalAlignment(int alignment)
          Sets the vertical alignment of the cell.
 void setWidth(int pixels)
          Sets the width of the cell in pixels.
 void setWidthPercentage(int percentage)
          Sets the width of the cell as a percentage.
abstract  void write(java.io.PrintWriter out, AbstractBaseTableView tableview, java.lang.Object value, java.lang.String name, ActionList actions)
          Write the entire table cell in the appropriate markup language.
 void writeBeginCell(java.io.PrintWriter out)
          Writes the begin tag for the table cell in the appropriate markup language.
 void writeEndCell(java.io.PrintWriter out)
          Writes the end tag for the table cell in the appropriate markup language.
 

Constructor Detail

BaseTableCell

public BaseTableCell()
Constructs a new BaseTableCell

Method Detail

setId

public void setId(java.lang.String id)
Sets the id String. This attribute assigns an id to the cell. This id must be unique in a document.

Parameters:
id - the id for the cell

getId

public java.lang.String getId()
Gets the id String. This attribute assigns an id to the cell. This id must be unique in a document.

Returns:
the id for the cell or null if not set

setHeaders

public void setHeaders(java.lang.String headers)
Sets the headers String. This attribute specifies the list of header cells that provide header information for the current data cell. The value of this attribute is a space-separated string of cell names. Those cells must be named by setting their id attribute.

Parameters:
headers - the headers for the cell

getHeaders

public java.lang.String getHeaders()
Gets the headers String. This attribute specifies the list of header cells that provide header information for the current data cell. The value of this attribute is a space-separated string of cell names. Those cells must be named by setting their id attribute.

Returns:
the headers for the cell or null if not set

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the cell. Valid values are: LEFT, CENTER, RIGHT, JUSTIFY, CHAR or NONE. The default is NONE (i.e. the browser default).

Parameters:
alignment - set the horizontal alignment of the cell
Throws:
java.lang.IllegalArgumentException - if alignment is invalid

getHorizontalAlignment

public int getHorizontalAlignment()
Gets the horizontal alignment of the cell. Valid values are: LEFT, CENTER, RIGHT, JUSTIFY, CHAR or NONE. The default is NONE (i.e. the browser default).

Returns:
the horizontal alignment of the cell

setVerticalAlignment

public void setVerticalAlignment(int alignment)
Sets the vertical alignment of the cell. Valid values are: TOP, CENTER, BOTTOM, BASELINE or NONE. The default is NONE (i.e. the browser default).

Parameters:
alignment - set the vertical alignment of the cell
Throws:
java.lang.IllegalArgumentException - if alignment is invalid

getVerticalAlignment

public int getVerticalAlignment()
Gets the vertical alignment of the cell. Valid values are: TOP, CENTER, BOTTOM, BASELINE or NONE. The default is NONE (i.e. the browser default).

Returns:
the vertical alignment of the cell

setColSpan

public void setColSpan(int span)
Sets the number of columns for the cell to span. The default is 1.

Parameters:
span - the number of columns for the cell to span

getColSpan

public int getColSpan()
Gets the number of columns for the cell to span. The default is 1.

Returns:
the number of columns for the cell to span

setRowSpan

public void setRowSpan(int span)
Sets the number of rows for the cell to span. The default is 1.

Parameters:
span - the number of rows for the cell to span

getRowSpan

public int getRowSpan()
Gets the number of rows for the cell to span. The default is 1.

Returns:
the number of rows for the cell to span

setWidth

public void setWidth(int pixels)
Sets the width of the cell in pixels. Overrides the widthPercentage if both values are set.

Parameters:
pixels - the number of pixels wide to set the cell

getWidth

public int getWidth()
Gets the width of the cell in pixels. Overrides the widthPercentage if both values are set. Returns 0 if not set.

Returns:
the width of the cell in pixels

setWidthPercentage

public void setWidthPercentage(int percentage)
Sets the width of the cell as a percentage. If width and widthPercentage are both set, then width overrides the widthPercentage.

Parameters:
percentage - the percentage to set the cell's width

getWidthPercentage

public int getWidthPercentage()
Gets the width of the cell as a percentage. If width and widthPercentage are both set, then width overrides the widthPercentage. Returns 0 if not set.

Returns:
the width of the cell as a percentage

setHeight

public void setHeight(int pixels)
Sets the height of the cell in pixels. Overrides the heightPercentage if both values are set.

Parameters:
pixels - the number of pixels tall to set the cell

getHeight

public int getHeight()
Gets the height of the cell in pixels. Overrides the heightPercentage if both values are set. Returns 0 if not set.

Returns:
the height of the cell in pixels

setHeightPercentage

public void setHeightPercentage(int percentage)
Sets the height of the cell as a percentage. If height and heightPercentage are both set, then height overrides the heightPercentage.

Parameters:
percentage - the percentage to set the cell's height

getHeightPercentage

public int getHeightPercentage()
Gets the height of the cell as a percentage. If height and heightPercentage are both set, then height overrides the heightPercentage. Returns 0 if not set.

Returns:
the height of the cell as a percentage

setNoWrap

public void setNoWrap(boolean nowrap)
Determines if automatic text wrapping for the cell is disabled. If true, then automatic text wrapping is disabled. If used carelessly, this attribute may result in excessively wide cells.

Parameters:
nowrap - determines if automatic text wrapping for the cell is disabled

isNoWrap

public boolean isNoWrap()
Returns true is automatic text wrapping for the cell is disabled.

Returns:
true is automatic text wrapping for the cell is disabled.

setScope

public void setScope(int newScope)
Sets the scope attribute for the cell. This attribute specifies the set of data cells for which the current header cell provides header information. Valid values are: ROW, COL, ROWGROUP, COLGROUP or NONE. The default value is NONE.

Parameters:
scope - the scope attribute for the cell
Throws:
java.lang.IllegalArgumentException - if scope is invalid

getScope

public int getScope()
Gets the scope attribute for the cell. This attribute specifies the set of data cells for which the current header cell provides header information. Valid values are: ROW, COL, ROWGROUP, COLGROUP or NONE. The default value is NONE.

Returns:
the scope attribute for the cell

setBgColor

public void setBgColor(java.lang.String color)
Sets the background color of the cell. This can be a valid html color name such as "blue" or "red". It can also be a valid html rbg value such as "#000000". The bgcolor value is null by default.

Parameters:
color - the background color of the cell

getBgColor

public java.lang.String getBgColor()
Gets the background color of the cell. The bgcolor value is null by default.

Returns:
the background color of the cell

setCustomAttributes

public void setCustomAttributes(java.lang.String value)
Sets any custom attributes. Custom attributes can be passed if the interface does not define properties that create the desired attributes. For example, if a new attribute NEWSTUFF is added in later versions of an HTML specification that attribute can be specified here as NEWSTUFF="value". Any number of attributes can be specified in the string.

Parameters:
value - The custom attribute

getCustomAttributes

public java.lang.String getCustomAttributes()
Gets the custom attributes

Returns:
The custom attributes

getStyleInfo

public StyleInfo getStyleInfo()
Gets the StyleInfo for this class.

Specified by:
getStyleInfo in interface StyleInterface
Returns:
The StyleInfo to be used or null if not set

setStyleInfo

public void setStyleInfo(StyleInfo styleInfo)
Sets the StyleInfo for this class.

Specified by:
setStyleInfo in interface StyleInterface
Parameters:
styleInfo - the StyleInfo to be used

isHeader

public boolean isHeader()
Returns true if the cell is a header cell.

Specified by:
isHeader in interface TableCell
Returns:
true if the cell is a header cell

setHeader

public void setHeader(boolean headerCell)
Sets whether the cell is a header cell.

Specified by:
setHeader in interface TableCell
Parameters:
headerCell - true if the cell is a header cell

write

public abstract void write(java.io.PrintWriter out,
                           AbstractBaseTableView tableview,
                           java.lang.Object value,
                           java.lang.String name,
                           ActionList actions)
                    throws java.io.IOException
Write the entire table cell in the appropriate markup language. This method calls the writeBeginCell and writeEndCell methods.

Specified by:
write in interface TableCell
Parameters:
out - the output stream
tableview - the instance of the tableview being written.
value - the value to display as the cell's contents
name - the name to use for the contents component
actions - an actionlist of all the valid actions for this cell
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeBeginCell

public void writeBeginCell(java.io.PrintWriter out)
                    throws java.io.IOException
Writes the begin tag for the table cell in the appropriate markup language.

Specified by:
writeBeginCell in interface TableCell
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeEndCell

public void writeEndCell(java.io.PrintWriter out)
                  throws java.io.IOException
Writes the end tag for the table cell in the appropriate markup language.

Specified by:
writeEndCell in interface TableCell
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

setLocale

public void setLocale(java.util.Locale loc)
Sets the locale.

Parameters:
loc - an instance of java.util.Locale

getLocale

public java.util.Locale getLocale()
Gets the locale.

Returns:
an instance of java.util.Locale



Copyright © 2009 SAS Institute Inc. All Rights Reserved.