|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ix.iface.ui.AbstractIFormModel
An abstract model class to be used to fill an IFormPanel.
Field Summary | |
protected java.lang.Object |
baseObject
|
(package private) java.lang.Class |
baseObjectClass
|
(package private) java.util.List |
displayFields
|
(package private) java.util.HashMap |
fieldClasses
|
(package private) java.util.HashMap |
fieldNames
|
(package private) boolean |
isUpdating
|
(package private) java.util.HashSet |
listeners
|
(package private) java.util.List |
nameFields
|
Constructor Summary | |
AbstractIFormModel(java.lang.Class objectClass)
|
|
AbstractIFormModel(java.lang.Object object)
|
Method Summary | |
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; |
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 |
fireModelChanged(java.lang.String change)
|
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. |
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.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. |
java.lang.Object |
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(java.lang.String field)
Get the current object's value for the given field. |
void |
ignoreUpdate()
|
boolean |
isEditable(java.lang.String field)
Determines whether a field is editable (can be changed by the user) or not. |
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. |
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(java.lang.Object o)
Set the model's base object |
void |
setObjectClass(java.lang.Class c)
Set the class of the model's base object |
void |
setValue(java.lang.Object object,
java.lang.String field,
java.lang.Object value)
Sets the given object's given field to the given 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.Class oClass,
java.lang.String field)
|
java.lang.reflect.Field |
stringToField(java.lang.String field)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
java.util.List nameFields
java.util.List displayFields
java.util.HashMap fieldNames
java.util.HashMap fieldClasses
protected java.lang.Object baseObject
java.lang.Class baseObjectClass
java.util.HashSet listeners
boolean isUpdating
Constructor Detail |
public AbstractIFormModel(java.lang.Class objectClass)
public AbstractIFormModel(java.lang.Object 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
ix.iface.ui.IFormModel
nameFields
- a list of strings; the field namespublic void setNameFields(java.lang.String[] fields)
IFormModel
setNameFields
in interface IFormModel
ix.iface.ui.IFormModel
nameFields
- an array of strings; the field namespublic void setDisplayFields(java.util.List fields)
IFormModel
setDisplayFields
in interface IFormModel
ix.iface.ui.IFormModel
nameFields
- a list of strings; the field namespublic void setDisplayFields(java.lang.String[] fields)
IFormModel
setDisplayFields
in interface IFormModel
ix.iface.ui.IFormModel
nameFields
- 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 setObject(java.lang.Object o)
IFormModel
setObject
in interface IFormModel
public java.lang.Object getObject()
IFormModel
getObject
in interface IFormModel
public void setObjectClass(java.lang.Class c)
public java.lang.Class getObjectClass()
getObjectClass
in interface IFormModel
public java.lang.Object getValue(java.lang.String field)
getValue
in interface IFormModel
public void setValue(java.lang.String field, java.lang.Object value)
IFormModel
setValue
in interface IFormModel
public void setValue(java.lang.Object object, java.lang.String field, java.lang.Object value)
IFormModel
setValue
in interface IFormModel
public java.lang.reflect.Field stringToField(java.lang.String field) throws java.lang.NoSuchFieldException, java.lang.IllegalAccessException
public java.lang.reflect.Field stringToField(java.lang.Class oClass, java.lang.String field) throws 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)
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)
public void addModelListener(FormModelListener l)
addModelListener
in interface IFormModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |