echopointng.ui.syncpeer
Class TreePeer

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

public class TreePeer
extends AbstractEchoPointContainerPeer
implements ActionProcessor

Synchronization peer for echopointng.Tree components.


Field Summary
static Service TREE_SCRIPT_SERVICE
          Service to provide supporting Tree JavaScript library.
 
Fields inherited from class echopointng.ui.syncpeer.AbstractEchoPointPeer
DEFAULT_CONTAINER_TAG, partialUpdateManager
 
Fields inherited from interface nextapp.echo2.webcontainer.ActionProcessor
ACTION_NAME, ACTION_VALUE
 
Constructor Summary
TreePeer()
           
 
Method Summary
 void processAction(ContainerInstance ci, Component component, org.w3c.dom.Element actionElement)
          The events can be expansion or contraction events as well as selection events
 void renderAdd(RenderContext rc, ServerComponentUpdate update, java.lang.String targetId, Component component)
          The TablePeer now has the ability to update only the tree node rows that have changed.
 void renderHtml(RenderContext rc, ServerComponentUpdate update, org.w3c.dom.Node parentNode, Component component)
          This sets up the EchoPoint RenderingContext helper and then calls the abstract renderHtml method.
 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.
 boolean renderUpdate(RenderContext rc, ServerComponentUpdate update, java.lang.String targetId)
          The TablePeer now has the ability to update only the tree node rows that have changed.
 
Methods inherited from class echopointng.ui.syncpeer.AbstractEchoPointContainerPeer
getContainerId
 
Methods inherited from class echopointng.ui.syncpeer.AbstractEchoPointPeer
disposeRenderState, renderDispose, renderReplaceableChild, 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

TREE_SCRIPT_SERVICE

public static final Service TREE_SCRIPT_SERVICE
Service to provide supporting Tree JavaScript library.

Constructor Detail

TreePeer

public TreePeer()
Method Detail

renderHtml

public void renderHtml(RenderContext rc,
                       ServerComponentUpdate update,
                       org.w3c.dom.Node parentNode,
                       Component component)
This sets up the EchoPoint RenderingContext helper and then calls the abstract renderHtml method.

Specified by:
renderHtml in interface DomUpdateSupport
Overrides:
renderHtml in class AbstractEchoPointPeer
Parameters:
rc - the relevant RenderContext
update - the ServerComponentUpdate for which this rendering is being performed
parentNode - the parent DOM node to which this child should add HTML code
component - the Component to be rendered
See Also:
DomUpdateSupport.renderHtml(nextapp.echo2.webcontainer.RenderContext, nextapp.echo2.app.update.ServerComponentUpdate, org.w3c.dom.Node, nextapp.echo2.app.Component)

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)

renderAdd

public void renderAdd(RenderContext rc,
                      ServerComponentUpdate update,
                      java.lang.String targetId,
                      Component component)
The TablePeer now has the ability to update only the tree node rows that have changed. Therefore to do this is must unwind some of the automatic rendering support provided by the base classes and rather render some if it itself.

Specified by:
renderAdd in interface ComponentSynchronizePeer
Overrides:
renderAdd in class AbstractEchoPointPeer
Parameters:
rc - the relevant RenderContext
update - the ServerComponentUpdate for which this operation is being performed
targetId - the id of the HTML element in which the component's HTML output should be rendered
component - the component to be rendered (this component must be of a type supported by this synchronization peer).
See Also:
AbstractEchoPointPeer.renderAdd(nextapp.echo2.webcontainer.RenderContext, nextapp.echo2.app.update.ServerComponentUpdate, java.lang.String, nextapp.echo2.app.Component)

renderUpdate

public boolean renderUpdate(RenderContext rc,
                            ServerComponentUpdate update,
                            java.lang.String targetId)
The TablePeer now has the ability to update only the tree node rows that have changed. Therefore to do this is must unwind some of the automatic rendering support provided by the base classes and rather render some if it itself.

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)

processAction

public void processAction(ContainerInstance ci,
                          Component component,
                          org.w3c.dom.Element actionElement)
The events can be expansion or contraction events as well as selection events

Specified by:
processAction in interface ActionProcessor
Parameters:
ci - the relevant ContainerInstance
component - the target Component
actionElement - the XML element describing the action (the name and value of the action may be obtained by querying the ACTION_NAME and ACTION_VALUE attribute values.
See Also:
ActionProcessor.processAction(nextapp.echo2.webcontainer.ContainerInstance, nextapp.echo2.app.Component, org.w3c.dom.Element)