|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.iplanet.jato.view.ViewBase | +--com.iplanet.jato.view.DisplayFieldImpl
Defines a subclass of ViewBase which adds support for the DisplayField interface. A DisplayField is a view that is capable of storing and retreiving an associated arbitrarily complex value object. The value may be singular or plural. If singular, the getValues() method will return an Object array of size one.
This implementation of the DiplayField interface uses a Model object for the storage of its values. The DisplayField can be said to be "bound" to a Model field. The DisplayField does not maintain a copy of the value(s) stored int its bound model field. Rather, the bound model field IS the DisplayField's value. Once the binding is in effect, changes to the Model's field have direct and immediate impact on the DisplayField and vice versa.
It is important to note that this implementation of DisplayField assumes that a display field is ALWAYS bound to a model.
Important note on DisplayFieldDescriptor
Additionally, a DisplayField may be configured via a DisplayFieldDescriptor.
The DisplayFieldDescriptor pattern allows developers to set and get many
attributes of a DisplayField simply, without having to expand the
DisplayField interface for every additional attribute. However, it is up to
the implementation of the DisplayField class to take advantage of a
DisplayFieldDescriptor. Constructors or other methods which require a
non-null DisplayFieldDescriptor should state this explicitly, in their
documentation. In the absence of an explicit directive, developers can assume
that a null value may be supplied to any method parameter of type
DisplayFieldDescriptor.
View
,
DisplayFieldDescriptor
,
DefaultModel
Fields inherited from interface com.iplanet.jato.view.View |
QUALIFIED_VIEW_NAME_SEPARATOR |
Constructor Summary | |
DisplayFieldImpl(ContainerView parent,
java.lang.String name,
java.lang.Object value)
Construct a display field with the specified properties. |
|
DisplayFieldImpl(ContainerView parent,
java.lang.String name,
java.lang.String boundName,
java.lang.Object value)
Construct a display field with the specified properties. |
|
DisplayFieldImpl(View parent,
Model model,
java.lang.String name,
java.lang.Object value)
Construct a display field with the specified properties |
|
DisplayFieldImpl(View parent,
Model model,
java.lang.String name,
java.lang.String boundName,
java.lang.Object value)
Construct a display field with the specified properties |
|
DisplayFieldImpl(View parent,
Model model,
java.lang.String name,
java.lang.String boundName,
java.lang.Object value,
DisplayFieldDescriptor descriptor)
Construct a display field with the specified properties |
Method Summary | |
java.lang.String |
getBoundName()
Returns the name of the field in the Model object to which this display field is "bound". |
DisplayFieldDescriptor |
getDescriptor()
Returns the DisplayFieldDescriptor |
Model |
getModel()
Returns the Model object to which this display field is "bound" |
java.lang.Object |
getValue()
Returns the first value in the value array |
java.lang.Object[] |
getValues()
Returns the DisplayField's value array |
void |
setBoundName(java.lang.String value)
Sets the name of the field in the Model object to which this display field is "bound". |
void |
setDescriptor(DisplayFieldDescriptor descriptor)
Sets this objects DisplayFieldDescriptor |
protected void |
setModel(Model value)
Set the Model object to which this display field is "bound" |
void |
setValue(java.lang.Object value)
Sets the DisplayField value In effect this will set the value array size to one. |
void |
setValue(java.lang.Object value,
boolean overwrite)
Sets the DisplayField value to the new value only if the overwrite param is true or the the value is currently not set. |
void |
setValues(java.lang.Object[] values)
Sets the DisplayField value array |
void |
setValues(java.lang.Object[] values,
boolean overwrite)
Sets the DisplayField value array to the new value array only if the overwrite param is true or the the value is currently not set. |
java.lang.String |
stringValue()
This method returns either the toString() representation of a non-null displayField's value, or a blank string whenever the value is null |
Methods inherited from class com.iplanet.jato.view.ViewBase |
getName, getParent, getParentViewBean, getQualifiedName, getRootView, getRootView, setName, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.iplanet.jato.view.View |
getName, getParent, getQualifiedName, setParent |
Constructor Detail |
public DisplayFieldImpl(ContainerView parent, java.lang.String name, java.lang.Object value)
parent
- The parent view of this objectname
- This view's name and model field bound namevalue
- This DiplayField's initial value.public DisplayFieldImpl(ContainerView parent, java.lang.String name, java.lang.String boundName, java.lang.Object value)
parent
- The parent view of this objectname
- This view's nameboundName
- The name of the model field to which this DisplayField is boundvalue
- This DiplayField's initial value.public DisplayFieldImpl(View parent, Model model, java.lang.String name, java.lang.Object value)
parent
- The parent view of this objectmodel
- The model to which this DisplayField is boundname
- This view's name and model field bound namevalue
- This DiplayField's initial value.public DisplayFieldImpl(View parent, Model model, java.lang.String name, java.lang.String boundName, java.lang.Object value)
parent
- The parent view of this objectmodel
- The model to which this DisplayField is boundname
- This view's name.boundName
- The name of the model field to which this DisplayField is boundvalue
- This DiplayField's initial value.public DisplayFieldImpl(View parent, Model model, java.lang.String name, java.lang.String boundName, java.lang.Object value, DisplayFieldDescriptor descriptor)
parent
- The parent view of this objectmodel
- The model to which this DisplayField is boundname
- This view's name.boundName
- The name of the model field to which this DisplayField is boundvalue
- This DiplayField's initial value.descriptor
- This DisplayField's DisplayFieldDescriptor. May be null.Method Detail |
public Model getModel()
protected void setModel(Model value)
the
- Model to which one wishes to bind the DisplayFieldpublic java.lang.String getBoundName()
public void setBoundName(java.lang.String value)
public DisplayFieldDescriptor getDescriptor()
getDescriptor
in interface DisplayField
public void setDescriptor(DisplayFieldDescriptor descriptor)
descriptor
- The DisplayFieldDescriptorpublic java.lang.Object getValue()
getValue
in interface DisplayField
public void setValue(java.lang.Object value)
setValue
in interface DisplayField
aValue
- The object that will be stored as the DisplayField's valuepublic void setValue(java.lang.Object value, boolean overwrite)
value
- The object that will be stored as the DisplayField's valueoverwrite
- specifies whether to overwrite the old value with a new onepublic java.lang.Object[] getValues()
getValues
in interface DisplayField
public void setValues(java.lang.Object[] values)
setValues
in interface DisplayField
aValue
- The object array that will be stored as the DisplayField's valuepublic void setValues(java.lang.Object[] values, boolean overwrite)
values
- The objects that will be stored as the DisplayField's valueoverwrite
- specifies whether to overwrite the old value with a new onepublic java.lang.String stringValue()
stringValue
in interface DisplayField
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |