org.apache.tapestry.dojo.html
Class InlineEditBox

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.dojo.AbstractWidget
              extended by org.apache.tapestry.dojo.html.InlineEditBox
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IWidget, IComponent, IDirect, IDirectEvent, IDynamicInvoker, Component, IRender

public abstract class InlineEditBox
extends AbstractWidget
implements IDirect

Wraps a dojo InlineEditBox widget.

Manages a single string value that when hovered over can be edited "inline" in the document wherever it is referenced. Supports various modes of operation (ie disable/enabled), as well as textarea or single line style edits.

Some of the commonly used widget functions to listen to are:


Field Summary
static String TEXT_AREA_MODE
          Multi line editing text mode.
static String TEXT_MODE
          Default single line editing text mode.
 
Fields inherited from class org.apache.tapestry.AbstractComponent
_body, _bodyCount
 
Constructor Summary
InlineEditBox()
           
 
Method Summary
abstract  boolean getDoFade()
           
abstract  IEngineService getEngine()
          Injected.
abstract  IActionListener getListener()
           
abstract  ListenerInvoker getListenerInvoker()
          Injected.
abstract  int getMinHeight()
           
abstract  int getMinWidth()
           
abstract  String getMode()
           
abstract  Object getParameters()
           
abstract  IScript getScript()
          Injected.
 List getUpdateComponents()
          If set, will be used to update/refresh portions of a response during XHR requests.
 String getUpdateUrl()
          Callback url used by client side widget to update server component.
abstract  String getValue()
           
 boolean isAsync()
          Used to specify whether or not the result of this invocation should be returned asynchronously or use normal browser page reload semantics.
abstract  boolean isDisabled()
           
 boolean isJson()
          Used to specify that the return invocation of the response created should be in the "http://json.org" format.
 void renderWidget(IMarkupWriter writer, IRequestCycle cycle)
          Similar to the semantics involved with normal AbstractComponent.renderComponent method writing component state to the output stream.
abstract  void setStateful(boolean value)
           
abstract  void setValue(String value)
           
 void trigger(IRequestCycle cycle)
          Invoked by the direct service to have the component perform the appropriate action.
 
Methods inherited from class org.apache.tapestry.dojo.AbstractWidget
getDestroy, renderComponent, setDestroy
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, equals, finishLoad, finishLoad, generateClientId, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainedRenderers, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getInnerRenderers, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, peekClientId, prepareForRender, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IDirect
isStateful
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 
Methods inherited from interface org.apache.tapestry.IDirectEvent
isStateful, triggerEvent
 

Field Detail

TEXT_MODE

public static final String TEXT_MODE
Default single line editing text mode. Use as one of two possible parameters to the mode parameter.

See Also:
Constant Field Values

TEXT_AREA_MODE

public static final String TEXT_AREA_MODE
Multi line editing text mode. Use as one of two possible parameters to the mode parameter.

See Also:
Constant Field Values
Constructor Detail

InlineEditBox

public InlineEditBox()
Method Detail

getValue

public abstract String getValue()

setValue

public abstract void setValue(String value)

getMode

public abstract String getMode()

getMinWidth

public abstract int getMinWidth()

getMinHeight

public abstract int getMinHeight()

getDoFade

public abstract boolean getDoFade()

isDisabled

public abstract boolean isDisabled()

getListener

public abstract IActionListener getListener()

getParameters

public abstract Object getParameters()

setStateful

public abstract void setStateful(boolean value)

renderWidget

public void renderWidget(IMarkupWriter writer,
                         IRequestCycle cycle)
Similar to the semantics involved with normal AbstractComponent.renderComponent method writing component state to the output stream.

Specified by:
renderWidget in interface IWidget
Parameters:
writer - The markup writer used to write any output.
cycle - The corresponding request.

getUpdateUrl

public String getUpdateUrl()
Callback url used by client side widget to update server component.

Returns:
The url string to be used by the client side js function to notify this component that an update has been made.

getUpdateComponents

public List getUpdateComponents()
If set, will be used to update/refresh portions of a response during XHR requests.

For instance, if you have a page listing projects and you wanted to update an Any components contents whenever one of the project links was clicked you would use a DirectLink with the parameters:

      updateComponents="{'projectDetails'}"
      async="true"
 

Specified by:
getUpdateComponents in interface IDynamicInvoker
Returns:
The list of components to update, if any.

isAsync

public boolean isAsync()
Used to specify whether or not the result of this invocation should be returned asynchronously or use normal browser page reload semantics.

Async being true means responses will be encoded as XML using XmlHttpRequests. If you would like your request/response to be in another format - like JSON - you must also specify the additional parameter IDynamicInvoker.isJson(). Without setting the IDynamicInvoker.getUpdateComponents() parameter this parameter is pretty useless.

Specified by:
isAsync in interface IDynamicInvoker
Returns:
True if invocation should be processed asynchronously.
See Also:
IDynamicInvoker.isJson()

isJson

public boolean isJson()
Used to specify that the return invocation of the response created should be in the "http://json.org" format. Without setting the IDynamicInvoker.getUpdateComponents() parameter this parameter is pretty useless.

Specified by:
isJson in interface IDynamicInvoker
Returns:
True if response should be encoded using JSON semantics.
See Also:
org.apache.tapestry.IJSONRender}

trigger

public void trigger(IRequestCycle cycle)
Invoked by the direct service to have the component perform the appropriate action. The DirectLink component will notify its listener.

Specified by:
trigger in interface IDirect
Parameters:
cycle - The current request.

getEngine

public abstract IEngineService getEngine()
Injected.


getScript

public abstract IScript getScript()
Injected.


getListenerInvoker

public abstract ListenerInvoker getListenerInvoker()
Injected.



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