org.riotfamily.pages.riot.form
Class LocalizedEditorBinder

java.lang.Object
  extended by org.riotfamily.pages.riot.form.LocalizedEditorBinder
All Implemented Interfaces:
EditorBinder, PropertyEditorRegistry

public class LocalizedEditorBinder
extends Object
implements EditorBinder

EditorBinder for localized elements that returns null, if the value is not overwritten.


Constructor Summary
LocalizedEditorBinder(EditorBinder delegate)
           
 
Method Summary
 void bind(Editor editor, String property)
          Binds the given editor to the property with the specified name.
 PropertyEditor findCustomEditor(Class requiredType, String propertyPath)
           
 Object getBackingObject()
           
 Class<?> getBeanClass()
           
 Map<String,EditorBinding> getBindings()
           
 String[] getBoundProperties()
          Returns the names of all properties an editor is bound to.
 Editor getEditor(String property)
          Returns the editor that is bound to the given property.
 PropertyEditor getPropertyEditor(Class<?> type, String propertyPath)
           
 Class<?> getPropertyType(String property)
           
 Object getPropertyValue(String property)
           
 void initEditors()
          Initializes each editor with the property value it is bound to or null if the backingObject is not set.
 boolean isEditingExistingBean()
           
 Object populateBackingObject()
          Sets the properties of the backingObject to the values provided by the corresponding editor.
 void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)
           
 void registerCustomEditor(Class requiredType, String propertyPath, PropertyEditor propertyEditor)
           
 void registerElement(EditorBinding binding, AbstractLocalizedElement editor)
           
 void registerPropertyEditors(PropertyEditorRegistrar[] registrars)
           
 EditorBinder replace(EditorBinder previousBinder)
           
 void setBackingObject(Object backingObject)
           
 void setPropertyValue(String property, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizedEditorBinder

public LocalizedEditorBinder(EditorBinder delegate)
Method Detail

registerElement

public void registerElement(EditorBinding binding,
                            AbstractLocalizedElement editor)

populateBackingObject

public Object populateBackingObject()
Description copied from interface: EditorBinder
Sets the properties of the backingObject to the values provided by the corresponding editor. If the backingObject is null a new instance is created.

Specified by:
populateBackingObject in interface EditorBinder
Returns:
the populated backingObject

bind

public void bind(Editor editor,
                 String property)
Description copied from interface: EditorBinder
Binds the given editor to the property with the specified name.

Specified by:
bind in interface EditorBinder
Parameters:
editor - the editor to bind
property - the name of the property the editor is to be bound to

findCustomEditor

public PropertyEditor findCustomEditor(Class requiredType,
                                       String propertyPath)
Specified by:
findCustomEditor in interface PropertyEditorRegistry

getBackingObject

public Object getBackingObject()
Specified by:
getBackingObject in interface EditorBinder

getBeanClass

public Class<?> getBeanClass()
Specified by:
getBeanClass in interface EditorBinder

getBindings

public Map<String,EditorBinding> getBindings()
Specified by:
getBindings in interface EditorBinder

getBoundProperties

public String[] getBoundProperties()
Description copied from interface: EditorBinder
Returns the names of all properties an editor is bound to.

Specified by:
getBoundProperties in interface EditorBinder

getEditor

public Editor getEditor(String property)
Description copied from interface: EditorBinder
Returns the editor that is bound to the given property.

Specified by:
getEditor in interface EditorBinder

getPropertyType

public Class<?> getPropertyType(String property)
Specified by:
getPropertyType in interface EditorBinder

getPropertyValue

public Object getPropertyValue(String property)
Specified by:
getPropertyValue in interface EditorBinder

getPropertyEditor

public PropertyEditor getPropertyEditor(Class<?> type,
                                        String propertyPath)
Specified by:
getPropertyEditor in interface EditorBinder

initEditors

public void initEditors()
Description copied from interface: EditorBinder
Initializes each editor with the property value it is bound to or null if the backingObject is not set.

Specified by:
initEditors in interface EditorBinder
See Also:
Editor.setValue(Object)

isEditingExistingBean

public boolean isEditingExistingBean()
Specified by:
isEditingExistingBean in interface EditorBinder

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 PropertyEditor propertyEditor)
Specified by:
registerCustomEditor in interface PropertyEditorRegistry

registerCustomEditor

public void registerCustomEditor(Class requiredType,
                                 String propertyPath,
                                 PropertyEditor propertyEditor)
Specified by:
registerCustomEditor in interface PropertyEditorRegistry

registerPropertyEditors

public void registerPropertyEditors(PropertyEditorRegistrar[] registrars)
Specified by:
registerPropertyEditors in interface EditorBinder

replace

public EditorBinder replace(EditorBinder previousBinder)
Specified by:
replace in interface EditorBinder

setBackingObject

public void setBackingObject(Object backingObject)
Specified by:
setBackingObject in interface EditorBinder

setPropertyValue

public void setPropertyValue(String property,
                             Object value)
Specified by:
setPropertyValue in interface EditorBinder