net.sf.tacos.ajax.impl
Class InjectAjaxComponentRenderWorker

java.lang.Object
  extended by net.sf.tacos.ajax.impl.InjectAjaxComponentRenderWorker
All Implemented Interfaces:
org.apache.tapestry.enhance.EnhancementWorker

public class InjectAjaxComponentRenderWorker
extends Object
implements org.apache.tapestry.enhance.EnhancementWorker

Adds method call before AbstractComponent.renderComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle) which calls the AjaxWebRequest, if available, to get the correct IMarkupWriter to use to render itself, based on the unique component id of the IComponent being rendered.

Author:
jkuhnert

Constructor Summary
InjectAjaxComponentRenderWorker()
           
 
Method Summary
protected  String buildMethodCallBack(org.apache.tapestry.spec.IComponentSpecification spec, MethodSignature method, MethodSignature accessor)
          Builds the new enhanced render method which calls ResponseBuilder to get the correct writer to use for method.
protected  String buildScriptMethodCallBack(org.apache.tapestry.spec.IComponentSpecification spec, MethodSignature method, MethodSignature accessor)
          Called specifically when dealing with Body components.
protected  MethodSignature createAjaxRequestAccessor(org.apache.tapestry.enhance.EnhancementOperation op, org.apache.tapestry.spec.IComponentSpecification spec)
          Creates an accessor method on the IComponent being enhanced so it can access the AjaxWebRequest at runtime.
 void performEnhancement(org.apache.tapestry.enhance.EnhancementOperation op, org.apache.tapestry.spec.IComponentSpecification spec)
          
 void setAjaxRequest(AjaxWebRequest ajaxRequest)
          Injected ajaexRequest reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectAjaxComponentRenderWorker

public InjectAjaxComponentRenderWorker()
Method Detail

setAjaxRequest

public void setAjaxRequest(AjaxWebRequest ajaxRequest)
Injected ajaexRequest reference.

Parameters:
ajaxRequest -

performEnhancement

public void performEnhancement(org.apache.tapestry.enhance.EnhancementOperation op,
                               org.apache.tapestry.spec.IComponentSpecification spec)

Specified by:
performEnhancement in interface org.apache.tapestry.enhance.EnhancementWorker

createAjaxRequestAccessor

protected MethodSignature createAjaxRequestAccessor(org.apache.tapestry.enhance.EnhancementOperation op,
                                                    org.apache.tapestry.spec.IComponentSpecification spec)
Creates an accessor method on the IComponent being enhanced so it can access the AjaxWebRequest at runtime.

Parameters:
op -
spec -
Returns:
The MethodSignature of the created accessor.

buildMethodCallBack

protected String buildMethodCallBack(org.apache.tapestry.spec.IComponentSpecification spec,
                                     MethodSignature method,
                                     MethodSignature accessor)
Builds the new enhanced render method which calls ResponseBuilder to get the correct writer to use for method.

Parameters:
spec -
method -
accessor -
Returns:

buildScriptMethodCallBack

protected String buildScriptMethodCallBack(org.apache.tapestry.spec.IComponentSpecification spec,
                                           MethodSignature method,
                                           MethodSignature accessor)
Called specifically when dealing with Body components. This method will do the normal writer return semantics, but will first add it's "script" contributions to the response builder.

Parameters:
spec -
method -
accessor -
Returns: