|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.as400.util.servlet.StringConverter
com.ibm.as400.util.servlet.HTMLTableConverter
public class HTMLTableConverter extends StringConverter implements Serializable
The HTMLTableConverter class can be used to convert the data from a RowData object to a single HTML table for a selected group or page of row data, an array of strings or HTML tables. Each resulting HTML table then can be used by a servlet to display the rowdata to a browser.
HTMLTableConverter objects generate the following events:
The following example creates an HTMLTableConverter object and does the conversion.
// Create an HTMLTableConverter object. HTMLTableConverter converter = new HTMLTableConverter();
// Setup the table tag with a maximum of 25 rows/table. HTMLTable table = new HTMLTable(); converter.setMaximumTableSize(25); converter.setTable(table);
// Convert the row data.
// Assume the RowData object was created and initialized in a previous step. String[] html = converter.convert(rowdata);
Constructor and Description |
---|
HTMLTableConverter()
Constructs a default HTMLTableConverter object. |
Modifier and Type | Method and Description |
---|---|
void |
addActionCompletedListener(ActionCompletedListener listener)
Adds an ActionCompletedListener. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. |
void |
addSectionCompletedListener(SectionCompletedListener listener)
Adds a SectionCompletedListener. |
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
HTMLTable |
convertToTable(RowData rowdata,
int page)
Converts the row data specified by rowdata at the specified page into an HTMLTable object when using the maximum table size. |
HTMLTable[] |
convertToTables(RowData rowdata)
Converts the row data specified by rowdata into an array of HTMLTable objects. |
HTMLHyperlink[] |
getHeaderHyperlinks()
Returns the table header's hyperlinks. |
int |
getMaximumTableSize()
Returns the maximum number of rows in a table. |
HTMLHyperlink |
getObjectHyperlink(RowData rowdata,
int column)
Returns the object hyperlink for the current row's specified column. |
HTMLHyperlink |
getObjectHyperlink(RowData rowdata,
int row,
int column)
Returns the object's hyperlink at the specified row and column. |
HTMLTable |
getTable()
Returns the default HTML table. |
boolean |
isUseMetaData()
Indicates whether the table header is created using the metadata. |
void |
removeActionCompletedListener(ActionCompletedListener listener)
Removes this ActionCompletedListener from the internal list. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. |
void |
removeSectionCompletedListener(SectionCompletedListener listener)
Removes this SectionCompletedListener from the internal list. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setHeaderHyperlinks(HTMLHyperlink[] links)
Sets the table header's hyperlinks. |
void |
setMaximumTableSize(int size)
Sets the maximum number of rows in a table. |
void |
setObjectHyperlink(RowData rowdata,
HTMLHyperlink link,
int column)
Sets the object's hyperlink at the specified column within the current row. |
void |
setObjectHyperlink(RowData rowdata,
HTMLHyperlink link,
int row,
int column)
Sets the row object's hyperlink specified by row and column. |
void |
setTable(HTMLTable table)
Sets the default HTML table to be used during conversion. |
void |
setUseMetaData(boolean useMetaData)
Sets whether the table header is created using the metadata. |
Methods inherited from class com.ibm.as400.util.servlet.StringConverter |
---|
convert |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTMLTableConverter()
Method Detail |
---|
public void addActionCompletedListener(ActionCompletedListener listener)
listener
- The ActionCompletedListener.removeActionCompletedListener(com.ibm.as400.access.ActionCompletedListener)
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addSectionCompletedListener(SectionCompletedListener listener)
listener
- The SectionCompletedListener.removeSectionCompletedListener(com.ibm.as400.util.servlet.SectionCompletedListener)
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public HTMLTable[] convertToTables(RowData rowdata) throws PropertyVetoException, RowDataException
rowdata
- The RowData object that contains the row data.PropertyVetoException
- If a change is vetoed.RowDataException
- If a row data error occurs.public HTMLTable convertToTable(RowData rowdata, int page) throws PropertyVetoException, RowDataException
rowdata
- The RowData object that contains the row data.page
- The specific page of the row data.PropertyVetoException
- If a change is vetoed.RowDataException
- If a row data error occurs.public HTMLHyperlink[] getHeaderHyperlinks()
public int getMaximumTableSize()
public HTMLHyperlink getObjectHyperlink(RowData rowdata, int column)
rowdata
- The RowData object that contains the data.column
- The column number (0-based).public HTMLHyperlink getObjectHyperlink(RowData rowdata, int row, int column)
rowdata
- The RowData object that contains the data.row
- The row number (0-based).column
- The column number (0-based).public HTMLTable getTable()
public boolean isUseMetaData()
public void removeActionCompletedListener(ActionCompletedListener listener)
listener
- The ActionCompletedListener.addActionCompletedListener(com.ibm.as400.access.ActionCompletedListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeSectionCompletedListener(SectionCompletedListener listener)
listener
- The SectionCompletedListener.addSectionCompletedListener(com.ibm.as400.util.servlet.SectionCompletedListener)
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setHeaderHyperlinks(HTMLHyperlink[] links) throws PropertyVetoException
links
- The hyperlinks.PropertyVetoException
- If a change is vetoed.public void setMaximumTableSize(int size) throws PropertyVetoException
size
- The maximum size.PropertyVetoException
- If a change is vetoed.public void setObjectHyperlink(RowData rowdata, HTMLHyperlink link, int column) throws RowDataException
rowdata
- The RowData object that contains the rowdata.link
- The hyperlink tag.column
- The column number (0-based).RowDataException
- If a row data exception occurs.public void setObjectHyperlink(RowData rowdata, HTMLHyperlink link, int row, int column) throws RowDataException
rowdata
- The RowData object that contains the row data.link
- The hyperlink tag.row
- The row number (0-based).column
- The column number (0-based).RowDataException
- If a row data exception occurs.public void setTable(HTMLTable table) throws PropertyVetoException
table
- The HTML table.PropertyVetoException
- If the change is vetoed.setUseMetaData(boolean)
public void setUseMetaData(boolean useMetaData)
useMetaData
- true if the metadata is used; false otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |