All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.util.servlet.HTMLTableConverter
java.lang.Object
|
+----com.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 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();
table.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);
-
HTMLTableConverter()
- Constructs a default HTMLTableConverter object.
-
addActionCompletedListener(ActionCompletedListener)
- Adds an ActionCompletedListener.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a PropertyChangeListener.
-
addSectionCompletedListener(SectionCompletedListener)
- Adds a SectionCompletedListener.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds the VetoableChangeListener.
-
convertToTables(RowData)
- Converts the row data specified by rowdata into an array of HTMLTable objects.
-
getHeaderHyperlinks()
- Returns the table header's hyperlinks.
-
getMaximumTableSize()
- Returns the maximum number of rows in a table.
-
getObjectHyperlink(RowData, int)
- Returns the object hyperlink for the current row's specified column.
-
getObjectHyperlink(RowData, int, int)
- Returns the object's hyperlink at the specified row and column.
-
getTable()
- Returns the default HTML table.
-
isUseMetaData()
- Indicates whether the table header is created using the
metadata.
-
removeActionCompletedListener(ActionCompletedListener)
- Removes this ActionCompletedListener from the internal list.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes the PropertyChangeListener from the internal list.
-
removeSectionCompletedListener(SectionCompletedListener)
- Removes this SectionCompletedListener from the internal list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes the VetoableChangeListener from the internal list.
-
setHeaderHyperlinks(HTMLHyperlink[])
- Sets the table header's hyperlinks.
-
setMaximumTableSize(int)
- Sets the maximum number of rows in a table.
-
setObjectHyperlink(RowData, HTMLHyperlink, int)
- Sets the object's hyperlink at the specified column within the current row.
-
setObjectHyperlink(RowData, HTMLHyperlink, int, int)
- Sets the row object's hyperlink specified by row and column.
-
setTable(HTMLTable)
- Sets the default HTML table to be used during conversion.
-
setUseMetaData(boolean)
- Sets whether the table header is created using the
metadata.
HTMLTableConverter
public HTMLTableConverter()
- Constructs a default HTMLTableConverter object.
addActionCompletedListener
public void addActionCompletedListener(ActionCompletedListener listener)
- Adds an ActionCompletedListener.
The specified ActionCompletedListener's actionCompleted method is called
each time the table conversion is complete and all the row data is converted.
The ActionCompletedListener object is added to a list of ActionCompletedListeners
managed by this class; it can be removed with removeActionCompletedListener.
- Parameters:
- listener - The ActionCompletedListener.
- See Also:
- removeActionCompletedListener
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange
method is called each time the value of any bound property is changed.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- removePropertyChangeListener
addSectionCompletedListener
public void addSectionCompletedListener(SectionCompletedListener listener)
- Adds a SectionCompletedListener.
The specified SectionCompletedListener's sectionCompleted method is called
each time the conversion for a single table is complete.
The SectionCompletedListener object is added to an internal list of SectionCompletedListeners;
it can be removed with removeSectionCompletedListener.
- Parameters:
- listener - The SectionCompletedListener.
- See Also:
- removeSectionCompletedListener
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
- Adds the VetoableChangeListener. The specified VetoableChangeListener's vetoableChange
method is called each time the value of any constrained property is changed.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- removeVetoableChangeListener
convertToTables
public HTMLTable[] convertToTables(RowData rowdata) throws PropertyVetoException, RowDataException
- Converts the row data specified by rowdata into an array of HTMLTable objects.
- Parameters:
- rowdata - The RowData object that contains the row data.
- Returns:
- An array of HTMLTable objects.
- Throws: PropertyVetoException
- If a change is vetoed.
- Throws: RowDataException
- If a row data error occurs.
getHeaderHyperlinks
public HTMLHyperlink[] getHeaderHyperlinks()
- Returns the table header's hyperlinks.
- Returns:
- The hyperlinks.
getMaximumTableSize
public int getMaximumTableSize()
- Returns the maximum number of rows in a table.
The default maximum size is 0 (no maximum).
- Returns:
- The maximum size.
getObjectHyperlink
public HTMLHyperlink getObjectHyperlink(RowData rowdata,
int column)
- Returns the object hyperlink for the current row's specified column.
- Parameters:
- rowdata - The RowData object that contains the data.
- column - The column number (0-based).
- Returns:
- The hyperlink.
getObjectHyperlink
public HTMLHyperlink getObjectHyperlink(RowData rowdata,
int row,
int column)
- Returns the object's hyperlink at the specified row and column.
- Parameters:
- rowdata - The RowData object that contains the data.
- row - The row number (0-based).
- column - The column number (0-based).
- Returns:
- The hyperlink.
getTable
public HTMLTable getTable()
- Returns the default HTML table.
- Returns:
- The table.
isUseMetaData
public boolean isUseMetaData()
- Indicates whether the table header is created using the
metadata. Default value is false (use existing table header).
- Returns:
- true if the metadata is used; false otherwise.
removeActionCompletedListener
public void removeActionCompletedListener(ActionCompletedListener listener)
- Removes this ActionCompletedListener from the internal list.
If the ActionCompletedListener is not on the list, nothing is done.
- Parameters:
- listener - The ActionCompletedListener.
- See Also:
- addActionCompletedListener
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes the PropertyChangeListener from the internal list.
If the PropertyChangeListener is not on the list, nothing is done.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- addPropertyChangeListener
removeSectionCompletedListener
public void removeSectionCompletedListener(SectionCompletedListener listener)
- Removes this SectionCompletedListener from the internal list.
If the SectionCompletedListener is not on the list, nothing is done.
- Parameters:
- listener - The SectionCompletedListener.
- See Also:
- addSectionCompletedListener
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes the VetoableChangeListener from the internal list.
If the VetoableChangeListener is not on the list, nothing is done.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- addVetoableChangeListener
setHeaderHyperlinks
public void setHeaderHyperlinks(HTMLHyperlink links[]) throws PropertyVetoException
- Sets the table header's hyperlinks.
- Parameters:
- links - The hyperlinks.
- Throws: PropertyVetoException
- If a change is vetoed.
setMaximumTableSize
public void setMaximumTableSize(int size) throws PropertyVetoException
- Sets the maximum number of rows in a table. The default value is 0 (no maximum).
- Parameters:
- size - The maximum size.
- Throws: PropertyVetoException
- If a change is vetoed.
setObjectHyperlink
public void setObjectHyperlink(RowData rowdata,
HTMLHyperlink link,
int column) throws RowDataException
- Sets the object's hyperlink at the specified column within the current row.
The hyperlink is a property of the data object that can be used to link the data object
to an Uniform Resource Identifier (URI).
- Parameters:
- rowdata - The RowData object that contains the rowdata.
- link - The hyperlink tag.
- column - The column number (0-based).
- Throws: RowDataException
- If a row data exception occurs.
setObjectHyperlink
public void setObjectHyperlink(RowData rowdata,
HTMLHyperlink link,
int row,
int column) throws RowDataException
- Sets the row object's hyperlink specified by row and column.
The hyperlink is a property of the data object that can be used to link the data
object to an Uniform Resource Identifier (URI).
- Parameters:
- 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).
- Throws: RowDataException
- If a row data exception occurs.
setTable
public void setTable(HTMLTable table) throws PropertyVetoException
- Sets the default HTML table to be used during conversion.
The default table's column headers must be set. The setUseMetaData
method can also be used to set the column headers based on the metadata.
- Parameters:
- table - The HTML table.
- Throws: PropertyVetoException
- If the change is vetoed.
- See Also:
- setUseMetaData
setUseMetaData
public void setUseMetaData(boolean useMetaData)
- Sets whether the table header is created using the
metadata. Default value is false (use existing table header).
- Parameters:
- useMetaData - true if the metadata is used; false otherwise.
All Packages Class Hierarchy This Package Previous Next Index