docs: public String getWidget() {
  
          StringBuffer result = new StringBuffer();
  
          CmsProgressThread thread = getProgressThread(getKey());
  
          // if the thread is finished before the widget is rendered
          // show directly the result
          if ((thread != null) && (!thread.isAlive())) {
              result.append("<script type=\"text/javascript\">\n");
              result.append("\tprogressState = 0;\n");
              result.append("\tprogressResult = '");
              result.append(CmsStringUtil.escapeJavaScript(getActualProgress()));
              result.append("';\n");
              result.append("\t");
              result.append(getJsFinishMethod());
              result.append("();\n");
              result.append("</script>\n");
          } else {
              // check if to show the wait symbol
              boolean showWait = false;
              if (getShowWaitTime() > 0) {
                  // show if the thread is running and the time running is smaller than the configured
                  if ((thread != null) && (thread.isAlive()) && (thread.getRuntime() < getShowWaitTime())) {
                      showWait = true;
                  } else if ((thread == null) && (getShowWaitTime() > 0)) {
                      // show if there is no thread
                      showWait = true;
                  }
              }
  
              result.append("<div id=\"progressbar_desc\" style=\"margin-bottom:5px;display:");
              result.append(showWait ? "none" : "block");
              result.append("\"></div>");
  
              result.append("<div style=\"width:");
              result.append(getWidth());
              result.append(";border-width:1px;border-style:solid;padding:0px;margin:0px;float:left;display:");
              result.append(showWait ? "none" : "inline");
              result.append(";\">\n");
              result.append("\t<div id=\"progressbar_bar\" style=\"width:0%;background-color:");
              result.append(getColor());
              result.append(";\">&nbsp;</div>\n");
              result.append("</div>\n");
              result.append("&nbsp;");
              result.append("<div id=\"progressbar_percent\" style=\"display:");
              result.append(showWait ? "none" : "inline");
              result.append(";\" >0%</div>\n");
  
              result.append(
                  "<div id=\"progressbar_error\" style=\"display:none;color:#B40000;font-weight:bold;\"></div>\n");
  
              result.append("<div id=\"progressbar_wait\" style=\"display:");
              result.append(showWait ? "block" : "none");
              result.append(";color:#000099;font-weight:bold;\"><img src=\"");
              result.append(CmsWorkplace.getSkinUri());
              result.append("commons/wait.gif\" width='32' height='32' alt='' align='absmiddle' />");
              result.append(
                  org.opencms.workplace.Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key(
                      org.opencms.workplace.Messages.GUI_AJAX_REPORT_WAIT_0));
              result.append("</div>\n");
  
              result.append("<script type=\"text/javascript\">\n");
              result.append("\tstartProgressBar();\n");
              result.append("</script>\n");
          }
  
          return result.toString();
      }