org.apertereports.components
Class ReportParametersComponent

java.lang.Object
  extended by com.vaadin.ui.AbstractComponent
      extended by com.vaadin.ui.AbstractComponentContainer
          extended by com.vaadin.ui.CustomComponent
              extended by org.apertereports.AbstractLazyLoaderComponent
                  extended by org.apertereports.components.ReportParametersComponent
All Implemented Interfaces:
com.vaadin.event.MethodEventSource, com.vaadin.terminal.Paintable, com.vaadin.terminal.Sizeable, com.vaadin.terminal.VariableOwner, com.vaadin.ui.Component, com.vaadin.ui.ComponentContainer, eu.livotov.tpt.gui.widgets.TPTLazyLoadingLayout.LazyLoader, Serializable, EventListener

public class ReportParametersComponent
extends AbstractLazyLoaderComponent

Displays report parameters taken from JRXML parameters section as Vaadin fields in a form. Supports lazy loading.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponent.ComponentErrorEvent, com.vaadin.ui.AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer
com.vaadin.ui.ComponentContainer.ComponentAttachEvent, com.vaadin.ui.ComponentContainer.ComponentAttachListener, com.vaadin.ui.ComponentContainer.ComponentDetachEvent, com.vaadin.ui.ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.ErrorListener, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable
com.vaadin.terminal.Paintable.RepaintRequestEvent, com.vaadin.terminal.Paintable.RepaintRequestListener
 
Field Summary
 
Fields inherited from interface com.vaadin.terminal.Sizeable
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
ReportParametersComponent(ReportMaster reportMaster)
           
ReportParametersComponent(ReportMaster rm, boolean showFormat)
           
ReportParametersComponent(String reportSource, Integer cacheId, boolean lazyLoad)
           
ReportParametersComponent(String reportSource, Integer cacheId, List<ReportConfigParameter> reportParameters, boolean includeReportFormat, boolean lazyLoad, boolean readonly)
           
ReportParametersComponent(String reportSource, Integer cacheId, ReportConfig reportConfig, boolean includeReportFormat, boolean lazyLoad)
           
ReportParametersComponent(String reportSource, Integer cacheId, ReportConfig reportConfig, boolean includeReportFormat, boolean lazyLoad, boolean readonly)
           
 
Method Summary
protected  void applyAttributes(FieldProperties fieldProperties, FieldContainer container, com.vaadin.ui.Field field)
          Applies view options for the generated field.
 void attach()
          Attaches the component in the application.
protected  void attachSpecialValidators(FieldProperties fieldProperties, FieldContainer container)
          Adds special validators using the invokable field property.
protected  com.vaadin.ui.Field buildFieldBaseForInputType(FieldProperties fieldProperties, List<DictionaryItem> items, FieldContainer container)
          Build a base Vaadin component for input field properties.
 Map<String,String> collectParametersValues()
          Returns a map of report parameters collected from the generated form fields.
 List<DictionaryItem> executeSpecialDataQueryCode(FieldProperties fieldProperties, List<DictionaryItem> items)
          Invokes a special script query using the invokable field property.
 String getSelectedFormat()
          Returns selected report format.
 void lazyLoad()
          Lazily loads the data.
 boolean validateForm()
          Validates all the fields in the form before commit.
 
Methods inherited from class org.apertereports.AbstractLazyLoaderComponent
getLazyLoadingMessage, lazyLoad
 
Methods inherited from class com.vaadin.ui.CustomComponent
addComponent, getComponentCount, getComponentIterator, getComponentType, getCompositionRoot, moveComponentsFrom, paintContent, removeAllComponents, removeComponent, replaceComponent, setComponentType, setCompositionRoot
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addListener, addListener, detach, fireComponentAttachEvent, fireComponentDetachEvent, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addListener, addStyleName, changeVariables, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidth, setWidthUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setIcon, setParent, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.terminal.Paintable
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId
 
Methods inherited from interface com.vaadin.terminal.VariableOwner
changeVariables, isImmediate
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits
 

Constructor Detail

ReportParametersComponent

public ReportParametersComponent(ReportMaster reportMaster)
                          throws AperteReportsException
Throws:
AperteReportsException

ReportParametersComponent

public ReportParametersComponent(String reportSource,
                                 Integer cacheId,
                                 boolean lazyLoad)
                          throws AperteReportsException
Throws:
AperteReportsException

ReportParametersComponent

public ReportParametersComponent(String reportSource,
                                 Integer cacheId,
                                 ReportConfig reportConfig,
                                 boolean includeReportFormat,
                                 boolean lazyLoad)
                          throws AperteReportsException
Throws:
AperteReportsException

ReportParametersComponent

public ReportParametersComponent(String reportSource,
                                 Integer cacheId,
                                 List<ReportConfigParameter> reportParameters,
                                 boolean includeReportFormat,
                                 boolean lazyLoad,
                                 boolean readonly)
                          throws AperteReportsException
Throws:
AperteReportsException

ReportParametersComponent

public ReportParametersComponent(String reportSource,
                                 Integer cacheId,
                                 ReportConfig reportConfig,
                                 boolean includeReportFormat,
                                 boolean lazyLoad,
                                 boolean readonly)
                          throws AperteReportsException
Throws:
AperteReportsException

ReportParametersComponent

public ReportParametersComponent(ReportMaster rm,
                                 boolean showFormat)
                          throws AperteReportsException
Throws:
AperteReportsException
Method Detail

collectParametersValues

public Map<String,String> collectParametersValues()
Returns a map of report parameters collected from the generated form fields.

Returns:
A map of report parameters

getSelectedFormat

public String getSelectedFormat()
Returns selected report format.

Returns:
Format string

lazyLoad

public void lazyLoad()
              throws Exception
Lazily loads the data.

Specified by:
lazyLoad in class AbstractLazyLoaderComponent
Throws:
Exception - on Jasper error

validateForm

public boolean validateForm()
Validates all the fields in the form before commit.

Returns:
TRUE if the form is valid

applyAttributes

protected void applyAttributes(FieldProperties fieldProperties,
                               FieldContainer container,
                               com.vaadin.ui.Field field)
Applies view options for the generated field.

Parameters:
fieldProperties - Field properties
container - Field container
field - Field the attributes are applied to

attachSpecialValidators

protected void attachSpecialValidators(FieldProperties fieldProperties,
                                       FieldContainer container)
                                throws org.apertereports.components.ReportParametersComponent.BuildingFailedException
Adds special validators using the invokable field property.

Parameters:
fieldProperties - Field properties
container - Field container
Throws:
BuildingFailedException - on script invocation error
org.apertereports.components.ReportParametersComponent.BuildingFailedException

buildFieldBaseForInputType

protected com.vaadin.ui.Field buildFieldBaseForInputType(FieldProperties fieldProperties,
                                                         List<DictionaryItem> items,
                                                         FieldContainer container)
                                                  throws org.apertereports.components.ReportParametersComponent.BuildingFailedException
Build a base Vaadin component for input field properties.

Parameters:
fieldProperties - Field properties
items - Dictionary items
container - Field container
Returns:
A newly created Vaadin field
Throws:
BuildingFailedException - on special control building error
org.apertereports.components.ReportParametersComponent.BuildingFailedException

executeSpecialDataQueryCode

public List<DictionaryItem> executeSpecialDataQueryCode(FieldProperties fieldProperties,
                                                        List<DictionaryItem> items)
                                                 throws org.apertereports.components.ReportParametersComponent.BuildingFailedException
Invokes a special script query using the invokable field property. If the invokable property is not present a default list is returned.

Parameters:
fieldProperties - Field properties
items - A default list of items
Returns:
Updated list of items
Throws:
BuildingFailedException - on script invocation error
org.apertereports.components.ReportParametersComponent.BuildingFailedException

attach

public void attach()
Attaches the component in the application. The reason the initialization of the view is here is that we need to access user's login which may be unavailable at th = nulle time of creation of the component.

Specified by:
attach in interface com.vaadin.ui.Component
Overrides:
attach in class com.vaadin.ui.AbstractComponentContainer


Copyright © 2011-2012. All Rights Reserved.