net.sf.jzeno.reporting.pdf
Class PdfReportComponent

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.reporting.pdf.PdfReportComponent
All Implemented Interfaces:
java.io.Serializable, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Component, FastComponent
Direct Known Subclasses:
ButtonReport, DynaGridReport, DynaTableReport

public class PdfReportComponent
extends AbstractComponent
implements RebindableComponent, FastComponent, EventSink, EventSource, BindingTarget

Base class for creating your pdf reports

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
PdfReportComponent()
           
PdfReportComponent(java.lang.Class beanClass, java.lang.String property, java.lang.String constructionHints)
           
 
Method Summary
 void addValidator(Validator validator)
           Add extra validators to this component.
 void buildDoc(java.io.OutputStream outputStream)
           
protected  void fireActionEvent()
           
protected  void fireActionEvent(ActionEvent event)
           
protected  void fireActionEvent(java.lang.String command)
           
 java.lang.String getActionCommand()
           
 java.lang.Object getBean()
           Retrieve the root bean this editor is bound to.
 java.lang.Class getBeanClass()
           Determine the type of bean we are bound to.
 Decorator getDecorator()
          Implementation of RebindableComponent
 java.lang.Object getNullObject()
           
protected  PdfLayout getPdfLayout()
           
 java.lang.String getProperty()
           Retrieve the property path to bind to on the domain model cluster.
 java.util.List getValidationErrors()
           Retrieves a list of currently pending validation errors on this component.
 java.util.List getValidators()
           Retrieve the list of active validators on this component.
 java.lang.Object getValue()
           Retrieve the property value from the domain model cluster.
 boolean isBound()
           
 boolean isMarkedInvalid()
           
 boolean isReadOnly()
           
 boolean isRequired()
           Query if the editor is required to be filled in.
 boolean isValid()
           Check if this component contains valid user input.
 void markInvalid()
           Marks the component as invalid.
 void markValid()
           Marks the component as valid (remove error marking)
 void preRender()
           Make changes to the visual representation of this component before Echo starts rendering the component.
 void printToFile(java.lang.String fileName)
           
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void removeValidator(Validator validator)
           Remove an existing validator from this component.
 void setActionCommand(java.lang.String command)
           
 void setBean(java.lang.Object bean)
           sets the root bean for property-binding.
 void setBeanClass(java.lang.Class beanClass)
           Change the type of model bean this property component will be bound to.
 void setDecorator(Decorator decorator)
           Sets the decorator.
 void setNullObject(java.lang.Object nullObject)
           This object should be returned by the implementor in getValue, when the property path ends in a null value.
 void setProperty(java.lang.String propertyPath)
           Set the property(path) to bind to on the domain model cluster.
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRequired(boolean required)
           Determine if the editor is required to be filled in.
 void setValue(java.lang.Object value)
           Writes the supplied data into the property we are bound to.
 java.util.List traceValue()
           Reads the properties in this components property path, and traces all read properties, returning the actual property values in a List.
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setFocused, setFont, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfReportComponent

public PdfReportComponent()

PdfReportComponent

public PdfReportComponent(java.lang.Class beanClass,
                          java.lang.String property,
                          java.lang.String constructionHints)
Method Detail

getDecorator

public Decorator getDecorator()
Implementation of RebindableComponent

Specified by:
getDecorator in interface PropertyComponent

setDecorator

public void setDecorator(Decorator decorator)
Description copied from interface: PropertyComponent

Sets the decorator.

Specified by:
setDecorator in interface PropertyComponent

getBean

public java.lang.Object getBean()
Description copied from interface: PropertyComponent

Retrieve the root bean this editor is bound to.

Specified by:
getBean in interface PropertyComponent

getProperty

public java.lang.String getProperty()
Description copied from interface: PropertyComponent

Retrieve the property path to bind to on the domain model cluster.

Specified by:
getProperty in interface PropertyComponent

getValue

public java.lang.Object getValue()
Description copied from interface: PropertyComponent

Retrieve the property value from the domain model cluster.

Specified by:
getValue in interface PropertyComponent

isRequired

public boolean isRequired()
Description copied from interface: PropertyComponent

Query if the editor is required to be filled in.

Specified by:
isRequired in interface PropertyComponent

setBean

public void setBean(java.lang.Object bean)
Description copied from interface: PropertyComponent

sets the root bean for property-binding.

Specified by:
setBean in interface PropertyComponent

setProperty

public void setProperty(java.lang.String propertyPath)
Description copied from interface: PropertyComponent

Set the property(path) to bind to on the domain model cluster.

Specified by:
setProperty in interface PropertyComponent

setRequired

public void setRequired(boolean required)
Description copied from interface: PropertyComponent

Determine if the editor is required to be filled in.

Specified by:
setRequired in interface PropertyComponent

setValue

public void setValue(java.lang.Object value)
Description copied from interface: PropertyComponent

Writes the supplied data into the property we are bound to.

Specified by:
setValue in interface PropertyComponent

isValid

public final boolean isValid()
Description copied from interface: PropertyComponent

Check if this component contains valid user input. In itself this operation will not mark the component in error. In order to apply error marking on invalid components you should use EchoSupport.doValidationRecursively(Component).

Specified by:
isValid in interface PropertyComponent

getBeanClass

public java.lang.Class getBeanClass()
Description copied from interface: PropertyComponent

Determine the type of bean we are bound to.

During the lifecycle of a property component, this may NOT change ! In other words, if this component has been bound to, let's say, an Address object, this component must at all times remain bound to Address components ! (It may ofcourse change the specific instance to which it is bound, by calling setBean.)

Specified by:
getBeanClass in interface PropertyComponent

setBeanClass

public void setBeanClass(java.lang.Class beanClass)
Description copied from interface: PropertyComponent

Change the type of model bean this property component will be bound to.

Specified by:
setBeanClass in interface PropertyComponent

getNullObject

public java.lang.Object getNullObject()
Specified by:
getNullObject in interface RebindableComponent

setNullObject

public void setNullObject(java.lang.Object nullObject)
Description copied from interface: RebindableComponent

This object should be returned by the implementor in getValue, when the property path ends in a null value.

Specified by:
setNullObject in interface RebindableComponent

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface PropertyComponent

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent

preRender

public void preRender()
Description copied from interface: PropertyComponent

Make changes to the visual representation of this component before Echo starts rendering the component.

Do not modify any bound javabeans in this method, as the changes to these will not be reflected properly on the screen.

Specified by:
preRender in interface PropertyComponent

markInvalid

public final void markInvalid()
Description copied from interface: PropertyComponent

Marks the component as invalid. Typically puts a colored border around it to indicate the error.

Specified by:
markInvalid in interface PropertyComponent

markValid

public void markValid()
Description copied from interface: PropertyComponent

Marks the component as valid (remove error marking)

Specified by:
markValid in interface PropertyComponent

isMarkedInvalid

public boolean isMarkedInvalid()
Specified by:
isMarkedInvalid in interface PropertyComponent

traceValue

public java.util.List traceValue()
Description copied from interface: RebindableComponent

Reads the properties in this components property path, and traces all read properties, returning the actual property values in a List.

Specified by:
traceValue in interface RebindableComponent

isBound

public boolean isBound()

rebind

public void rebind()
Description copied from interface: RebindableComponent

This operation causes the component to reset it's content to that of the domain model.

Specified by:
rebind in interface RebindableComponent

getValidationErrors

public final java.util.List getValidationErrors()
Description copied from interface: PropertyComponent

Retrieves a list of currently pending validation errors on this component.

Specified by:
getValidationErrors in interface PropertyComponent

addValidator

public void addValidator(Validator validator)
Description copied from interface: PropertyComponent

Add extra validators to this component.

Specified by:
addValidator in interface PropertyComponent

removeValidator

public void removeValidator(Validator validator)
Description copied from interface: PropertyComponent

Remove an existing validator from this component.

Specified by:
removeValidator in interface PropertyComponent

getValidators

public java.util.List getValidators()
Description copied from interface: PropertyComponent

Retrieve the list of active validators on this component.

Specified by:
getValidators in interface PropertyComponent

getActionCommand

public java.lang.String getActionCommand()
Specified by:
getActionCommand in interface EventSource

setActionCommand

public void setActionCommand(java.lang.String command)
Specified by:
setActionCommand in interface EventSource

fireActionEvent

protected final void fireActionEvent(java.lang.String command)

fireActionEvent

protected final void fireActionEvent()

fireActionEvent

protected final void fireActionEvent(ActionEvent event)

buildDoc

public final void buildDoc(java.io.OutputStream outputStream)
                    throws com.lowagie.text.DocumentException
Throws:
com.lowagie.text.DocumentException

printToFile

public final void printToFile(java.lang.String fileName)
                       throws java.io.FileNotFoundException,
                              com.lowagie.text.DocumentException
Throws:
java.io.FileNotFoundException
com.lowagie.text.DocumentException

getPdfLayout

protected PdfLayout getPdfLayout()