org.springframework.richclient.form.builder
Class GridBagLayoutFormBuilder

java.lang.Object
  extended by org.springframework.richclient.form.builder.AbstractFormBuilder
      extended by org.springframework.richclient.form.builder.GridBagLayoutFormBuilder
All Implemented Interfaces:
LayoutBuilder

public class GridBagLayoutFormBuilder
extends AbstractFormBuilder
implements LayoutBuilder

See Also:
GridBagLayoutFormBuilder.FormModelAwareGridBagLayoutBuilder

Nested Class Summary
protected  class GridBagLayoutFormBuilder.FormModelAwareGridBagLayoutBuilder
           
 
Constructor Summary
GridBagLayoutFormBuilder(BindingFactory bindingFactory)
           
 
Method Summary
 GridBagLayoutFormBuilder appendLabeledField(String propertyName)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendLabeledField(String propertyName, int colSpan)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendLabeledField(String propertyName, JComponent field, LabelOrientation labelOrientation)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendLabeledField(String propertyName, JComponent field, LabelOrientation labelOrientation, int colSpan)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendLabeledField(String propertyName, JComponent field, LabelOrientation labelOrientation, int colSpan, int rowSpan, boolean expandX, boolean expandY)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendLabeledField(String propertyName, LabelOrientation labelOrientation)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendLabeledField(String propertyName, LabelOrientation labelOrientation, int colSpan)
          Appends a label and field to the end of the current line.
 GridBagLayoutFormBuilder appendSeparator()
          Appends a separator (usually a horizontal line).
 GridBagLayoutFormBuilder appendSeparator(String labelKey)
          Appends a separator (usually a horizontal line) using the provided string as the key to look in the ComponentFactory'smessage bundle for the text to put along with the separator.
 GridBagLayoutBuilder getBuilder()
          Returns the underlying GridBagLayoutFormBuilder.FormModelAwareGridBagLayoutBuilder.
 JPanel getPanel()
          Creates and returns a JPanel with all the given components in it, using the "hints" that were provided to the builder.
 GridBagLayoutFormBuilder nextLine()
          Ends the current line and starts a new one
 void setAutoSpanLastComponent(boolean autoSpanLastComponent)
           
 void setComponentFactory(ComponentFactory componentFactory)
          Set the ComponentFactory.
 void setShowGuidelines(boolean showGuidelines)
          Should this show "guidelines"? Useful for debugging layouts.
 
Methods inherited from class org.springframework.richclient.form.builder.AbstractFormBuilder
createBinding, createBinding, createDefaultBinding, createLabelFor, createPasswordField, createScrollPane, createSelector, createTextArea, getBindingFactory, getComponentFactory, getFormComponentInterceptor, getFormModel, setFormComponentInterceptorFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridBagLayoutFormBuilder

public GridBagLayoutFormBuilder(BindingFactory bindingFactory)
Method Detail

getBuilder

public final GridBagLayoutBuilder getBuilder()
Returns the underlying GridBagLayoutFormBuilder.FormModelAwareGridBagLayoutBuilder. Should be used with caution.

Returns:
never null

setComponentFactory

public void setComponentFactory(ComponentFactory componentFactory)
Description copied from class: AbstractFormBuilder
Set the ComponentFactory.

Overrides:
setComponentFactory in class AbstractFormBuilder

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormModelHelper#createBoundControl(String)

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName,
                                                   int colSpan)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
colSpan - the number of columns the field should span
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormModelHelper#createBoundControl(String)

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName,
                                                   LabelOrientation labelOrientation)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormModelHelper#createBoundControl(String)

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName,
                                                   LabelOrientation labelOrientation,
                                                   int colSpan)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
colSpan - the number of columns the field should span
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormModelHelper#createBoundControl(String)

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName,
                                                   JComponent field,
                                                   LabelOrientation labelOrientation)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormModelHelper#createBoundControl(String)

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName,
                                                   JComponent field,
                                                   LabelOrientation labelOrientation,
                                                   int colSpan)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
colSpan - the number of columns the field should span
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormComponentInterceptor.processLabel(String, JComponent)

appendLabeledField

public GridBagLayoutFormBuilder appendLabeledField(String propertyName,
                                                   JComponent field,
                                                   LabelOrientation labelOrientation,
                                                   int colSpan,
                                                   int rowSpan,
                                                   boolean expandX,
                                                   boolean expandY)
Appends a label and field to the end of the current line.

The label will be to the left of the field, and be right-justified.
The field will "grow" horizontally as space allows.

Parameters:
propertyName - the name of the property to create the controls for
colSpan - the number of columns the field should span
Returns:
"this" to make it easier to string together append calls
See Also:
FormModelHelper#createLabel(String), FormComponentInterceptor.processLabel(String, JComponent)

appendSeparator

public GridBagLayoutFormBuilder appendSeparator()
Appends a separator (usually a horizontal line). Has an implicit nextLine()before and after it.

Returns:
"this" to make it easier to string together append calls

appendSeparator

public GridBagLayoutFormBuilder appendSeparator(String labelKey)
Appends a separator (usually a horizontal line) using the provided string as the key to look in the ComponentFactory'smessage bundle for the text to put along with the separator. Has an implicit nextLine()before and after it.

Returns:
"this" to make it easier to string together append calls

nextLine

public GridBagLayoutFormBuilder nextLine()
Ends the current line and starts a new one

Returns:
"this" to make it easier to string together append calls

setShowGuidelines

public void setShowGuidelines(boolean showGuidelines)
Should this show "guidelines"? Useful for debugging layouts.


getPanel

public JPanel getPanel()
Creates and returns a JPanel with all the given components in it, using the "hints" that were provided to the builder.

Specified by:
getPanel in interface LayoutBuilder
Returns:
a new JPanel with the components laid-out in it

setAutoSpanLastComponent

public void setAutoSpanLastComponent(boolean autoSpanLastComponent)
See Also:
GridBagLayoutBuilder.setAutoSpanLastComponent(boolean)


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