org.springframework.richclient.form.binding.support
Class AbstractBinding

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.factory.AbstractControlFactory
          extended by org.springframework.richclient.form.binding.support.AbstractBinding
All Implemented Interfaces:
ControlFactory, Binding
Direct Known Subclasses:
AbstractListBinding, CustomBinding, FormattedTextFieldBinding, ShuttleListBinding, TextComponentBinding

public abstract class AbstractBinding
extends AbstractControlFactory
implements Binding

Default base implementation of Binding. Provides helper methods for access to commonly needed properties.

Author:
Oliver Hutchison

Field Summary
protected  FieldMetadata fieldMetadata
           
protected  FormModel formModel
           
protected  String formPropertyPath
           
 
Fields inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
logger
 
Constructor Summary
protected AbstractBinding(FormModel formModel, String formPropertyPath, Class requiredSourceClass)
           
 
Method Summary
protected  JComponent createControl()
          Subclasses must override this method to create a new instance of the control that this factory produces.
protected abstract  JComponent doBindControl()
           
protected abstract  void enabledChanged()
          Called when the enabled state of the bound property changes.
protected  FieldFace getFieldFace()
           
 FormModel getFormModel()
          Returns the form model that this binding is for.
 String getProperty()
          Returns the property that this binding is for.
protected  Class getPropertyType()
           
protected  Object getValue()
           
protected  ValueModel getValueModel()
           
protected  boolean isEnabled()
          Is the bound property in the enabled state.
protected  boolean isReadOnly()
          Is the bound property in the read only state.
protected abstract  void readOnlyChanged()
          Called when the read only state of the bound property changes.
 
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.form.binding.Binding
getControl
 

Field Detail

formModel

protected final FormModel formModel

formPropertyPath

protected final String formPropertyPath

fieldMetadata

protected final FieldMetadata fieldMetadata
Constructor Detail

AbstractBinding

protected AbstractBinding(FormModel formModel,
                          String formPropertyPath,
                          Class requiredSourceClass)
Method Detail

getProperty

public String getProperty()
Description copied from interface: Binding
Returns the property that this binding is for.

Specified by:
getProperty in interface Binding

getFormModel

public FormModel getFormModel()
Description copied from interface: Binding
Returns the form model that this binding is for.

Specified by:
getFormModel in interface Binding

getFieldFace

protected FieldFace getFieldFace()

getPropertyType

protected Class getPropertyType()

createControl

protected JComponent createControl()
Description copied from class: AbstractControlFactory
Subclasses must override this method to create a new instance of the control that this factory produces.

Specified by:
createControl in class AbstractControlFactory
Returns:
The newly created control, never null.

doBindControl

protected abstract JComponent doBindControl()

readOnlyChanged

protected abstract void readOnlyChanged()
Called when the read only state of the bound property changes.

See Also:
FormPropertyState

enabledChanged

protected abstract void enabledChanged()
Called when the enabled state of the bound property changes.

See Also:
FormPropertyState

isReadOnly

protected boolean isReadOnly()
Is the bound property in the read only state.

See Also:
FormPropertyState

isEnabled

protected boolean isEnabled()
Is the bound property in the enabled state.

See Also:
FormPropertyState

getValueModel

protected ValueModel getValueModel()

getValue

protected Object getValue()


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