org.springframework.richclient.form.builder
Class FormLayoutFormBuilder

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.form.builder.AbstractFormBuilder
      extended by org.springframework.richclient.form.builder.FormLayoutFormBuilder

public class FormLayoutFormBuilder
extends AbstractFormBuilder

Layout builder based on the JGoodies Framework.

Shortcuts have been provided to directly place a local and a component. For this, you provide the coordinates for the label (x, y), and the component will be places (x + 2, y). If width or height spanning is provided, this will be applied to the component.

 FormBuilder builder = new FormBuilder(getBindingFactory(), myLayout);
 //... add everything ...
 JPanel myFirstPanel = builder.getPanel();
 // set new layout, new panel
 builder.setPanel(mySecondLayout);
 //... add everything ...
 JPanel mySecondPanel = builder.getPanel();
 

Author:
jh

Nested Class Summary
static class FormLayoutFormBuilder.FormModelEnabledListener
           
 
Field Summary
static String ALIGN_LEFT_BOTTOM
           
static String ALIGN_LEFT_CENTER
           
static String ALIGN_LEFT_TOP
           
static String ALIGN_RIGHT_BOTTOM
           
static String ALIGN_RIGHT_CENTER
           
static String ALIGN_RIGHT_TOP
           
 
Constructor Summary
FormLayoutFormBuilder(BindingFactory bindingFactory, com.jgoodies.forms.layout.FormLayout layout)
          Constructor.
FormLayoutFormBuilder(BindingFactory bindingFactory, com.jgoodies.forms.layout.FormLayout layout, JPanel panel)
          Constructor.
 
Method Summary
 JComponent addBinding(Binding binding)
          Add a binder to column 1 and the current row.
 JComponent addBinding(Binding binding, int column)
          Add a binder to a column and the current row.
 JComponent addBinding(Binding binding, int column, int row)
          Add a binder to a column and a row.
 JComponent addBinding(Binding binding, int column, int row, int widthSpan, int heightSpan)
          Add a binder to a column and a row with width and height spanning.
 void addComponent(JComponent component)
           
 void addComponent(JComponent component, int column)
           
 void addComponent(JComponent component, int column, int row)
           
 void addComponent(JComponent component, int column, int row, int widthSpan, int heightSpan)
           
 void addComponent(JComponent component, int column, int row, int widthSpan, int heightSpan, String attributes)
           
 void addHorizontalSeparator()
           
 void addHorizontalSeparator(int widthSpan)
           
 void addHorizontalSeparator(int column, int widthSpan)
           
 void addHorizontalSeparator(int column, int row, int widthSpan)
           
 void addHorizontalSeparator(String text)
           
 void addHorizontalSeparator(String text, int widthSpan)
           
 void addHorizontalSeparator(String text, int column, int widthSpan)
           
 JLabel addLabel(String property)
           
 JLabel addLabel(String property, int column)
           
 JLabel addLabel(String property, int column, int row)
           
 JLabel addLabel(String property, int column, int row, String attributes)
           
 JLabel addLabel(String property, JComponent forComponent, int column, int row)
           
 JLabel addLabel(String property, JComponent forComponent, int column, int row, int widthSpan, int heightSpan, String attributes)
           
 JComponent addNestedPropertyReadOnly(String property, String nestedProperty)
           
 JComponent addNestedPropertyReadOnly(String property, String nestedProperty, int column)
           
 JComponent addNestedPropertyReadOnly(String property, String nestedProperty, int column, int row)
           
 JComponent addNestedPropertyReadOnly(String property, String nestedProperty, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addNestedPropertyReadOnlyAndLabel(String property, String nestedProperty)
           
 JComponent[] addNestedPropertyReadOnlyAndLabel(String property, String nestedProperty, int column)
           
 JComponent[] addNestedPropertyReadOnlyAndLabel(String property, String nestedProperty, int column, int row)
           
 JComponent[] addNestedPropertyReadOnlyAndLabel(String property, String nestedProperty, int column, int row, int widthSpan, int heightSpan)
           
 JComponent addPasswordField(String propertyName)
           
 JComponent addPasswordField(String propertyName, int column)
           
 JComponent addPasswordField(String propertyName, int column, int row)
           
 JComponent addPasswordField(String propertyName, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addPasswordFieldAndLabel(String propertyName)
           
 JComponent[] addPasswordFieldAndLabel(String propertyName, int column)
           
 JComponent[] addPasswordFieldAndLabel(String propertyName, int column, int row)
           
 JComponent[] addPasswordFieldAndLabel(String propertyName, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addPasswordFieldAndLabel(String propertyName, int column, int row, int widthSpan, int heightSpan, String attributes)
           
 JComponent[] addPasswordFieldAndLabel(String propertyName, int column, int row, String attributes)
           
 JComponent addProperty(String property)
          Add a property to column 1 and the current row.
 JComponent addProperty(String property, int column)
          Add a property to a column and the current row.
 JComponent addProperty(String property, int column, int row)
           
 JComponent addProperty(String property, int column, int row, int widthSpan, int heightSpan)
           
 JComponent addProperty(String property, String binderId)
           
 JComponent addProperty(String property, String binderId, int column)
           
 JComponent addProperty(String property, String binderId, int column, int row)
           
 JComponent addProperty(String property, String binderId, int column, int row, int widthSpan, int heightSpan)
           
 JComponent addProperty(String property, String binderId, Map<?,?> contextMap)
           
 JComponent addProperty(String property, String binderId, Map<?,?> contextMap, int column)
           
 JComponent addProperty(String property, String binderId, Map<?,?> contextMap, int column, int row)
           
 JComponent addProperty(String property, String binderId, Map<?,?> contextMap, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addPropertyAndLabel(String property)
           
 JComponent[] addPropertyAndLabel(String property, int column)
           
 JComponent[] addPropertyAndLabel(String property, int column, int row)
           
 JComponent[] addPropertyAndLabel(String property, int column, int row, int widthSpan)
           
 JComponent[] addPropertyAndLabel(String property, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addPropertyAndLabel(String property, int column, int row, int widthSpan, int heightSpan, String attributes)
           
 JComponent[] addPropertyAndLabel(String property, int column, int row, int widthSpan, String attributes)
           
 JComponent[] addPropertyAndLabel(String property, int column, int row, String attributes)
           
 JComponent[] addPropertyAndLabel(String property, int column, String binderId)
           
 JComponent[] addPropertyAndLabel(String property, String binderId)
           
 JComponent[] addPropertyAndLabel(String property, String binderId, int column, int row)
           
 JComponent[] addPropertyAndLabel(String property, String binderId, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addPropertyAndLabel(String property, String binderId, int column, int row, int widthSpan, int heightSpan, String attributes)
           
 JComponent[] addPropertyAndLabel(String property, String binderId, int column, int row, int widthSpan, String attributes)
           
 JComponent[] addPropertyAndLabel(String property, String binderId, int column, int row, String attributes)
           
 JComponent[] addTextArea(String propertyName)
           
 JComponent[] addTextArea(String propertyName, int column)
           
 JComponent[] addTextArea(String propertyName, int column, int row)
           
 JComponent[] addTextArea(String propertyName, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addTextArea(String propertyName, int column, int row, int widthSpan, int heightSpan, int vsbPolicy, int hsbPolicy)
           
 JComponent[] addTextAreaAndLabel(String propertyName, int column, int row)
           
 JComponent[] addTextAreaAndLabel(String propertyName, int column, int row, int widthSpan, int heightSpan)
           
 JComponent[] addTextAreaAndLabel(String propertyName, int column, int row, int widthSpan, int heightSpan, String attributes)
           
 JComponent[] addTextAreaAndLabel(String propertyName, int column, int row, String attributes)
           
 void addVerticalSeparator()
           
 void addVerticalSeparator(int heightSpan)
           
 void addVerticalSeparator(int column, int heightSpan)
           
 void addVerticalSeparator(int column, int row, int heightSpan)
           
 FormLayoutFormBuilder.FormModelEnabledListener getFormModelEnabledListener()
           
 JPanel getPanel()
           
 int getRow()
          Returns the current row.
 FormLayoutFormBuilder nextRow()
          Move to the next line, minding the line gap
 FormLayoutFormBuilder nextRow(com.jgoodies.forms.layout.RowSpec rowSpec)
           
 FormLayoutFormBuilder nextRow(String rowSpec)
           
 void setBorder(Border border)
          Set the border for the panel.
 void setComponentAttributes(String attributes)
           
 void setLabelAttributes(String attributes)
           
 void setLayout(com.jgoodies.forms.layout.FormLayout layout)
          Create a new panel with the provided layout en default DIALOG_BORDER.
 void setLayout(com.jgoodies.forms.layout.FormLayout layout, JPanel panel)
          Set a panel with the provided layout layout.
 void setRow(int row)
          Sets the current row
 
Methods inherited from class org.springframework.richclient.form.builder.AbstractFormBuilder
createBinding, createBinding, createDefaultBinding, createLabelFor, createPasswordField, createScrollPane, createSelector, createTextArea, getBindingFactory, getComponentFactory, getFormComponentInterceptor, getFormModel, setComponentFactory, setFormComponentInterceptorFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_LEFT_TOP

public static final String ALIGN_LEFT_TOP
See Also:
Constant Field Values

ALIGN_LEFT_CENTER

public static final String ALIGN_LEFT_CENTER
See Also:
Constant Field Values

ALIGN_LEFT_BOTTOM

public static final String ALIGN_LEFT_BOTTOM
See Also:
Constant Field Values

ALIGN_RIGHT_TOP

public static final String ALIGN_RIGHT_TOP
See Also:
Constant Field Values

ALIGN_RIGHT_CENTER

public static final String ALIGN_RIGHT_CENTER
See Also:
Constant Field Values

ALIGN_RIGHT_BOTTOM

public static final String ALIGN_RIGHT_BOTTOM
See Also:
Constant Field Values
Constructor Detail

FormLayoutFormBuilder

public FormLayoutFormBuilder(BindingFactory bindingFactory,
                             com.jgoodies.forms.layout.FormLayout layout)
Constructor.

Parameters:
bindingFactory - BindingFactory.
layout - JGoodies FormLayout

FormLayoutFormBuilder

public FormLayoutFormBuilder(BindingFactory bindingFactory,
                             com.jgoodies.forms.layout.FormLayout layout,
                             JPanel panel)
Constructor.

Parameters:
bindingFactory - BindingFactory.
layout - JGoodies FormLayout
panel - JPanel on which the builder will place the components.
Method Detail

nextRow

public FormLayoutFormBuilder nextRow()
Move to the next line, minding the line gap

Returns:
This FormBuilder

nextRow

public FormLayoutFormBuilder nextRow(String rowSpec)

nextRow

public FormLayoutFormBuilder nextRow(com.jgoodies.forms.layout.RowSpec rowSpec)

getRow

public int getRow()
Returns the current row. If the layout is initialized, the row is set to -1. Calling getRow() will result in setting the row to 1 to allow direct usage of getRow().

Returns:
the current row

setRow

public void setRow(int row)
Sets the current row

Parameters:
row - The current row

setLayout

public void setLayout(com.jgoodies.forms.layout.FormLayout layout)
Create a new panel with the provided layout en default DIALOG_BORDER.

Parameters:
layout - JGoodies FormLayout

setLayout

public void setLayout(com.jgoodies.forms.layout.FormLayout layout,
                      JPanel panel)
Set a panel with the provided layout layout.

Parameters:
layout - JGoodies FormLayout
panel - JPanel on which the builder will place the components.

setBorder

public void setBorder(Border border)
Set the border for the panel.

Parameters:
border - The border for the panel

addBinding

public JComponent addBinding(Binding binding)
Add a binder to column 1 and the current row. Equals to builder.addBinding(component, 1, builder.getRow()).

Parameters:
binding - The binding to add
See Also:
addBinding(Binding, int, int)

addBinding

public JComponent addBinding(Binding binding,
                             int column)
Add a binder to a column and the current row. Equals to builder.addBinding(component, column, builder.getRow()).

Parameters:
binding - The binding to add
column - The column on which the binding must be added
Returns:
The component produced by the binding
See Also:
addBinding(Binding, int, int)

addBinding

public JComponent addBinding(Binding binding,
                             int column,
                             int row)
Add a binder to a column and a row. Equals to builder.addBinding(component, column, row).

Parameters:
binding - The binding to add
column - The column on which the binding must be added
column - The row on which the binding must be added
Returns:
The component produced by the binding
See Also:
addBinding(Binding, int, int, int, int)

addBinding

public JComponent addBinding(Binding binding,
                             int column,
                             int row,
                             int widthSpan,
                             int heightSpan)
Add a binder to a column and a row with width and height spanning.


addProperty

public JComponent addProperty(String property)
Add a property to column 1 and the current row. Equals to builder.addBinding(component, 1, builder.getRow()).

See Also:
addProperty(String, int, int)

addProperty

public JComponent addProperty(String property,
                              int column)
Add a property to a column and the current row. Equals to builder.addBinding(component, column, builder.getRow()).

See Also:
addProperty(String, int, int)

addProperty

public JComponent addProperty(String property,
                              String binderId)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              Map<?,?> contextMap)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              int column)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              Map<?,?> contextMap,
                              int column)

addProperty

public JComponent addProperty(String property,
                              int column,
                              int row)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              int column,
                              int row)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              Map<?,?> contextMap,
                              int column,
                              int row)

addProperty

public JComponent addProperty(String property,
                              int column,
                              int row,
                              int widthSpan,
                              int heightSpan)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              int column,
                              int row,
                              int widthSpan,
                              int heightSpan)

addProperty

public JComponent addProperty(String property,
                              String binderId,
                              Map<?,?> contextMap,
                              int column,
                              int row,
                              int widthSpan,
                              int heightSpan)

addLabel

public JLabel addLabel(String property)

addLabel

public JLabel addLabel(String property,
                       int column)

addLabel

public JLabel addLabel(String property,
                       int column,
                       int row)

addLabel

public JLabel addLabel(String property,
                       int column,
                       int row,
                       String attributes)

addLabel

public JLabel addLabel(String property,
                       JComponent forComponent,
                       int column,
                       int row)

addLabel

public JLabel addLabel(String property,
                       JComponent forComponent,
                       int column,
                       int row,
                       int widthSpan,
                       int heightSpan,
                       String attributes)

addComponent

public void addComponent(JComponent component)

addComponent

public void addComponent(JComponent component,
                         int column)

addComponent

public void addComponent(JComponent component,
                         int column,
                         int row)

addComponent

public void addComponent(JComponent component,
                         int column,
                         int row,
                         int widthSpan,
                         int heightSpan)

addComponent

public void addComponent(JComponent component,
                         int column,
                         int row,
                         int widthSpan,
                         int heightSpan,
                         String attributes)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        String binderId)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        String binderId)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        int row)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        String binderId,
                                        int column,
                                        int row)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        int row,
                                        String attributes)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        String binderId,
                                        int column,
                                        int row,
                                        String attributes)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        int row,
                                        int widthSpan)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        String attributes)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        String binderId,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        String attributes)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        int heightSpan)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        String binderId,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        int heightSpan)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        int heightSpan,
                                        String attributes)

