org.springframework.richclient.form.builder
Class AbstractFormBuilder

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.form.builder.AbstractFormBuilder
Direct Known Subclasses:
FormLayoutFormBuilder, GridBagLayoutFormBuilder, HtmlFormBuilder, TableFormBuilder

public abstract class AbstractFormBuilder
extends Object

Base class for form builders.

Author:
oliverh, Mathias Broekelmann

Constructor Summary
protected AbstractFormBuilder(BindingFactory bindingFactory)
          Default constructor providing the BindingFactory.
 
Method Summary
protected  Binding createBinding(String fieldName, JComponent component)
          Create a binding that uses the given component instead of its default component.
protected  Binding createBinding(String fieldName, JComponent component, Map context)
          Create a binding that uses the given component instead of its default component.
protected  Binding createDefaultBinding(String fieldName)
          Create a binding by looking up the appropriate registered binding.
protected  JLabel createLabelFor(String fieldName, JComponent component)
          Create a label for the property.
protected  JPasswordField createPasswordField(String fieldName)
          Create a password field for the given property.
protected  JComponent createScrollPane(String fieldName, JComponent component)
          Creates a component which is used as a scrollpane for a component
protected  JComponent createSelector(String fieldName, Constraint filter)
          Creates a component which is used as a selector in the form.
protected  JComponent createTextArea(String fieldName)
          Create a textarea for the given property.
protected  BindingFactory getBindingFactory()
          Returns the BindingFactory.
protected  ComponentFactory getComponentFactory()
          Returns the ComponentFactory that delivers all the visual components.
protected  FormComponentInterceptor getFormComponentInterceptor()
          Returns the FormComponentInterceptor that will be used when creating a component with this builder.
protected  FormModel getFormModel()
          Convenience method to return the formModel that is used in the BindingFactory and that should be used in the builder.
 void setComponentFactory(ComponentFactory componentFactory)
          Set the ComponentFactory.
 void setFormComponentInterceptorFactory(FormComponentInterceptorFactory interceptorFactory)
          Set the factory that delivers the FormComponentInterceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFormBuilder

protected AbstractFormBuilder(BindingFactory bindingFactory)
Default constructor providing the BindingFactory.

Parameters:
bindingFactory - the factory creating the Bindings.
Method Detail

getFormComponentInterceptor

protected FormComponentInterceptor getFormComponentInterceptor()
Returns the FormComponentInterceptor that will be used when creating a component with this builder.


setFormComponentInterceptorFactory

public void setFormComponentInterceptorFactory(FormComponentInterceptorFactory interceptorFactory)
Set the factory that delivers the FormComponentInterceptor.


getComponentFactory

protected ComponentFactory getComponentFactory()
Returns the ComponentFactory that delivers all the visual components.


setComponentFactory

public void setComponentFactory(ComponentFactory componentFactory)
Set the ComponentFactory.


getBindingFactory

protected BindingFactory getBindingFactory()
Returns the BindingFactory.


getFormModel

protected FormModel getFormModel()
Convenience method to return the formModel that is used in the BindingFactory and that should be used in the builder.


createDefaultBinding

protected Binding createDefaultBinding(String fieldName)
Create a binding by looking up the appropriate registered binding.

Parameters:
fieldName - the name of the property to bind.
Returns:
the Binding for the property which provides a component that is bound to the valueModel of the property.

createBinding

protected Binding createBinding(String fieldName,
                                JComponent component)
Create a binding that uses the given component instead of its default component.

Parameters:
fieldName - the name of the property to bind.
component - the component to bind to the property.
Returns:
the Binding that binds the component to the valuemodel of the property.

createBinding

protected Binding createBinding(String fieldName,
                                JComponent component,
                                Map context)
Create a binding that uses the given component instead of its default component. Additionally providing a context which is used by the binding to allow custom settings.

Parameters:
fieldName - the name of the property to bind.
component - the component to bind to the property.
context - a map of with additional settings providing a specific context.
Returns:
the Binding that binds the component to the valuemodel of the property.

createSelector

protected JComponent createSelector(String fieldName,
                                    Constraint filter)
Creates a component which is used as a selector in the form. This implementation creates a JComboBox

Parameters:
fieldName - the name of the field for the selector
filter - an optional filter constraint
Returns:
the component to use for a selector, not null

createScrollPane

protected JComponent createScrollPane(String fieldName,
                                      JComponent component)
Creates a component which is used as a scrollpane for a component

Parameters:
fieldName - the fieldname for the scrollpane
component - the component to place into the scrollpane
Returns:
the scrollpane component

createPasswordField

protected JPasswordField createPasswordField(String fieldName)
Create a password field for the given property.

Parameters:
fieldName - the name of the property.
Returns:
the password field.

createTextArea

protected JComponent createTextArea(String fieldName)
Create a textarea for the given property.

Parameters:
fieldName - the name of the property.
Returns:
the textarea.

createLabelFor

protected JLabel createLabelFor(String fieldName,
                                JComponent component)
Create a label for the property.

Parameters:
fieldName - the name of the property.
component - the component of the property which is related to the label.
Returns:
a JLabel for the property.


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