|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.jdnc.form.FormFactory
public abstract class FormFactory
Form factory class which provides support for constructing the user-interface components and associated bindings for a JForm component.
Generally, applications need not interact directly with this class because the default operation of the JForm component will invoke this factory as necessary to construct the form based on how the application binds the form to the application's data models.
This factory provides methods for 3 key form-building operations:
This factory can handle non-visual data fields - createComponent will return null in that case. Note that a form factory is stateless and these methods operate independent of each other, thus an application may invoke only those methods it requires to construct the form. For example, an application that wishes to use the form factory's components and bindings, but intends to handle the layout itself, may choose to invoke only the first two methods.
Constructor Summary | |
---|---|
FormFactory()
|
Method Summary | |
---|---|
abstract Binding |
addComponent(javax.swing.JComponent parent,
javax.swing.JComponent component,
DataModel dataModel,
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. |
abstract void |
addComponent(javax.swing.JComponent parent,
javax.swing.JComponent component,
MetaData metaData)
Adds the component to the specified parent container and configures its layout within that container according to the form factory's layout paradigm. |
abstract Binding |
createBinding(DataModel model,
java.lang.String fieldName,
javax.swing.JComponent component)
Factory method for returning the binding object which connects the user-interface component to the specified field in a data model. |
abstract javax.swing.JComponent |
createComponent(MetaData metaData)
Factory method for returning the user-interface component best suited to edit/display values for the data model field represented by the metaData object. |
static FormFactory |
getDefaultFormFactory()
|
boolean |
isNonVisual(MetaData metaData)
|
static void |
setDefaultFormFactory(FormFactory formFactory)
Sets the default FormFactory instance which is shared across the application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormFactory()
Method Detail |
---|
public static FormFactory getDefaultFormFactory()
public static void setDefaultFormFactory(FormFactory formFactory)
formFactory
- factory to be used as the default form factorypublic abstract javax.swing.JComponent createComponent(MetaData metaData)
metaData
- object which describes the named field
public abstract Binding createBinding(DataModel model, java.lang.String fieldName, javax.swing.JComponent component)
model
- data model object to which the component is being boundfieldName
- String containing the name of the field within the data modelcomponent
- JComponent which can display/edit values defined by the metaData
object
public abstract void addComponent(javax.swing.JComponent parent, javax.swing.JComponent component, MetaData metaData)
parent
- Container where the component is being addedcomponent
- JComponent being added to the containermetaData
- object which describes the named fieldpublic abstract Binding addComponent(javax.swing.JComponent parent, javax.swing.JComponent component, DataModel dataModel, java.lang.String fieldName)
parent
- Container where the component is being addedcomponent
- JComponent being added to the containerdataModel
- the data to take the field from.fieldName
- name of the field
public boolean isNonVisual(MetaData metaData)
metaData
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |