echopointng.ui.syncpeer
Class TemplatePanelPeer

java.lang.Object
  extended by echopointng.ui.syncpeer.AbstractEchoPointPeer
      extended by echopointng.ui.syncpeer.AbstractEchoPointContainerPeer
          extended by echopointng.ui.syncpeer.TemplatePanelPeer
All Implemented Interfaces:
ComponentSynchronizePeer, DomUpdateSupport

public class TemplatePanelPeer
extends AbstractEchoPointContainerPeer

TemplatePanelPeer is a peer for TemplatePanel


Field Summary
static ExpiryCache COMPILED_TEMPLATE_CACHE
          A cache of templates previously encountered.
static Service TEMPLATE_JS_SERVICE
          Service to provide supporting JavaScript library.
 
Fields inherited from class echopointng.ui.syncpeer.AbstractEchoPointPeer
DEFAULT_CONTAINER_TAG, partialUpdateManager
 
Constructor Summary
TemplatePanelPeer()
           
 
Method Summary
protected  void createDisposeDirective(ServerMessage serverMessage, TemplatePanel templatePanel)
           
protected  void createInitDirective(RenderingContext rc, TemplatePanel templatePanel, echopointng.ui.syncpeer.TemplatePanelPeer.TemplateResult templateResult)
          Has this XML format item {eid} inlineStyleContainer style style style externalStyleContainer style style style
 void renderDispose(RenderContext rc, ServerComponentUpdate update, Component component)
          Removes any render state that is associated with the component.
 void renderHtml(RenderingContext rc, org.w3c.dom.Node parent, Component component)
          This is the rendering method you must implement if you are to use AbstractEchoPointPeer.
protected  org.w3c.dom.Element renderReplaceableChild(RenderContext rc, ServerComponentUpdate update, org.w3c.dom.Node parentNode, Component child)
          Our special implementation of this method knows about DisplayLayoutData
 boolean renderUpdate(RenderContext rc, ServerComponentUpdate update, java.lang.String targetId)
          This looks for children with updated layour data or updated properties on the peer's component and if there are any, it removes and redraws the entire peer otherwise it just replaces the children and the redraws them.
 
Methods inherited from class echopointng.ui.syncpeer.AbstractEchoPointContainerPeer
getContainerId
 
Methods inherited from class echopointng.ui.syncpeer.AbstractEchoPointPeer
disposeRenderState, renderAdd, renderHtml, renderUpdateAddChildren, renderUpdateBaseImpl, renderUpdateRemoveChildren, retreiveRenderState, storeRenderState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE_JS_SERVICE

public static final Service TEMPLATE_JS_SERVICE
Service to provide supporting JavaScript library.


COMPILED_TEMPLATE_CACHE

public static final ExpiryCache COMPILED_TEMPLATE_CACHE
A cache of templates previously encountered. As the XHTML results are cached it will save time compiling them again.

You can change the default "time to live" and "default access timeout" values by calling TemplatePanelPeer.COMPILED_TEMPLATE_CACHE.setTimeToLive(xxx) and TemplatePanelPeer.COMPILED_TEMPLATE_CACHE.setAccessTimeout(xxx) and whether SoftReferences are used to cache objects by using TemplatePanelPeer.COMPILED_TEMPLATE_CACHE.setSoftReferences(xxx)

Constructor Detail

TemplatePanelPeer

public TemplatePanelPeer()
Method Detail

renderHtml

public void renderHtml(RenderingContext rc,
                       org.w3c.dom.Node parent,
                       Component component)
Description copied from class: AbstractEchoPointPeer
This is the rendering method you must implement if you are to use AbstractEchoPointPeer.

Its a simpler wrapper for the standard one but provides some neato setup services that would otherwise be repeated over and over again.

Note the use of RenderingContext object instead of the standard Echo RenderContext as this provides more rich code facilities.

Specified by:
renderHtml in class AbstractEchoPointPeer
Parameters:
rc - - the RenderingContext to use
parent - - the parent Node to put content into
component - - the component in question
See Also:
AbstractEchoPointPeer.renderHtml(echopointng.ui.util.RenderingContext, Node, nextapp.echo2.app.Component)

renderDispose

public void renderDispose(RenderContext rc,
                          ServerComponentUpdate update,
                          Component component)
Description copied from class: AbstractEchoPointPeer
Removes any render state that is associated with the component.

Remember to call super.renderDispose() if you overrride this method.

Specified by:
renderDispose in interface ComponentSynchronizePeer
Overrides:
renderDispose in class AbstractEchoPointPeer
Parameters:
rc - the relevant RenderContext
update - the ServerComponentUpdate for which this operation is being performed
See Also:
AbstractEchoPointPeer.renderDispose(nextapp.echo2.webcontainer.RenderContext, nextapp.echo2.app.update.ServerComponentUpdate, nextapp.echo2.app.Component)

createDisposeDirective

protected void createDisposeDirective(ServerMessage serverMessage,
                                      TemplatePanel templatePanel)

createInitDirective

protected void createInitDirective(RenderingContext rc,
                                   TemplatePanel templatePanel,
                                   echopointng.ui.syncpeer.TemplatePanelPeer.TemplateResult templateResult)
Has this XML format item {eid} inlineStyleContainer style style style externalStyleContainer style style style


renderUpdate

public boolean renderUpdate(RenderContext rc,
                            ServerComponentUpdate update,
                            java.lang.String targetId)
Description copied from class: AbstractEchoPointContainerPeer
This looks for children with updated layour data or updated properties on the peer's component and if there are any, it removes and redraws the entire peer otherwise it just replaces the children and the redraws them. This method ends up calling the ends renderUpdate(rc, update, targetId, fullReplace) method with an appropriate value for fullReplace.

Specified by:
renderUpdate in interface ComponentSynchronizePeer
Overrides:
renderUpdate in class AbstractEchoPointContainerPeer
Parameters:
rc - the relevant RenderContext
update - the ServerComponentUpdate for which this operation is being performed
targetId - the id of the HTML element inside of which the components HTML code should be rendered.
Returns:
true if updates to descendants should NOT be performed
See Also:
AbstractEchoPointContainerPeer.renderUpdate(nextapp.echo2.webcontainer.RenderContext, nextapp.echo2.app.update.ServerComponentUpdate, java.lang.String)

renderReplaceableChild

protected org.w3c.dom.Element renderReplaceableChild(RenderContext rc,
                                                     ServerComponentUpdate update,
                                                     org.w3c.dom.Node parentNode,
                                                     Component child)
Our special implementation of this method knows about DisplayLayoutData

Overrides:
renderReplaceableChild in class AbstractEchoPointPeer
Parameters:
rc - the relevant RenderContext
update - the ServerComponentUpdate being performed
parentNode - a document fragment to hold the new XHTML
child - the child Component to be rendered
Returns:
- the new Element that has been used to surround the replaceable child component.
See Also:
AbstractEchoPointPeer.renderReplaceableChild(nextapp.echo2.webcontainer.RenderContext, nextapp.echo2.app.update.ServerComponentUpdate, org.w3c.dom.Node, nextapp.echo2.app.Component)