org.apache.tapestry.form
Class MockForm

java.lang.Object
  extended by org.apache.tapestry.form.MockForm
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, FormBehavior, IComponent, IDirect, IDynamicInvoker, IForm, IRender

public class MockForm
extends Object
implements IForm

Mock object used by the FormSupportTest.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
MockForm()
           
MockForm(IValidationDelegate delegate)
           
MockForm(IValidationDelegate delegate, org.apache.hivemind.Location location)
           
MockForm(org.apache.hivemind.Location location)
           
 
Method Summary
 void addAsset(String name, IAsset asset)
           
 void addBody(IRender element)
           
 void addComponent(IComponent component)
           
 void addDeferredRunnable(Runnable runnable)
           
 void addEventHandler(FormEventType type, String functionName)
           
 void addHiddenValue(String name, String value)
           
 void addHiddenValue(String name, String id, String value)
           
 void enterActiveState()
           
 void finishLoad(IRequestCycle cycle, IPageLoader loader, IComponentSpecification specification)
           
 IAsset getAsset(String name)
           
 Map getAssets()
           
 IBeanProvider getBeans()
           
 IBinding getBinding(String name)
           
 Collection getBindingNames()
           
 Map getBindings()
           
 String getClientId()
           
 IComponent getComponent(String id)
           
 Map getComponents()
           
 IContainedComponent getContainedComponent()
           
 IComponent getContainer()
           
 IValidationDelegate getDelegate()
           
 String getElementId(IFormComponent component)
           
 String getElementId(IFormComponent component, String baseId)
           
 IComponentEventInvoker getEventInvoker()
          
 String getExtendedId()
           
 boolean getFocus()
           
 String getId()
           
 String getIdPath()
           
 ListenerMap getListeners()
           
 org.apache.hivemind.Location getLocation()
           
 String getMessage(String key)
           
 org.apache.hivemind.Messages getMessages()
           
 String getName()
           
 INamespace getNamespace()
           
 IPage getPage()
           
 JSONObject getProfile()
          
 Object getProperty(String propertyName)
           
 boolean getRequiresSession()
           
 IComponentSpecification getSpecification()
           
 String getSpecifiedId()
          
 String getTemplateTagName()
          
 List getUpdateComponents()
          
 boolean isAsync()
          
 boolean isClientValidationEnabled()
           
 boolean isFormFieldUpdating()
          
 boolean isJson()
          
 boolean isPrerendered(IComponent field)
           
 boolean isRendering()
           
 boolean isRewinding()
           
 boolean isStateful()
          
 String peekClientId()
          
 String peekClientId(IFormComponent component)
           
 void prerenderField(IMarkupWriter writer, IComponent field, org.apache.hivemind.Location location)
           
 void registerForFocus(IFormComponent field, int priority)
           
 void render(IMarkupWriter writer, IRequestCycle cycle)
           
 void renderBody(IMarkupWriter writer, IRequestCycle cycle)
           
 void rewind(IMarkupWriter writer, IRequestCycle cycle)
           
 void setBinding(String name, IBinding binding)
           
 void setBody(IRender body)
           
 void setClientId(String id)
          
 void setContainedComponent(IContainedComponent containedComponent)
           
 void setContainer(IComponent value)
           
 void setEncodingType(String encodingType)
           
 void setEventInvoker(IComponentEventInvoker invoker)
           
 void setFocus(boolean focus)
           
 void setFormFieldUpdating(boolean value)
          
 void setId(String value)
           
 void setLocation(org.apache.hivemind.Location arg0)
           
 void setNamespace(INamespace namespace)
           
 void setPage(IPage value)
           
 void setProperty(String propertyName, Object value)
           
 void setTemplateTagName(String tag)
           
 void trigger(IRequestCycle cycle)
          
 boolean wasPrerendered(IComponent field)
           
 boolean wasPrerendered(IMarkupWriter writer, IComponent field)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockForm

public MockForm()

MockForm

public MockForm(org.apache.hivemind.Location location)

MockForm

public MockForm(IValidationDelegate delegate)

MockForm

public MockForm(IValidationDelegate delegate,
                org.apache.hivemind.Location location)
Method Detail

isPrerendered

public boolean isPrerendered(IComponent field)

setClientId

public void setClientId(String id)

Specified by:
setClientId in interface IComponent

getSpecifiedId

public String getSpecifiedId()

Specified by:
getSpecifiedId in interface IComponent

rewind

public void rewind(IMarkupWriter writer,
                   IRequestCycle cycle)
Specified by:
rewind in interface IForm

addEventHandler

public void addEventHandler(FormEventType type,
                            String functionName)
Specified by:
addEventHandler in interface FormBehavior

getElementId

public String getElementId(IFormComponent component)
Specified by:
getElementId in interface FormBehavior

getElementId

public String getElementId(IFormComponent component,
                           String baseId)
Specified by:
getElementId in interface FormBehavior

peekClientId

public String peekClientId(IFormComponent component)
Specified by:
peekClientId in interface FormBehavior

getName

public String getName()
Specified by:
getName in interface IForm

isRewinding

public boolean isRewinding()
Specified by:
isRewinding in interface FormBehavior

getDelegate

public IValidationDelegate getDelegate()
Specified by:
getDelegate in interface IForm

setEncodingType

public void setEncodingType(String encodingType)
Specified by:
setEncodingType in interface FormBehavior

addHiddenValue

public void addHiddenValue(String name,
                           String value)
Specified by:
addHiddenValue in interface FormBehavior

addHiddenValue

public void addHiddenValue(String name,
                           String id,
                           String value)
Specified by:
addHiddenValue in interface FormBehavior

getRequiresSession

public boolean getRequiresSession()

addAsset

public void addAsset(String name,
                     IAsset asset)
Specified by:
addAsset in interface IComponent

addComponent

public void addComponent(IComponent component)
Specified by:
addComponent in interface IComponent

addBody

public void addBody(IRender element)
Specified by:
addBody in interface IComponent

getClientId

public String getClientId()
Specified by:
getClientId in interface IComponent

getAssets

public Map getAssets()
Specified by:
getAssets in interface IComponent

getAsset

public IAsset getAsset(String name)
Specified by:
getAsset in interface IComponent

getBinding

public IBinding getBinding(String name)
Specified by:
getBinding in interface IComponent

getBindingNames

public Collection getBindingNames()
Specified by:
getBindingNames in interface IComponent

getBindings

public Map getBindings()
Specified by:
getBindings in interface IComponent

getComponent

public IComponent getComponent(String id)
Specified by:
getComponent in interface IComponent

getContainer

public IComponent getContainer()
Specified by:
getContainer in interface IComponent

setContainer

public void setContainer(IComponent value)
Specified by:
setContainer in interface IComponent

getExtendedId

public String getExtendedId()
Specified by:
getExtendedId in interface IComponent

getId

public String getId()
Specified by:
getId in interface IComponent

setId

public void setId(String value)
Specified by:
setId in interface IComponent

getIdPath

public String getIdPath()
Specified by:
getIdPath in interface IComponent

getPage

public IPage getPage()
Specified by:
getPage in interface IComponent

setPage

public void setPage(IPage value)
Specified by:
setPage in interface IComponent

getSpecification

public IComponentSpecification getSpecification()
Specified by:
getSpecification in interface IComponent

renderBody

public void renderBody(IMarkupWriter writer,
                       IRequestCycle cycle)
Specified by:
renderBody in interface IComponent

setBinding

public void setBinding(String name,
                       IBinding binding)
Specified by:
setBinding in interface IComponent

getComponents

public Map getComponents()
Specified by:
getComponents in interface IComponent

finishLoad

public void finishLoad(IRequestCycle cycle,
                       IPageLoader loader,
                       IComponentSpecification specification)
Specified by:
finishLoad in interface IComponent

getMessages

public org.apache.hivemind.Messages getMessages()
Specified by:
getMessages in interface IComponent

getNamespace

public INamespace getNamespace()
Specified by:
getNamespace in interface IComponent

setNamespace

public void setNamespace(INamespace namespace)
Specified by:
setNamespace in interface IComponent

setProperty

public void setProperty(String propertyName,
                        Object value)

getProperty

public Object getProperty(String propertyName)

isRendering

public boolean isRendering()
Specified by:
isRendering in interface IComponent

enterActiveState

public void enterActiveState()
Specified by:
enterActiveState in interface IComponent

getBeans

public IBeanProvider getBeans()
Specified by:
getBeans in interface IComponent

getListeners

public ListenerMap getListeners()
Specified by:
getListeners in interface IComponent

render

public void render(IMarkupWriter writer,
                   IRequestCycle cycle)
Specified by:
render in interface IRender

setLocation

public void setLocation(org.apache.hivemind.Location arg0)
Specified by:
setLocation in interface org.apache.hivemind.LocationHolder

getLocation

public org.apache.hivemind.Location getLocation()
Specified by:
getLocation in interface org.apache.hivemind.Locatable

setBody

public void setBody(IRender body)

prerenderField

public void prerenderField(IMarkupWriter writer,
                           IComponent field,
                           org.apache.hivemind.Location location)
Specified by:
prerenderField in interface FormBehavior

wasPrerendered

public boolean wasPrerendered(IMarkupWriter writer,
                              IComponent field)
Specified by:
wasPrerendered in interface FormBehavior

addDeferredRunnable

public void addDeferredRunnable(Runnable runnable)
Specified by:
addDeferredRunnable in interface FormBehavior

isClientValidationEnabled

public boolean isClientValidationEnabled()
Specified by:
isClientValidationEnabled in interface IForm

getMessage

public String getMessage(String key)

registerForFocus

public void registerForFocus(IFormComponent field,
                             int priority)
Specified by:
registerForFocus in interface FormBehavior

getFocus

public boolean getFocus()
Specified by:
getFocus in interface IForm

setFocus

public void setFocus(boolean focus)

getContainedComponent

public IContainedComponent getContainedComponent()
Specified by:
getContainedComponent in interface IComponent

setContainedComponent

public void setContainedComponent(IContainedComponent containedComponent)
Specified by:
setContainedComponent in interface IComponent

getEventInvoker

public IComponentEventInvoker getEventInvoker()

Specified by:
getEventInvoker in interface IComponent

setEventInvoker

public void setEventInvoker(IComponentEventInvoker invoker)

getProfile

public JSONObject getProfile()

Specified by:
getProfile in interface FormBehavior

isFormFieldUpdating

public boolean isFormFieldUpdating()

Specified by:
isFormFieldUpdating in interface FormBehavior

setFormFieldUpdating

public void setFormFieldUpdating(boolean value)

Specified by:
setFormFieldUpdating in interface FormBehavior

getUpdateComponents

public List getUpdateComponents()

Specified by:
getUpdateComponents in interface IDynamicInvoker

isAsync

public boolean isAsync()

Specified by:
isAsync in interface IDynamicInvoker

isJson

public boolean isJson()

Specified by:
isJson in interface IDynamicInvoker

isStateful

public boolean isStateful()

Specified by:
isStateful in interface IDirect

trigger

public void trigger(IRequestCycle cycle)

Specified by:
trigger in interface IDirect

getTemplateTagName

public String getTemplateTagName()

Specified by:
getTemplateTagName in interface IComponent

setTemplateTagName

public void setTemplateTagName(String tag)
Specified by:
setTemplateTagName in interface IComponent

peekClientId

public String peekClientId()

Specified by:
peekClientId in interface IComponent

wasPrerendered

public boolean wasPrerendered(IComponent field)
Specified by:
wasPrerendered in interface FormBehavior


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.