org.jdesktop.jdnc.form
Class DefaultFormFactory

java.lang.Object
  extended by org.jdesktop.jdnc.form.FormFactory
      extended by org.jdesktop.jdnc.form.DefaultFormFactory

public class DefaultFormFactory
extends FormFactory

note:technically this should probably be in a FormUI, or initialized from a FormUI.

Version:
1.0
Author:
Amy Fowler

Constructor Summary
DefaultFormFactory()
           
 
Method Summary
 Binding addComponent(javax.swing.JComponent parent, javax.swing.JComponent component, DataModel model, java.lang.String fieldName)
          Adds the component to the specified parent container and configures its layout within that container according to the form factory's layout paradigm.
 void addComponent(javax.swing.JComponent parent, javax.swing.JComponent component, MetaData metaData)
          Deprecated. use method with dataModel instead.
 Binding createBinding(DataModel model, java.lang.String fieldName, javax.swing.JComponent component)
          delegates to current BindingMap.
 javax.swing.JComponent createComponent(MetaData metaData)
          Delegates to current ComponentMap.
 
Methods inherited from class org.jdesktop.jdnc.form.FormFactory
getDefaultFormFactory, isNonVisual, setDefaultFormFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFormFactory

public DefaultFormFactory()
Method Detail

createComponent

public javax.swing.JComponent createComponent(MetaData metaData)
Delegates to current ComponentMap.

Specified by:
createComponent in class FormFactory
Parameters:
metaData - object which describes the named field
Returns:
JComponent which can display/edit values defined by the metaData object or null if the field is non-visual.

createBinding

public Binding createBinding(DataModel model,
                             java.lang.String fieldName,
                             javax.swing.JComponent component)
delegates to current BindingMap.

Specified by:
createBinding in class FormFactory
Parameters:
model - data model object to which the component is being bound
fieldName - String containing the name of the field within the data model
component - JComponent which can display/edit values defined by the metaData object
Returns:
Binding instance which binds the component to the field in the data model

addComponent

public void addComponent(javax.swing.JComponent parent,
                         javax.swing.JComponent component,
                         MetaData metaData)
Deprecated. use method with dataModel instead.

Description copied from class: FormFactory
Adds the component to the specified parent container and configures its layout within that container according to the form factory's layout paradigm. If the metaData argument is not null, then a label will be automatically created and aligned with the component. Note that the component being added need not be the component which has the binding. For example, an edit component may be contained within another container (scrollpane, panel, etc); the edit component will have the binding, but the container is what must be added to the form.

Specified by:
addComponent in class FormFactory
Parameters:
parent - Container where the component is being added
component - JComponent being added to the container
metaData - object which describes the named field

addComponent

public Binding addComponent(javax.swing.JComponent parent,
                            javax.swing.JComponent component,
                            DataModel model,
                            java.lang.String fieldName)
Description copied from class: FormFactory
Adds the component to the specified parent container and configures its layout within that container according to the form factory's layout paradigm. If the DataModel and metaData argument are not null, then a label will be automatically created and aligned with the component. The label will be bound to the field's metaData. Note that the component being added need not be the component which has the binding. For example, an edit component may be contained within another container (scrollpane, panel, etc); the edit component will have the binding, but the container is what must be added to the form.

Specified by:
addComponent in class FormFactory
Parameters:
parent - Container where the component is being added
component - JComponent being added to the container
model - the data to take the field from.
fieldName - name of the field
Returns:
the meta binding to the label, might be null


Copyright © 2005 Sun Microsystems All Rights Reserved.