Bean Builder

com.adventnet.beans.table
Class PropertyTable

com.adventnet.beans.table.BaseTable
  |
  +--com.adventnet.beans.table.PropertyTable

public class PropertyTable
extends BaseTable

The PropertyTable Bean is used to show the extra details associated with a r *ow when all the details cannot be shown using columns. When the property "Ext *ra Property" is set true,the property table shows the extra details for ea ch row. Moreover, the property table also stores all the details of a row as *an object of java.util.Properties.

For example, suppose, you want to show the details of a student in a property table. Enter the details of the student in a properties object,like:

java.util.Properties studentProp=new java.util.Properties(); studentProp.setProperty("Name","Alice"); studentProp.setProperty("Age","12"); studentProp.setProperty("Sex","Female"); studentProp.setProperty("Marks","80"); studentProp.setProperty("Class","IX");

Now, drop a PropertyTable bean from the AdventNetUtils.jar and set the follo *wing properties using the property sheet.

 PropertyTable1.setColumnNames();
 PropertyTable1.setExtraProperty(true);
 
We can also construct a Properties object to set the column names.

java.util.Properties colNameProp=new java.util.Properties(); colNameProp.setProperty("Student Name","Name"); colNameProp.setProperty("Age","Age"); colNameProp.setProperty("Sex","Sex"); colNameProp.setProperty("Marks","Marks"); PropertyTable1.setColumnNames(colNameProp); PropertyTable1.setExtraProperty(true);

The method setColumnNames sets the column header of the table. In the above example, the table shows only four properties. If the "Extra Pr *operty" is set true, then an extra column gets added. Clicking on this column shows all the properties associated with the selected row.


Fields inherited from class com.adventnet.beans.table.BaseTable
colMapNames, colNames, tblModel
 
Constructor Summary
PropertyTable()
          Creates a new PropertyTable instance.
 
Method Summary
 void addRow(java.util.Properties rowProp)
          The addRow method adds the given row of the properties to the table.
 void addRows(java.util.Properties[] props)
          The addRows method adds many rows of properties, given at a time, to the table.
 java.util.Properties getPropertyAtRow(int rowIndex)
          The getPropertyAtRow method returns the property, specified in the row index, from the table.
 void removeProperty(java.util.Properties prop)
          The removeProperty method removes the specified property ,from the table.
 
Methods inherited from class com.adventnet.beans.table.BaseTable
addObjectAtRow, getColumnNames, getExtraProperty, setColumnNames, setExtraProperty, tableMousePressedEvent
 

Constructor Detail

PropertyTable

public PropertyTable()
Creates a new PropertyTable instance.
Method Detail

addRow

public void addRow(java.util.Properties rowProp)
The addRow method adds the given row of the properties to the table.
Parameters:
rowProp - a Properties value

addRows

public void addRows(java.util.Properties[] props)
The addRows method adds many rows of properties, given at a time, to the table.
Parameters:
props - a Properties[] value

getPropertyAtRow

public java.util.Properties getPropertyAtRow(int rowIndex)
The getPropertyAtRow method returns the property, specified in the row index, from the table. The Rowindex starts from 0.
Parameters:
rowIndex - an int value
Returns:
a Properties value

removeProperty

public void removeProperty(java.util.Properties prop)
The removeProperty method removes the specified property ,from the table.
Parameters:
evt - an Event value

Bean Builder

© 2001 - 2002 AdventNet Inc. Visit us at: http://www.adventnet.com