|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.html.HtmlElement | +--weblogic.html.ElementWithAttributes | +--weblogic.html.MultiPartElement | +--weblogic.html.TableElement
A TableElement is analogous to an HTML table. It is built by adding TableRowElements (which contain TableDataElements) to it. The TableElement class is also used to set general characteristics for constructing tables on an htmlKona page.
Use the addElement() method in this class to add TableRowElements to a TableElement. For example, this shows how to created a nested table by adding TableRowElements to a TableElement tab:
TableElement tab = new TableElement() .setBorder(1) .setCellPadding(5) .setWidth(50%) .setCaption(new StrongElement("Fall Registration Schedule").asItalicElement()); tab.addElement(new TableRowElement() .addElement(new TableHeadingElement(new AnchorElement(AnchorType.name, "topic", "Topic"))) .addElement(new TableHeadingElement("Value").setBgColor(HtmlColor.navy))); tab.addElement(new TableRowElement() .addElement(new TableDataElement(reg.getID()).setVAlign(AlignType.top)) .addElement(new TableDataElement(new TableElement(reg.getMain()) .setCaption(new BoldElement("N1")) .setBorder(1)) .setVAlign(AlignType.top))); page.getBody().addElement(new CenteredElement(tab));and so forth.
When you construct a TableElement with a dbKona DataSet, the Schema of the DataSet is used to construct an HTML table and each Record in the DataSet is automatically displayed as a row in the HTML table. Use a constructor with the boolean "withHeading" set to true to show column names at the top of the table.
Constructors in this class also support table generation with Dictionary and WebLogic ParamSet objects.
This class has variables for the HTML attributes border, caption, cellpadding, cellspacing, width, background image, and background color. Use AlignType objects to set the ALIGN and VALIGN elements. This class also support several browser extensions, including BORDERSTYLE, BACKGROUND, and BGCOLOR.
In compliance with HTML 4.0, TableElement supports the attributes align, bgcolor, width, cols, border, frame, rules, cellspacing, and cellpadding. Other attributes, including id, class, lang, title, etc., are available with methods from its superclass.
TableCaptionElement
,
ColGroupElement
,
TableDataElement
,
TableHeadingElement
,
TableRowElement
,
DataSet
,
Schema
,
ParamSet
Field Summary | |
static int |
default_border
Deprecated. Default border is unset. |
static TableCaptionElement |
default_caption
Deprecated. Default caption is unset. |
static int |
default_cellpadding
Deprecated. Default cellpadding is unset. |
static int |
default_cellspacing
Deprecated. Default cellspacing is unset. |
static java.lang.String |
default_width
Deprecated. Default width is unset. |
Fields inherited from class weblogic.html.HtmlElement |
codeset,
useObsolete |
Constructor Summary | |
TableElement()
Deprecated. Constructs a TableElement object. |
|
TableElement(DataSet ds)
Deprecated. Constructs a TableElement object with a dbKona DataSet as its contents. |
|
TableElement(DataSet ds,
boolean withHeading)
Deprecated. Constructs a TableElement object with a dbKona DataSet as its contents. |
|
TableElement(java.util.Dictionary dictionary)
Deprecated. Constructs a TableElement with a java.util.Dictionary as its contents, sorted by key, with the column headings "Key" and "Value." |
|
TableElement(java.util.Dictionary dictionary,
boolean withHeading)
Deprecated. Constructs a TableElement with a java.util.Dictionary as its contents, sorted by key. |
|
TableElement(java.util.Dictionary dictionary,
boolean withHeading,
boolean sortByKey)
Deprecated. Constructs a TableElement with a java.util.Dictionary as its contents. |
|
TableElement(ParamSet ps)
Deprecated. Constructs a TableElement with a weblogic.common.ParamSet as its contents. |
|
TableElement(ParamSet ps,
boolean withHeading)
Deprecated. Constructs a TableElement with a weblogic.common.ParamSet as its contents. |
|
TableElement(ParamSet ps,
boolean withHeading,
boolean sortByName)
Deprecated. Constructs a TableElement with a weblogic.common.ParamSet as its contents. |
|
TableElement(ParamSet ps,
boolean withHeading,
boolean sortByName,
java.lang.String fontFace)
Deprecated. Constructs a TableElement with a weblogic.common.ParamSet as its contents. |
Method Summary | |
TableElement |
addElement(ColGroupElement cge)
Deprecated. Adds a ColGroupElement to a TableElement. |
TableElement |
addElement(TableRowElement val)
Deprecated. Adds a TableRowElement to a TableElement. |
TableElement |
addElement(TBodyElement tbe)
Deprecated. Adds a TBodyElement to a TableElement. |
TableElement |
addElement(TFootElement tfe)
Deprecated. Adds a TFootElement to a TableElement. |
TableElement |
addElement(THeadElement the)
Deprecated. Adds a THeadElement to a TableElement. |
TableElement |
addRow(int numcols)
Deprecated. Adds a row with the specified number of columns to the TableElement. |
TableCaptionElement |
getCaption()
Deprecated. Gets the caption of a TableElement. |
TableDataElement |
getCellAt(int row,
int col)
Deprecated. Gets the cell at the specified row and column. |
HtmlContainer |
getColGroup()
Deprecated. Gets the colgroup set of a TableElement. |
TableRowElement |
getElementAt(int pos)
Deprecated. Gets the TableRowElement at the specified index position. |
protected java.lang.String |
getHtmlCode()
Deprecated. |
int |
getNumRows()
Deprecated. Gets the number of rows in a TableElement. |
TableRowElement |
getRowAt(int pos)
Deprecated. Gets the TableRowElement at the specified index position. |
TBodyElement |
getTBody()
Deprecated. Returns the TBody section of a TableElement. |
TFootElement |
getTFoot()
Deprecated. Returns the TFoot section of a TableElement. |
THeadElement |
getTHead()
Deprecated. Returns the THead section of a TableElement. |
protected void |
printBody(java.io.OutputStream out)
Deprecated. This is an odd bird because of the ordering Caption has to go under the <TABLE> tag. |
protected void |
printBody(java.io.OutputStream out,
java.lang.String codeset)
Deprecated. |
protected boolean |
printCR()
Deprecated. |
TableElement |
resetColGroup()
Deprecated. Returns a new ColGroupElement for a TableElement. |
TableElement |
resetTBody()
Deprecated. Returns a new TBodyElement that is the table body portion of a TableElement. |
TableElement |
resetTFoot()
Deprecated. Returns a new TBodyElement that is the table body portion of a TableElement. |
TableElement |
resetTHead()
Deprecated. Returns a new THeadElement that is the table head portion of a TableElement. |
TableElement |
setAlign(AlignType align)
Deprecated. Sets the alignment for the table on the page. |
TableElement |
setBackground(java.lang.String url)
Deprecated. Sets a background image for a table. |
TableElement |
setBgColor(java.awt.Color color)
Deprecated. Sets the BGCOLOR attribute. |
TableElement |
setBgColor(java.lang.String color)
Deprecated. Sets the BGCOLOR attribute. |
TableElement |
setBorder(int val)
Deprecated. Sets the border width to the specified number of pixels. |
TableElement |
setBorderstyle(BorderstyleType style)
Deprecated. Sets the borderstyle attribute (extension supported by some browsers). |
TableElement |
setCaption(HtmlElement he)
Deprecated. Sets the caption to the specified HtmlElement. |
TableElement |
setCaption(java.lang.String str)
Deprecated. Sets the caption to the specified String. |
TableElement |
setCaption(TableCaptionElement cap)
Deprecated. Sets the caption to the specified TableCaptionElement. |
TableElement |
setCellAt(int row,
int col,
HtmlElement val)
Deprecated. Sets the cell at the specified row and column to the specified HtmlElement value. |
TableElement |
setCellAt(int row,
int col,
java.lang.String val)
Deprecated. Sets the cell at the specified row and column to the specified String value. |
TableElement |
setCellPadding(int val)
Deprecated. Sets the cellpadding to the specified number of pixels. |
TableElement |
setCellSpacing(int val)
Deprecated. Sets the cellspacing to the specified number of pixels. |
TableElement |
setFramework(FrameType frame,
RulesType rules)
Deprecated. Sets the FRAME and RULES attributes. |
TableElement |
setWidth(int val)
Deprecated. Sets the width to the specified number of pixels. |
TableElement |
setWidth(java.lang.String val)
Deprecated. Sets the width to the specified number of pixels. |
Methods inherited from class weblogic.html.MultiPartElement |
addHeadMultiElement,
addMultiElement,
getMultiElementAt,
getNumElements,
printBody,
removeElement,
removeElementAt,
replaceElementAt,
replaceMultiElementAt,
widthAsLiteral |
Methods inherited from class weblogic.html.ElementWithAttributes |
addAttribute,
addAttribute,
escapeQuotes,
getBooleanAttribute,
getElementAttribute,
getLocalVar,
getQuotedAttribute,
output,
output,
output,
printBody,
printEndingTag,
setBooleanAttribute,
setBooleanAttribute,
setClass,
setDirection,
setElementAttribute,
setElementAttribute,
setElementAttribute,
setElementAttribute,
setElementAttribute,
setId,
setLang,
setLocalVar,
setQuotedAttribute,
setStyle |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static int default_border
public static int default_cellspacing
public static int default_cellpadding
public static java.lang.String default_width
public static TableCaptionElement default_caption
Constructor Detail |
public TableElement()
public TableElement(DataSet ds) throws DataSetException, java.sql.SQLException
ds
- DataSet objectpublic TableElement(DataSet ds, boolean withHeading) throws DataSetException, java.sql.SQLException
ds
- DataSet objectwithHeading
- True if headings should be usedpublic TableElement(ParamSet ps)
ps
- ParamSet objectParamSet
public TableElement(ParamSet ps, boolean withHeading)
ps
- ParamSet objectwithHeading
- true to add "Name" and "Value" column headingspublic TableElement(ParamSet ps, boolean withHeading, boolean sortByName)
ps
- ParamSet objectwithHeading
- true to add "Name" and "Value" column headingssortByName
- true to sort on the Name columnpublic TableElement(ParamSet ps, boolean withHeading, boolean sortByName, java.lang.String fontFace)
Also sets the name of the font as specified, since at the time of this writing, browsers consistently ignore page-level font face settings and require a font face attribute for each table cell.
ps
- ParamSet objectwithHeading
- true to add "Name" and "Value" column headingssortByName
- true to sort on the Name columnfontFace
- String name of fontpublic TableElement(java.util.Dictionary dictionary)
dictionary
- Dictionary objectpublic TableElement(java.util.Dictionary dictionary, boolean withHeading)
dictionary
- Dictionary objectwithHeading
- true to add "Key" and "Value" column headingspublic TableElement(java.util.Dictionary dictionary, boolean withHeading, boolean sortByKey)
dictionary
- Dictionary objectwithHeading
- true to add "Key" and "Value" column headingssortByKey
- true to sort on the Key columnMethod Detail |
protected java.lang.String getHtmlCode()
protected boolean printCR()
public THeadElement getTHead()
public TableElement resetTHead()
public TBodyElement getTBody()
public TableElement resetTBody()
public TFootElement getTFoot()
public TableElement resetTFoot()
public TableElement addElement(TableRowElement val)
val
- TableRowElementpublic TableElement addElement(ColGroupElement cge)
public TableElement addElement(THeadElement the)
public TableElement addElement(TBodyElement tbe)
public TableElement addElement(TFootElement tfe)
public TableElement addRow(int numcols)
numcols
- Number of columnspublic int getNumRows()
public TableRowElement getRowAt(int pos)
pos
- Index positionpublic TableRowElement getElementAt(int pos)
pos
- Index positionpublic TableElement setAlign(AlignType align)
align
- AlignType objectpublic TableElement setCellAt(int row, int col, HtmlElement val)
row
- Row numbercol
- Column numberval
- HtmlElementpublic TableElement setCellAt(int row, int col, java.lang.String val)
row
- Row numbercol
- Column numberval
- Stringpublic TableDataElement getCellAt(int row, int col)
row
- Row numbercol
- Column numberpublic TableElement setBorder(int val)
val
- Border widthpublic TableElement setBorderstyle(BorderstyleType style)
style
- BorderstyleType constantpublic TableElement setFramework(FrameType frame, RulesType rules)
frame
- FrameType constantrules
- RulesType constantpublic TableElement setBgColor(java.lang.String color)
color
- HtmlColor constant or RGB (hex) valuepublic TableElement setBgColor(java.awt.Color color)
public TableElement setBackground(java.lang.String url)
img
- URL for imagepublic TableElement setCellSpacing(int val)
val
- Spacing in pixelspublic TableElement setCellPadding(int val)
val
- Padding in pixelspublic TableElement setWidth(java.lang.String val)
val
- Widthpublic TableElement setWidth(int val)
val
- Widthpublic TableElement setCaption(java.lang.String str)
str
- Captionpublic TableElement setCaption(HtmlElement he)
he
- HtmlElementpublic TableElement setCaption(TableCaptionElement cap)
he
- TableCaptionElementpublic TableCaptionElement getCaption()
public HtmlContainer getColGroup()
public TableElement resetColGroup()
protected void printBody(java.io.OutputStream out) throws java.io.IOException
protected void printBody(java.io.OutputStream out, java.lang.String codeset) throws java.io.IOException
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs60 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |