Package groovy.swing.model

# Class FormModel

java.lang.Object
groovy.swing.model.FormModel

public class FormModel extends Object
Represents a number of field models which can be ValueModel, PropertyModel, TableModel, TreeModel or nested FormModel instances

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FormModel()`
  Creates an empty form model.
  `FormModel(Map<String,Object> fieldModels)`
  Creates a form model backed by the supplied model map.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addModel(String name, Object model)`
  Registers a model under the given field name.
  `Object`
  `getModel(String name)`
  Looks up the model associated with the supplied field name.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FormModel

    public FormModel()
    Creates an empty form model.

  - ### FormModel

    public FormModel(Map<String,Object> fieldModels)
    Creates a form model backed by the supplied model map.
    Parameters:
      `fieldModels` - the initial field model map

- ## Method Details

  - ### addModel

    public void addModel(String name, Object model)
    Registers a model under the given field name.
    Parameters:
      `name` - the field name
      `model` - the field model to expose

  - ### getModel

    public Object getModel(String name)
    Looks up the model associated with the supplied field name.
    Parameters:
      `name` - the field name
    Returns:
      the registered model, or `null` if none exists