@grails.compiler.GrailsCompileStatic class TaackUiProgressBarService extends java.lang.Object
Service managing progressbar. The action must return immediately after having initialised the progressbar.
Usage:
String pId = taackUiProgressBarService.progressStart(CrewUiService.messageBlock("Done .."), rowCount)
def task = task {
customerRows.eachWithIndex { String[] row, int i ->
importCustomer(row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17])
taackUiProgressBarService.progress(pId, 1)
contactRows.eachWithIndex { String[] row, int i ->
importContact(currentUser, row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8])
taackUiProgressBarService.progress(pId, 1)
}
taackUiProgressBarService.progressEnded(pId)
}
}
Type | Name and description |
---|---|
TaackUiService |
taackUiService |
Constructor and description |
---|
TaackUiProgressBarService
() |
Type Params | Return Type | Name and description |
---|---|---|
|
UiBlockSpecifier |
buildEndBlock(java.lang.String ret) |
|
static UiBlockSpecifier |
buildProgressBlock(java.lang.String ret, int max, int value) |
|
java.lang.Integer |
progress(java.lang.String id, java.lang.Integer progressDelta) Increment the progress bar |
|
boolean |
progressEnded(java.lang.String id) Call this method to display the block specified on progressStart once the task is finished |
|
void |
progressEndedClosure(java.lang.String id, groovy.lang.Closure<BlockSpec> c) |
|
groovy.lang.Closure<BlockSpec> |
progressEnds(java.lang.String id) |
|
boolean |
progressHasEnded(java.lang.String id) |
|
java.lang.Integer |
progressMax(java.lang.String id) Retrieve the max number of steps of a progress bar. |
|
java.lang.String |
progressStart(groovy.lang.Closure<BlockSpec> ends, java.lang.Integer max) Start to display the progressbar |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Increment the progress bar
id
- The progressbar IDprogressDelta
- Number of steps to addCall this method to display the block specified on progressStart once the task is finished @return
Retrieve the max number of steps of a progress bar.
id
- The progressbar IDStart to display the progressbar
ends
- Block to display once the task is finishedmax
- Number of task stepsGroovy Documentation