net.sf.jzeno.echo.databinding
Class DynaHtmlContainer

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.databinding.DynaHtmlContainer
All Implemented Interfaces:
java.io.Serializable, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, Component, FastComponent, FastComponentContainer

public class DynaHtmlContainer
extends CustomComponent
implements FastComponent, Precreation

HtmlContainer that supports databinding. Use this component if you want to render out HTML directly.

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
DynaHtmlContainer()
           Creates an initially unbound html container.
DynaHtmlContainer(java.lang.Class beanClass, java.lang.String property, java.lang.String constructionHints)
           Creates a databound html container.
 
Method Summary
 void addTemplateComponent(Component component, java.lang.String name)
           
 void applyContext()
           
 java.lang.String getTemplate()
           
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void setTemplate(java.lang.String template)
           Directly sets the HTML you want to display.
 void setTemplateFromInputStream(java.io.InputStream templateStream)
           Sets the HTML template from an InputStream.
 void setTemplateFromResource(java.lang.String resourceName)
           Helper method to allow you to load a template file from a resource on your classpath.
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isReadOnly, isRequired, isValid, markInvalid, markValid, preRender, removeValidator, setActionCommand, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setReadOnly, setRequired, setValue, traceValue, validate
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynaHtmlContainer

public DynaHtmlContainer()

Creates an initially unbound html container.


DynaHtmlContainer

public DynaHtmlContainer(java.lang.Class beanClass,
                         java.lang.String property,
                         java.lang.String constructionHints)

Creates a databound html container. Bind it to a property of type String . This string can than contain any HTML you want to visualize.

Method Detail

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
Overrides:
rebind in class CustomComponent

setTemplate

public void setTemplate(java.lang.String template)

Directly sets the HTML you want to display. If your component is databound, don't use this method, but change the property you have bound to.


getTemplate

public java.lang.String getTemplate()

setTemplateFromInputStream

public void setTemplateFromInputStream(java.io.InputStream templateStream)

Sets the HTML template from an InputStream. This method reads out all data in the InputStream, and sets the template to that text.


setTemplateFromResource

public void setTemplateFromResource(java.lang.String resourceName)

Helper method to allow you to load a template file from a resource on your classpath. This method does NOT cache template content , to allow you to modify templates on the fly.


addTemplateComponent

public void addTemplateComponent(Component component,
                                 java.lang.String name)

applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation