TaackUiProgressBarService (taack-ui 0.5.5-SNAPSHOT API)
Package: taack.render

[Groovy] Class TaackUiProgressBarService

    • taack.render.TaackUiProgressBarService


    • @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)
        }
      }

      • Methods Summary

      • Inherited Methods Summary

          Inherited Methods 
          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()
      • Constructor Detail

        • TaackUiProgressBarService()

      • Method Detail

        • 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

          Parameters:
          id - The progressbar ID
          progressDelta - Number of steps to add
          Returns:
          Current progression

        • boolean progressEnded(java.lang.String id)

          Call this method to display the block specified on progressStart once the task is finished @return

          Parameters:
          id

        • 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.

          Parameters:
          id - The progressbar ID
          Returns:
          Max number of steps

        • java.lang.String progressStart(groovy.lang.Closure<BlockSpec> ends, java.lang.Integer max)

          Start to display the progressbar

          Parameters:
          ends - Block to display once the task is finished
          max - Number of task steps
          Returns:
          The ID of the progressbar