addPropertyAndLabel

public JComponent[] addPropertyAndLabel(String property,
                                        String binderId,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        int heightSpan,
                                        String attributes)

getPanel

public JPanel getPanel()

setLabelAttributes

public void setLabelAttributes(String attributes)

setComponentAttributes

public void setComponentAttributes(String attributes)

addTextArea

public JComponent[] addTextArea(String propertyName,
                                int column,
                                int row)

addTextArea

public JComponent[] addTextArea(String propertyName,
                                int column)

addTextArea

public JComponent[] addTextArea(String propertyName)

addTextArea

public JComponent[] addTextArea(String propertyName,
                                int column,
                                int row,
                                int widthSpan,
                                int heightSpan)

addTextArea

public JComponent[] addTextArea(String propertyName,
                                int column,
                                int row,
                                int widthSpan,
                                int heightSpan,
                                int vsbPolicy,
                                int hsbPolicy)

addTextAreaAndLabel

public JComponent[] addTextAreaAndLabel(String propertyName,
                                        int column,
                                        int row)

addTextAreaAndLabel

public JComponent[] addTextAreaAndLabel(String propertyName,
                                        int column,
                                        int row,
                                        String attributes)

addTextAreaAndLabel

public JComponent[] addTextAreaAndLabel(String propertyName,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        int heightSpan)

addTextAreaAndLabel

public JComponent[] addTextAreaAndLabel(String propertyName,
                                        int column,
                                        int row,
                                        int widthSpan,
                                        int heightSpan,
                                        String attributes)

addPasswordField

public JComponent addPasswordField(String propertyName,
                                   int column)

addPasswordField

public JComponent addPasswordField(String propertyName)

addPasswordField

public JComponent addPasswordField(String propertyName,
                                   int column,
                                   int row)

addPasswordField

public JComponent addPasswordField(String propertyName,
                                   int column,
                                   int row,
                                   int widthSpan,
                                   int heightSpan)

addPasswordFieldAndLabel

public JComponent[] addPasswordFieldAndLabel(String propertyName,
                                             int column)

addPasswordFieldAndLabel

public JComponent[] addPasswordFieldAndLabel(String propertyName)

addPasswordFieldAndLabel

public JComponent[] addPasswordFieldAndLabel(String propertyName,
                                             int column,
                                             int row)

addPasswordFieldAndLabel

public JComponent[] addPasswordFieldAndLabel(String propertyName,
                                             int column,
                                             int row,
                                             String attributes)

addPasswordFieldAndLabel

public JComponent[] addPasswordFieldAndLabel(String propertyName,
                                             int column,
                                             int row,
                                             int widthSpan,
                                             int heightSpan)

addPasswordFieldAndLabel

public JComponent[] addPasswordFieldAndLabel(String propertyName,
                                             int column,
                                             int row,
                                             int widthSpan,
                                             int heightSpan,
                                             String attributes)

addHorizontalSeparator

public void addHorizontalSeparator(int column,
                                   int row,
                                   int widthSpan)

addHorizontalSeparator

public void addHorizontalSeparator()

addHorizontalSeparator

public void addHorizontalSeparator(int widthSpan)

addHorizontalSeparator

public void addHorizontalSeparator(int column,
                                   int widthSpan)

addHorizontalSeparator

public void addHorizontalSeparator(String text)

addHorizontalSeparator

public void addHorizontalSeparator(String text,
                                   int widthSpan)

addHorizontalSeparator

public void addHorizontalSeparator(String text,
                                   int column,
                                   int widthSpan)

addVerticalSeparator

public void addVerticalSeparator(int column,
                                 int row,
                                 int heightSpan)

addVerticalSeparator

public void addVerticalSeparator()

addVerticalSeparator

public void addVerticalSeparator(int heightSpan)

addVerticalSeparator

public void addVerticalSeparator(int column,
                                 int heightSpan)

addNestedPropertyReadOnly

public JComponent addNestedPropertyReadOnly(String property,
                                            String nestedProperty)

addNestedPropertyReadOnly

public JComponent addNestedPropertyReadOnly(String property,
                                            String nestedProperty,
                                            int column)

addNestedPropertyReadOnly

public JComponent addNestedPropertyReadOnly(String property,
                                            String nestedProperty,
                                            int column,
                                            int row)

addNestedPropertyReadOnly

public JComponent addNestedPropertyReadOnly(String property,
                                            String nestedProperty,
                                            int column,
                                            int row,
                                            int widthSpan,
                                            int heightSpan)

addNestedPropertyReadOnlyAndLabel

public JComponent[] addNestedPropertyReadOnlyAndLabel(String property,
                                                      String nestedProperty)

addNestedPropertyReadOnlyAndLabel

public JComponent[] addNestedPropertyReadOnlyAndLabel(String property,
                                                      String nestedProperty,
                                                      int column)

addNestedPropertyReadOnlyAndLabel

public JComponent[] addNestedPropertyReadOnlyAndLabel(String property,
                                                      String nestedProperty,
                                                      int column,
                                                      int row)

addNestedPropertyReadOnlyAndLabel

public JComponent[] addNestedPropertyReadOnlyAndLabel(String property,
                                                      String nestedProperty,
                                                      int column,
                                                      int row,
                                                      int widthSpan,
                                                      int heightSpan)

getFormModelEnabledListener

public FormLayoutFormBuilder.FormModelEnabledListener getFormModelEnabledListener()


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