public class ResourceListRowData extends RowData implements java.io.Serializable
The list of data is formatted into a series of rows where each row contains a finite number of columns determined by the number of column attribute ID's. Each column within a row contains an individual data item.
A ResourceListRowData object can represent any implementation of the
ResourceList
interface. The row data
columns are specified as an array of column attribute IDs. The row data will contain a column
for each element of the array. The following can be specified as column attribute IDs:
A ResourceListRowData object maintains a position in the resource list that points to its current row of data. The initial position in the list is set before the first row. The next method moves to the next row in the list.
The getObject method is used to retrieve the column value for the current row indexed by the column number. Columns are numbered starting from 0.
The following example creates a ResourceListRowData object using an RUserList:
// Create an object to represent the system. AS400 mySystem = new AS400("mySystem.myCompany.com"); // Create a resource user list. RUserList userList = new RUserList(sys); // Set the selection so that all user profiles // are included in the list. userList.setSelectionValue(RUserList.SELECTION_CRITERIA, RUserList.ALL); // Create an HTMLTableConverter object. HTMLTableConverter converter = new HTMLTableConverter(); // Set up the table tag with a maximum of 20 rows per table. converter.setMaximumTableSize(20); // Create an HTMLTable and use the meta data for the table headers. HTMLTable table = new HTMLTable(); table.setCellSpacing(6); table.setBorderWidth(8); converter.setTable(table); converter.setUseMetaData(true); // Create a ResourceListRowData. ResourceListRowData rowdata = new ResourceListRowData(userList, new Object[] { null, RUser.TEXT_DESCRIPTION } ); // Convert the ResourceListRowData into an HTMLTable. String[] html = converter.convert(rowdata); // Print out the first table of 20 users from the html array. System.out.println(html[0]);
rowProperties_, rows_
Constructor and Description |
---|
ResourceListRowData()
Constructs a default ResourceListRowData object.
|
ResourceListRowData(ResourceList resourceList,
java.lang.Object[] columnAttributeIDs)
Constructs a ResourceListRowData object with the specified resourceList and
columnAttributeIDs.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
getColumnAttributeIDs()
Returns the array of column attribute IDs.
|
RowMetaData |
getMetaData()
Returns the metadata.
|
java.lang.Object |
getObject(int columnIndex)
Returns the current row's column data specified at columnIndex.
|
java.util.Vector |
getObjectProperties(int columnIndex)
Returns the data object's property list at the specified columnIndex.
|
ResourceList |
getResourceList()
Return the resource list.
|
int |
length()
Returns the number of rows in the resource list.
|
void |
setColumnAttributeIDs(java.lang.Object[] columnAttributeIDs)
Sets the resource list column attribute IDs.
|
void |
setResourceList(ResourceList resourceList)
Sets the resource list.
|
absolute, addPropertyChangeListener, addVetoableChangeListener, afterLast, beforeFirst, first, getCurrentPosition, getRowProperties, isAfterLast, isBeforeFirst, isFirst, isLast, last, next, previous, relative, removePropertyChangeListener, removeVetoableChangeListener, setObjectProperties
public ResourceListRowData()
public ResourceListRowData(ResourceList resourceList, java.lang.Object[] columnAttributeIDs)
resourceList
- The resource list.columnAttributeIDs
- The array of column attributes.ResourceList
public java.lang.Object[] getColumnAttributeIDs()
public RowMetaData getMetaData()
getMetaData
in class RowData
public java.lang.Object getObject(int columnIndex) throws RowDataException
getObject
in class RowData
columnIndex
- The column index (0-based).RowDataException
- If a row data error occurs.public java.util.Vector getObjectProperties(int columnIndex)
getObjectProperties
in class RowData
columnIndex
- The column index (0-based).RowData.setObjectProperties(java.util.Vector, int)
public ResourceList getResourceList()
public int length()
public void setColumnAttributeIDs(java.lang.Object[] columnAttributeIDs)
columnAttributeIDs
- The column attribute IDs.public void setResourceList(ResourceList resourceList)
resourceList
- The resource list.ResourceList