AjaxProgress Class Reference

Inherited by AjaxUploadProgress.

Collaboration diagram for AjaxProgress:

Collaboration graph
base refererrect $struct___string.html 25,16 89,40
[legend]

List of all members.

Public Member Functions

 AjaxProgress (String id, int maximum)
 AjaxProgress (int maximum)
void cancel ()
boolean completionEventsFired ()
void copyAndTrack (InputStream inputStream, OutputStream outputStream, long maxSize) throws IOException
void dispose ()
Throwable failure ()
String id ()
void incrementValue (long count)
boolean isCanceled ()
boolean isDone ()
boolean isFailed ()
boolean isStarted ()
boolean isSucceeded ()
long maximum ()
double percentage ()
void reset ()
void setCompletionEventsFired (boolean completionEventsFired)
void setDone (boolean done)
void setFailure (Throwable failure)
void setMaximum (long maximum)
void setStatus (String status)
void setValue (long value)
boolean shouldReset ()
String status ()
long value ()

Static Public Member Functions

static AjaxProgress progress (WOSession session, String id)
static void registerProgress (WOSession session, AjaxProgress progress)
static void unregisterProgress (WOSession session, AjaxProgress progress)

Private Attributes

boolean _canceled
boolean _completionEventsFired
boolean _done
Throwable _failure
String _id
long _maximum
boolean _reset
String _status
long _value


Detailed Description

AjaxProgress is the model for an AjaxProgressBar. By holding onto this, you can keep track of and control the progress of whatever operation is bound to this progress object.

Author:
mschrag

Constructor & Destructor Documentation

AjaxProgress ( int  maximum  ) 

Construct an AjaxProgress

Parameters:
maximum the maximum value of this progress

AjaxProgress ( String  id,
int  maximum 
)

Construct an AjaxProgress

Parameters:
id the id of this AjaxProgress (only useful if you're registering it with AjaxProgressBar's registry)
maximum the maximum value of this progress


Member Function Documentation

void cancel (  ) 

Cancels this procedure.

boolean completionEventsFired (  ) 

Returns whether or not this procedure has notified listeners of its completion.

Returns:
whether or not this procedure has notified listeners of its completion

void copyAndTrack ( InputStream  inputStream,
OutputStream  outputStream,
long  maxSize 
) throws IOException

Convenience method for copying a stream and tracking it with this progress model.

Parameters:
inputStream the inputstream to copy from
outputStream the outputstream to copy to
maxSize the maximum size to read
Exceptions:
IOException if there is a failure

void dispose (  ) 

Disposes any resources associated with this procedure.

Reimplemented in AjaxUploadProgress.

Throwable failure (  ) 

Returns the exception that caused this procedure to fail.

Returns:
the exception that caused this procedure to fail

String id (  ) 

Returns the id of this progress model.

Returns:
the id of this progress model

void incrementValue ( long  count  ) 

Increment value by the given amount.

Parameters:
count the mount to increment value by

boolean isCanceled (  ) 

Returns true if this procedure was canceled.

Returns:
true if this procedure was canceled

boolean isDone (  ) 

Returns whether or not this procedure is done.

Returns:
whether or not this procedure is done

boolean isFailed (  ) 

Returns true if this procedure failed (and was not canceled).

Returns:
true if this procedure failed (and was not canceled)

boolean isStarted (  ) 

Returns whether or not this procedure has started.

Returns:
whether or not this procedure has started

boolean isSucceeded (  ) 

Returns true if this procedure is done, not canceled, and not failed.

Returns:
true if this procedure is done, not canceled, and not failed

long maximum (  ) 

Returns the maximum value for this progress model.

Returns:
the maximum value for this progress model

double percentage (  ) 

Returns the percentage completion of this progress model (0.0 - 1.0).

Returns:
the percentage completion of this progress model (0.0 - 1.0)

static AjaxProgress progress ( WOSession  session,
String  id 
) [static]

Returns the progress object with the given id (or null if one does not exist).

Parameters:
session the session
id the id of the progress to retrieve
Returns:
the matching progess object (or null)

static void registerProgress ( WOSession  session,
AjaxProgress  progress 
) [static]

Register a progress object in the registry.

Parameters:
session the session
progress the progress object to register

void reset (  ) 

Flags the attached procedure to reset the next time it is processed.

void setCompletionEventsFired ( boolean  completionEventsFired  ) 

Sets whether or not this procedure has notified listeners of its completion.

Parameters:
completionEventsFired whether or not this procedure has notified listeners of its completion

void setDone ( boolean  done  ) 

Sets whether or not this procedure is done.

Parameters:
done whether or not this procedure is done

void setFailure ( Throwable  failure  ) 

Sets the exception that caused this procedure to fail.

Parameters:
failure the exception that caused this procedure to fail

void setMaximum ( long  maximum  ) 

Sets the maximum value for this progress model.

Parameters:
maximum the maximum value for this progress model

void setStatus ( String  status  ) 

Sets the current status message for this process.

Parameters:
status the current status message for this process

void setValue ( long  value  ) 

Sets the current value of this progress model. In the context of an upload, value would represent the number of bytes uploaded so far.

Parameters:
value the new value

boolean shouldReset (  ) 

Returns whether or not the attached procedure should reset the next time it is processed.

Returns:
whether or not the attached procedure should reset the next time it is processed

String status (  ) 

Returns the current status message for this process.

Returns:
the current status message for this process

static void unregisterProgress ( WOSession  session,
AjaxProgress  progress 
) [static]

Unregister a progress object from the registry.

Parameters:
session the session
progress the progress object to unregister

long value (  ) 

Returns the current value of this progress model. If this model isSucceeded, then this will return maximum().

Returns:
the current value of this progress model


Member Data Documentation

boolean _canceled [private]

boolean _completionEventsFired [private]

boolean _done [private]

Throwable _failure [private]

String _id [private]

long _maximum [private]

boolean _reset [private]

String _status [private]

long _value [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:38 2012 for Project Wonder by  doxygen 1.5.8