|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.iface.ui.AbstractIFormModel
public abstract class AbstractIFormModel
An abstract model class to be used to fill an IFormPanel.
Field Summary | |
---|---|
protected EditableObject |
baseObject
|
protected java.lang.Class |
baseObjectClass
|
protected java.util.HashSet |
dataListeners
|
protected java.util.List |
displayFields
|
protected java.util.HashMap |
fieldClasses
|
protected java.util.HashMap |
fieldNames
|
protected boolean |
isUpdating
|
protected java.util.HashSet |
listeners
|
protected java.util.List |
nameFields
|
protected boolean |
settingData
|
Constructor Summary | |
---|---|
AbstractIFormModel(java.lang.Class objectClass)
|
|
AbstractIFormModel(EditableObject object)
|
Method Summary | |
---|---|
void |
addDataListener(FormDataListener l)
|
static java.util.Collection |
addIfField(java.util.Collection fields,
java.lang.Class c,
java.lang.String sField)
|
void |
addModelListener(FormModelListener l)
|
void |
clearData()
Clears the model of its data; |
void |
dataChanged(EditableObject eo,
java.lang.String field,
java.lang.Object oldValue,
java.lang.Object newValue)
|
void |
dataChanged(ObjectChangeEvent oce)
Listening to changes to the object generated elsewhere. |
protected void |
deriveClasses()
Collects name and display fields and calls deriveClasses(fields). |
protected abstract void |
deriveClasses(java.util.List fields)
Derives the classes of the given fields and puts them into HashMap fieldClasses. |
protected abstract java.util.List |
deriveDisplayFields()
Derives the fields to be used for displaying the object information |
protected abstract java.util.List |
deriveNameFields()
Derives the fields to be used for displaying the object name(s) |
protected void |
deriveNames()
Collects name and display fields and calls deriveNames(fields). |
protected abstract void |
deriveNames(java.util.List fields)
Derives the names of the given fields and puts them into HashMap fieldNames. |
void |
endUpdate()
|
void |
fireDataChanged(java.lang.String field,
java.lang.Object editedObject,
java.lang.Object oldValue,
java.lang.Object newValue)
Notify listeners that data has changed. |
void |
fireModelChanged(java.lang.String change)
|
void |
fireModelChanged(java.lang.String change,
ObjectChangeEvent oce)
|
java.util.HashSet |
getDataListeners()
|
java.util.List |
getDisplayClasses()
Get the classes of the object's display fields (e.g. |
java.util.List |
getDisplayFields()
Get the fields of the object that are to be displayed (exc. names) |
java.util.List |
getDisplayNames()
Get the titles to use for the object's display fields |
java.lang.Class |
getFieldClass(java.lang.String field)
Gets the class of the object's given field name (e.g. |
java.lang.String |
getFieldName(java.lang.String field)
Gets the title to use for the object's given field (e.g. |
double |
getFieldWeight(java.lang.String field)
Gets the weight of the object's given field name to establish its portion of the display. |
java.util.HashSet |
getModelListeners()
|
java.util.List |
getNameClasses()
Get the classes of the object's name fields (e.g. |
java.util.List |
getNameFields()
Get the fields that correspond to the object's name (e.g. |
java.util.List |
getNameNames()
Get the titles to use for the object's name fields (e.g. |
EditableObject |
getObject()
Get the model's current base object |
java.lang.Class |
getObjectClass()
Get the class of the model's base object |
java.lang.Object |
getValue(EditableObject object,
java.lang.String field)
|
java.lang.Object |
getValue(java.lang.String field)
Get the current object's value for the given field. |
void |
ignoreUpdate()
End update without firing |
boolean |
isEditable(java.lang.String field)
Determines whether a field is editable (can be changed by the user) or not. |
boolean |
isFieldShowing(java.lang.String field)
Determines whether the given field is part of the model display. |
protected java.util.List |
lookupFieldClasses(java.util.List fields)
|
protected java.util.List |
lookupFieldNames(java.util.List fields)
|
void |
setDisplayFields(java.util.List fields)
Sets the fields of the object that are to be displayed (exc. names) |
void |
setDisplayFields(java.lang.String[] fields)
Sets the fields of the object that are to be shown as its name. |
void |
setFields()
Derives the name fields, display fields and the field names and classes. |
void |
setNameFields(java.util.List fields)
Sets the fields of the object that are to be shown as its name. |
void |
setNameFields(java.lang.String[] fields)
Sets the fields of the object that are to be shown as its name. |
void |
setObject(EditableObject o)
Set the model's base object |
void |
setObjectClass(java.lang.Class c)
Set the class of the model's base object |
boolean |
setValue(EditableObject object,
java.lang.String field,
java.lang.Object value)
Get the object to change its value. |
void |
setValue(java.lang.String field,
java.lang.Object value)
Sets the current object's given field to the given value. |
void |
startUpdate()
|
java.lang.reflect.Field |
stringToField(java.lang.String field)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List nameFields
protected java.util.List displayFields
protected java.util.HashMap fieldNames
protected java.util.HashMap fieldClasses
protected EditableObject baseObject
protected java.lang.Class baseObjectClass
protected java.util.HashSet listeners
protected java.util.HashSet dataListeners
protected boolean isUpdating
protected boolean settingData
Constructor Detail |
---|
public AbstractIFormModel(java.lang.Class objectClass)
public AbstractIFormModel(EditableObject object)
Method Detail |
---|
public void clearData()
IFormModel
clearData
in interface IFormModel
public java.lang.String getFieldName(java.lang.String field)
IFormModel
getFieldName
in interface IFormModel
public java.lang.Class getFieldClass(java.lang.String field)
IFormModel
getFieldClass
in interface IFormModel
public double getFieldWeight(java.lang.String field)
IFormModel
getFieldWeight
in interface IFormModel
public void setNameFields(java.util.List fields)
IFormModel
setNameFields
in interface IFormModel
fields
- a list of strings; the field namespublic void setNameFields(java.lang.String[] fields)
IFormModel
setNameFields
in interface IFormModel
fields
- an array of strings; the field namespublic void setDisplayFields(java.util.List fields)
IFormModel
setDisplayFields
in interface IFormModel
fields
- a list of strings; the field namespublic void setDisplayFields(java.lang.String[] fields)
IFormModel
setDisplayFields
in interface IFormModel
fields
- an array of strings; the field namespublic java.util.List getNameFields()
getNameFields
in interface IFormModel
public java.util.List getNameNames()
public java.util.List getNameClasses()
public java.util.List getDisplayFields()
getDisplayFields
in interface IFormModel
public java.util.List getDisplayNames()
public java.util.List getDisplayClasses()
public void setObjectClass(java.lang.Class c)
public java.lang.Class getObjectClass()
getObjectClass
in interface IFormModel
public void setObject(EditableObject o)
IFormModel
setObject
in interface IFormModel
public EditableObject getObject()
IFormModel
getObject
in interface IFormModel
public java.lang.Object getValue(java.lang.String field)
getValue
in interface IFormModel
public java.lang.Object getValue(EditableObject object, java.lang.String field)
public void setValue(java.lang.String field, java.lang.Object value)
IFormModel
setValue
in interface IFormModel
public boolean setValue(EditableObject object, java.lang.String field, java.lang.Object value)
setValue
in interface IFormModel
public java.lang.reflect.Field stringToField(java.lang.String field) throws java.lang.NoSuchFieldException, java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
public void setFields()
protected java.util.List lookupFieldNames(java.util.List fields)
protected java.util.List lookupFieldClasses(java.util.List fields)
public boolean isFieldShowing(java.lang.String field)
IFormModel
isFieldShowing
in interface IFormModel
protected void deriveNames()
protected void deriveClasses()
protected abstract void deriveNames(java.util.List fields)
protected abstract void deriveClasses(java.util.List fields)
protected abstract java.util.List deriveNameFields()
protected abstract java.util.List deriveDisplayFields()
public static java.util.Collection addIfField(java.util.Collection fields, java.lang.Class c, java.lang.String sField)
public boolean isEditable(java.lang.String field)
IFormModel
isEditable
in interface IFormModel
public void startUpdate()
startUpdate
in interface IFormModel
public void endUpdate()
endUpdate
in interface IFormModel
public void ignoreUpdate()
ignoreUpdate
in interface IFormModel
public void fireModelChanged(java.lang.String change, ObjectChangeEvent oce)
public void fireModelChanged(java.lang.String change)
public void fireDataChanged(java.lang.String field, java.lang.Object editedObject, java.lang.Object oldValue, java.lang.Object newValue)
public void dataChanged(ObjectChangeEvent oce)
public void dataChanged(EditableObject eo, java.lang.String field, java.lang.Object oldValue, java.lang.Object newValue)
dataChanged
in interface DataChangeListener
public void addModelListener(FormModelListener l)
addModelListener
in interface IFormModel
public void addDataListener(FormDataListener l)
addDataListener
in interface IFormModel
public java.util.HashSet getModelListeners()
getModelListeners
in interface IFormModel
public java.util.HashSet getDataListeners()
getDataListeners
in interface IFormModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |