org.springframework.binding.form.support
Class ReadOnlyFieldMetadata

java.lang.Object
  extended by org.springframework.binding.value.support.AbstractPropertyChangePublisher
      extended by org.springframework.binding.form.support.ReadOnlyFieldMetadata
All Implemented Interfaces:
FieldMetadata, PropertyChangePublisher

public class ReadOnlyFieldMetadata
extends AbstractPropertyChangePublisher
implements FieldMetadata


Field Summary
 
Fields inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
logger
 
Fields inherited from interface org.springframework.binding.form.FieldMetadata
DIRTY_PROPERTY, ENABLED_PROPERTY, READ_ONLY_PROPERTY
 
Constructor Summary
ReadOnlyFieldMetadata(FormModel formModel, Class propertyType)
           
ReadOnlyFieldMetadata(FormModel formModel, Class propertyType, Map userMetadata)
           
 
Method Summary
 Map getAllUserMetadata()
          Returns all custom metadata associated with this property in the form of a Map.
 Class getPropertyType()
          Return the type of this property.
 Object getUserMetadata(String key)
          Returns custom metadata that may be associated with this property.
 boolean isDirty()
          Returns whether or not the property is dirty.
 boolean isEnabled()
          Returns whether or not the property is enabled.
 boolean isReadOnly()
          Returns whether or not the property is read only.
 void setEnabled(boolean enabled)
          Sets the enabled value for this property.
 void setReadOnly(boolean readOnly)
          Sets whether or not this property is read only.
 
Methods inherited from class org.springframework.binding.value.support.AbstractPropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, firePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

ReadOnlyFieldMetadata

public ReadOnlyFieldMetadata(FormModel formModel,
                             Class propertyType)

ReadOnlyFieldMetadata

public ReadOnlyFieldMetadata(FormModel formModel,
                             Class propertyType,
                             Map userMetadata)
Method Detail

getAllUserMetadata

public Map getAllUserMetadata()
Description copied from interface: FieldMetadata
Returns all custom metadata associated with this property in the form of a Map.

Specified by:
getAllUserMetadata in interface FieldMetadata
Returns:
Map containing String keys

getPropertyType

public Class getPropertyType()
Description copied from interface: FieldMetadata
Return the type of this property.

Specified by:
getPropertyType in interface FieldMetadata

getUserMetadata

public Object getUserMetadata(String key)
Description copied from interface: FieldMetadata
Returns custom metadata that may be associated with this property.

Specified by:
getUserMetadata in interface FieldMetadata

isDirty

public boolean isDirty()
Description copied from interface: FieldMetadata
Returns whether or not the property is dirty.

Specified by:
isDirty in interface FieldMetadata

isEnabled

public boolean isEnabled()
Description copied from interface: FieldMetadata
Returns whether or not the property is enabled.

A property is enabled if all of the following are true:

Specified by:
isEnabled in interface FieldMetadata

isReadOnly

public boolean isReadOnly()
Description copied from interface: FieldMetadata
Returns whether or not the property is read only.

A property is read only if any of the following are true:

Specified by:
isReadOnly in interface FieldMetadata

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: FieldMetadata
Sets the enabled value for this property.

It's expected that controls bound to this form property will listen for changes to this value and if possible modify their display/behaviour to reflect the new state.

This value will be propagated up to any descendants.

Specified by:
setEnabled in interface FieldMetadata
Parameters:
enabled - should this property be enabled

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: FieldMetadata
Sets whether or not this property is read only.

It's expected that controls bound to this form property will listen for changes to this value and if possible modify their display/behaviour to reflect the new state. e.g. When this property becomes true a text component would grey its self out and prevent any editing.

This value will be propagated up to any descendants.

Specified by:
setReadOnly in interface FieldMetadata
Parameters:
readOnly - should this property be read only


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.