|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Abstract model interface for representing a record of named data fields. The map provides a uniform API for accessing data which may be contained in a variety of data model constructs underneath, such as RowSet, TabularDataModel, or arbitrary JavaBean classes. The user-interface Binding classes use this interface to "bind" user-interface components to field elements in a data model without having to understand the specific flavor of data model being used by the application. For example, a field element may map to a named column on a RowSet or a property on a JavaBean, but the binding classes don't need to understand those underlying data structures in order to read and write values.
For each named field, the data model provides access to:
Often data models are collections of like-objects, such as the rows in a RowSet, or a list of JavaBeans. This interface provides a mechanism to index into such a collection such that at any given time, the data model contains the element values associated with the "current" record index into that collection (the current row, or the current bean, etc).
| Method Summary | |
void |
addValidator(Validator validator)
Adds the specified validator for the fields represented by this data model. |
void |
addValueChangeListener(ValueChangeListener valueChangeListener)
Adds the specified value change listener to be notified when the value is changed outside of calling setValue directly. |
int |
getFieldCount()
|
String[] |
getFieldNames()
|
MetaData |
getMetaData(String fieldName)
|
int |
getRecordCount()
|
int |
getRecordIndex()
|
Validator[] |
getValidators()
|
Object |
getValue(String fieldName)
|
ValueChangeListener[] |
getValueChangeListeners()
|
void |
removeValidator(Validator validator)
Removes the specified validator from this data model. |
void |
removeValueChangeListener(ValueChangeListener valueChangeListener)
Removes the specified value change listener from this value adapter. |
void |
setRecordIndex(int index)
Sets the current record index such that the field values in this data model represent the values contained at the specified index in the underlying data model. |
void |
setValue(String fieldName,
Object value)
|
| Method Detail |
public String[] getFieldNames()
public MetaData getMetaData(String fieldName)
fieldName - String containing the name of the field
public Object getValue(String fieldName)
fieldName - String containing the name of the field
public void setValue(String fieldName,
Object value)
fieldName - String containing the name of the fieldvalue - Object containing the current value of the named fieldpublic int getFieldCount()
public int getRecordCount()
public void setRecordIndex(int index)
index - integer representing the current index into the underlying
data model's recordspublic int getRecordIndex()
public void addValidator(Validator validator)
value
parameter to the validator's validate method.
validator - Validator object which performs validation checks on
this set of data field valuesremoveValidator(org.jdesktop.swing.data.Validator),
getValidators()public void removeValidator(Validator validator)
validator - Validator object which performs validation checks on
this set of data field valuesaddValidator(org.jdesktop.swing.data.Validator)public Validator[] getValidators()
public void addValueChangeListener(ValueChangeListener valueChangeListener)
setValue directly.
valueChangeListener - ValueChangeListener object to receive events
when the field value changespublic void removeValueChangeListener(ValueChangeListener valueChangeListener)
valueChangeListener - ValueChangeListener object to receive events
when the field value changespublic ValueChangeListener[] getValueChangeListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||