|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.commons.CmsProgressWidget
public class CmsProgressWidget
This is a widget to be used in a dialog which should show a progress bar based on a list.
The progress bar uses Ajax to not reload the whole page. The code which runs inside the thread has to update the progress in the current thread.
The progress to be displayed is the progress of building large lists which can take some time until they are finished.
There is a progress bar shown with the percentages on the left. Additionaly it is possible to show a description above the progress bar.
A_CmsListDialog
Field Summary | |
---|---|
static java.lang.String |
PARAMETER_KEY
The name of the key request parameter. |
static java.lang.String |
PARAMETER_REFRESHRATE
The name of the refresh rate request parameter. |
static java.lang.String |
PARAMETER_SHOWWAITTIME
The name of the show wait time request parameter. |
Constructor Summary | |
---|---|
CmsProgressWidget(CmsJspActionElement jsp)
Public constructor. |
|
CmsProgressWidget(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables. |
Method Summary | |
---|---|
java.lang.String |
getActualProgress()
Returns the actual progress in percent. |
java.lang.String |
getColor()
Returns the color of the progress bar. |
java.lang.String |
getJsFinishMethod()
Returns the name of the JavaScript method to call after progress is finished. |
java.lang.String |
getJsIncludes()
Generates the necessary JavaScript inclusion code for this widget. |
CmsJspActionElement |
getJsp()
Returns the current JSP action element. |
java.lang.String |
getKey()
Returns the unique key of the thread belonging to this widget. |
static CmsProgressThread |
getProgressThread(java.lang.String key)
Returns the thread for the progress with the given key. |
int |
getRefreshRate()
Returns the refresh rate in ms of the progress bar. |
int |
getShowWaitTime()
Returns the time period the show the wait symbol before the progress bar is shown. |
java.lang.String |
getWidget()
Generates the widget HTML for the progress bar. |
java.lang.String |
getWidth()
Returns the width of the progress bar. |
static void |
removeProgressThread(java.lang.String key)
Removes the thread for the progress with the given key from the list with the actual threads. |
void |
setColor(java.lang.String color)
Sets the color of the progress bar. |
void |
setJsFinishMethod(java.lang.String jsFinishMethod)
Sets the name of the JavaScript method to call after progress is finished. |
void |
setRefreshRate(int refreshRate)
Sets the refresh rate in ms of the progress bar. |
void |
setShowWaitTime(int showWaitTime)
Sets the time period the show the wait symbol before the progress bar is shown. |
void |
setWidth(java.lang.String width)
Sets the width of the progress bar. |
void |
startProgress(A_CmsListDialog list)
Starts a thread for the progress on the given list. |
void |
startProgress(A_CmsListDialog list,
boolean abortExisting)
Starts a thread for the progress on the given list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PARAMETER_KEY
public static final java.lang.String PARAMETER_REFRESHRATE
public static final java.lang.String PARAMETER_SHOWWAITTIME
Constructor Detail |
---|
public CmsProgressWidget(CmsJspActionElement jsp)
jsp
- an initialized JSP action elementpublic CmsProgressWidget(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
context
- the JSP page contextreq
- the JSP requestres
- the JSP responseMethod Detail |
---|
public static CmsProgressThread getProgressThread(java.lang.String key)
key
- the key of the thread
public static void removeProgressThread(java.lang.String key)
key
- the key of the thread for the progress to remove from the listpublic java.lang.String getActualProgress()
The return value depends on the state of the progress/thread. This can be
The result will be interpreted by the JavaScript method "updateProgressbar()".
public java.lang.String getColor()
public java.lang.String getJsFinishMethod()
public java.lang.String getJsIncludes()
public CmsJspActionElement getJsp()
public java.lang.String getKey()
public int getRefreshRate()
public int getShowWaitTime()
public java.lang.String getWidget()
public java.lang.String getWidth()
public void setColor(java.lang.String color)
color
- the color of the progress bar to setpublic void setJsFinishMethod(java.lang.String jsFinishMethod)
jsFinishMethod
- the name of the JavaScript method to call after progress is finished to setpublic void setRefreshRate(int refreshRate)
refreshRate
- the refresh rate in ms of the progress bar to setpublic void setShowWaitTime(int showWaitTime)
showWaitTime
- the time period the show the wait symbol before the progress bar is shown to setpublic void setWidth(java.lang.String width)
width
- the width of the progress bar to setpublic void startProgress(A_CmsListDialog list)
list
- the list to use for the progress barpublic void startProgress(A_CmsListDialog list, boolean abortExisting)
list
- the list to use for the progress barabortExisting
- if true then an already existing thread will be killed
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |