net.sf.tacos.ajax.components
Class ProgressBar

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

public abstract class ProgressBar
extends BaseComponent
implements 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(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  IEngineService getAjaxService()
          Injected PartialService
abstract  String getElement()
          Element to wrap body with
 String getLinkString()
          Constructs a PartialService link request.
 NumberFormat getNumberFormat()
          Number formatter
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(IMarkupWriter writer, IRequestCycle cycle)
          
abstract  void setWorker(ProgressWorker worker)
          sets the worker
 void trigger(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, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, 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, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, 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 IEngineService getAjaxService()
Injected PartialService


getElement

public abstract String getElement()
Element to wrap body with


renderComponent

protected void renderComponent(IMarkupWriter writer,
                               IRequestCycle cycle)


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(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 IDirect

trigger

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

Specified by:
trigger in interface 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 PartialService link request.

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