org.apertereports.util.wrappers
Class FieldContainer

java.lang.Object
  extended by org.apertereports.util.wrappers.FieldContainer

public class FieldContainer
extends Object

This is a wrapper container for report fields. It includes a Vaadin component and a bunch of configuration params.

Each of the containers has a certain type of ReportConstants.InputTypes, a name, order in the form and a flag that decides whether to show a "select all" checkbox or not.


Constructor Summary
FieldContainer()
           
FieldContainer(Integer order, String name, com.vaadin.ui.Field field)
           
 
Method Summary
 void addValidator(com.vaadin.data.Validator validator)
          Adds a validator to the current field component.
 ReportConstants.InputTypes getComponentType()
           
 com.vaadin.ui.Component getFieldComponent()
           
 String getName()
           
 Integer getOrder()
           
 Object getValue()
          Gets a value from current component.
 boolean isSelectAll()
           
 void placeYourselfInForm(com.vaadin.ui.Form form, com.vaadin.ui.FormLayout layout)
          Fills the form with current field component.
 void setComponentType(ReportConstants.InputTypes componentType)
           
 void setFieldComponent(com.vaadin.ui.Component field)
           
 void setName(String name)
           
 void setOrder(Integer order)
           
 void setSelectAll(boolean selectAll)
           
 void setValue(Object value)
          Sets the value of the current field component.
 void validate()
          Invokes the validation of the current field component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldContainer

public FieldContainer()

FieldContainer

public FieldContainer(Integer order,
                      String name,
                      com.vaadin.ui.Field field)
Method Detail

addValidator

public void addValidator(com.vaadin.data.Validator validator)
Adds a validator to the current field component.

Parameters:
validator - A Vaadin validator

getComponentType

public ReportConstants.InputTypes getComponentType()

getFieldComponent

public com.vaadin.ui.Component getFieldComponent()

getName

public String getName()

getOrder

public Integer getOrder()

getValue

public Object getValue()
Gets a value from current component.

Returns:
A value of component

isSelectAll

public boolean isSelectAll()

placeYourselfInForm

public void placeYourselfInForm(com.vaadin.ui.Form form,
                                com.vaadin.ui.FormLayout layout)
Fills the form with current field component. Adds additional widgets if needed (i.e. "select all" box)

Parameters:
form - The form to place the field in
layout - The layout that displays the field

setComponentType

public void setComponentType(ReportConstants.InputTypes componentType)

setFieldComponent

public void setFieldComponent(com.vaadin.ui.Component field)

setName

public void setName(String name)

setOrder

public void setOrder(Integer order)

setSelectAll

public void setSelectAll(boolean selectAll)

setValue

public void setValue(Object value)
Sets the value of the current field component.

Parameters:
value - The value to set

validate

public void validate()
Invokes the validation of the current field component. Adds the error style on validation exception.



Copyright © 2011-2012. All Rights Reserved.