org.jdesktop.swing.data
Class TabularDataModelAdapter
java.lang.Object
org.jdesktop.swing.data.AbstractDataModel
org.jdesktop.swing.data.TabularDataModelAdapter
- All Implemented Interfaces:
- DataModel
- public class TabularDataModelAdapter
- extends AbstractDataModel
Adapts a TabularDataModel object to the DataModel interface so that
user-interface components other than a table can easily be bound to
columns in the model.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TabularDataModelAdapter
public TabularDataModelAdapter(TabularDataModel model)
getFieldNames
public String[] getFieldNames()
- Specified by:
getFieldNames in interface DataModel- Specified by:
getFieldNames in class AbstractDataModel
getMetaData
public MetaData getMetaData(String fieldName)
- Specified by:
getMetaData in interface DataModel- Specified by:
getMetaData in class AbstractDataModel
getFieldCount
public int getFieldCount()
- Returns:
- integer containing the number of fields in this data model
getValue
public Object getValue(String fieldName)
- Specified by:
getValue in interface DataModel- Specified by:
getValue in class AbstractDataModel
setValueImpl
protected void setValueImpl(String fieldName,
Object value)
- Specified by:
setValueImpl in class AbstractDataModel
setRecordIndex
public void setRecordIndex(int rowIndex)
- Sets the current record index such that the data field values
in this value map represent the values contained at the specified
row in the tabular data model.
- Parameters:
rowIndex - integer representing the current row index
- Throws:
IndexOutOfBoundsException - if index >= recordCount
getRecordIndex
public int getRecordIndex()
- Returns:
- integer representing the current row index
getRecordCount
public int getRecordCount()
- Returns:
- integer representing the number of rows currently in
the tabular data model
Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.