|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--oracle.html.IHtmlItemImpl | +--oracle.html.Item | +--oracle.html.Table | +--oracle.html.DynamicTable
説明:
DynamicTableは、動的に成長する表をカプセル化します。addRow()などの操作をDynamicTableオブジェクトに適用できるようにして、HTMLのオーサリング機能を模倣しています。
使用方法:
表の作成は、通常、次の手順で行われます。
例:
// Some user-defined functions Product product = getFirstProduct(); // create a dynamic table with 2 columns DynamicTable tab = new DynamicTable(2); // create the rows and add them to the table TableRow rows[] = new TableRow[NUM_ROWS]; for (int i=0; i< NUM_ROWS; i++) { // allocate TableRow rows[i] = new TableRow(); // populate row with data rows[i].addCell(new TableHeaderCell(product.getProductID())) .addCell(new TableDataCell(product.getProductDescription())) // add them to Table tab.addRow(rows[i]); }
Table
, TableRow
, TableDataCell
, TableHeaderCell
コンストラクタの概要 | |
DynamicTable(int cols)
DynamicTableオブジェクトを作成します。 |
メソッドの概要 | |
DynamicTable |
addRow()
新しい行を表に追加します。 |
DynamicTable |
addRow(int numRows)
指定された数の新しい行を表に追加します。 |
DynamicTable |
addRow(TableRow row)
TableRowを使用して行を表に追加します。 |
int |
getNumRows()
DynamicTableオブジェクトの現在の行数を返します。 |
DynamicTable |
setCellAt(int col_num, int row_num, SimpleItem item)
指定された位置にある特定のセルの内容を設定します。 その位置にあった元の項目は破棄されるので注意してください。 |
java.lang.String |
toHTML()
DynamicTableオブジェクトの内容をHTML文字列として返します。 |
java.lang.String |
toString()
DynamicTableの内容を通常の文字列として返します。 想定: 1より大きいCOLSPANまたはROWSPAN属性を持つセルはなく、すべての行はセル数が同じであることを想定しています。 |
クラス oracle.html.Tableから継承したメソッド |
backgroundColor, backgroundImage, border, borderColor, caption, captionAlign, cellPadding, cellspacing, endTag, frame, hAlign, rules, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBorder, setBorderColor, setBorderColor, setCaption, setCaption, setCellPadding, setCellSpacing, setFrame, setIHAlign, setRules, setWidth, startTag, width |
クラス oracle.html.IHtmlItemImplから継承したメソッド |
print, print |
クラス java.lang.Objectから継承したメソッド |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
public DynamicTable(int cols)
cols
- 表の列数を指定します。メソッドの詳細 |
public int getNumRows()
public DynamicTable addRow(TableRow row)
row
- 表に追加される新規TableRow。TableRow
public DynamicTable addRow()
public DynamicTable addRow(int numRows)
numRows
- 指定された行数。TableRow
public DynamicTable setCellAt(int col_num, int row_num, SimpleItem item)
col_num
- 列番号(セル数)を指定します。row_num
- 行番号を指定します。item
- その位置に設定される項目を指定します。public java.lang.String toHTML()
public java.lang.String toString()
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |