net.sf.tacos.ajax.components
Class ProgressBar

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.BaseComponent
              extended by net.sf.tacos.ajax.components.ProgressBar
All Implemented Interfaces:
Locatable, LocationHolder, org.apache.tapestry.IComponent, org.apache.tapestry.IDirect, org.apache.tapestry.IRender, org.apache.tapestry.ITemplateComponent

public abstract class ProgressBar
extends org.apache.tapestry.BaseComponent
implements org.apache.tapestry.IDirect

Generates and renders a progress bar for use with pages that have extremely heavy loads. It is intended that the ProgressWorker being managed by this component be started as a seperate thread from the page requesting processing. This component will cause the page to be re-loaded every few number of seconds, with the default being 4.

Author:
Jesse Kuhnert

Constructor Summary
ProgressBar()
           
 
Method Summary
 void cancelTask(org.apache.tapestry.IRequestCycle cycle)
          Cancels the threaded run of the currently running task, if selected by the user and if the specified task adheres to the cancel request.
abstract  AjaxWebRequest getAjaxRequest()
          Injected request
abstract  org.apache.tapestry.engine.IEngineService getAjaxService()
          Injected AjaxDirectService
abstract  String getElement()
          Element to wrap body with
 String getLinkString()
          Constructs a AjaxDirectService link request.
 NumberFormat getNumberFormat()
          Number formatter
abstract  String getOnCompleteObject()
          Js object to call when completed
abstract  int getTruncateLength()
          Gets the value of truncate
 String getUpdateId()
          Gets this components unique id, or if available the id specified in the html attribute.
abstract  ProgressWorker getWorker()
          gets the worker this component is managing
 boolean isStateful()
          
protected  void renderComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          
abstract  void setWorker(ProgressWorker worker)
          sets the worker
 void trigger(org.apache.tapestry.IRequestCycle cycle)
          Called for each refresh of component.
 String truncate(String input)
          Used by UI to truncate a long string to a certain length, followed by 3 ellipses.
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty
 
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
 

Constructor Detail

ProgressBar

public ProgressBar()
Method Detail

getWorker

public abstract ProgressWorker getWorker()
gets the worker this component is managing


setWorker

public abstract void setWorker(ProgressWorker worker)
sets the worker


getTruncateLength

public abstract int getTruncateLength()
Gets the value of truncate


getAjaxService

public abstract org.apache.tapestry.engine.IEngineService getAjaxService()
Injected AjaxDirectService


getAjaxRequest

public abstract AjaxWebRequest getAjaxRequest()
Injected request


getElement

public abstract String getElement()
Element to wrap body with


getOnCompleteObject

public abstract String getOnCompleteObject()
Js object to call when completed


renderComponent

protected void renderComponent(org.apache.tapestry.IMarkupWriter writer,
                               org.apache.tapestry.IRequestCycle cycle)

Overrides:
renderComponent in class org.apache.tapestry.BaseComponent

getNumberFormat

public NumberFormat getNumberFormat()
Number formatter


truncate

public String truncate(String input)
Used by UI to truncate a long string to a certain length, followed by 3 ellipses.

Parameters:
input -
Returns:
See Also:
StringUtils.abbreviate(java.lang.String, int)

cancelTask

public void cancelTask(org.apache.tapestry.IRequestCycle cycle)
Cancels the threaded run of the currently running task, if selected by the user and if the specified task adheres to the cancel request.

Parameters:
cycle -

isStateful

public boolean isStateful()

Specified by:
isStateful in interface org.apache.tapestry.IDirect

trigger

public void trigger(org.apache.tapestry.IRequestCycle cycle)
Called for each refresh of component. Does nothing.

Specified by:
trigger in interface org.apache.tapestry.IDirect

getUpdateId

public String getUpdateId()
Gets this components unique id, or if available the id specified in the html attribute.

Returns:

getLinkString

public String getLinkString()
Constructs a AjaxDirectService link request.

Returns:
The fully qualified URL string to call the AjaxDirectService with.