Package org.olat.core.gui.render

Examples of org.olat.core.gui.render.StringOutput


   * some js/css/onLoad code from the component to render/work correctly.
   *
   * @return
   */
  public StringOutput renderBodyOnLoadJSFunctionCall() {
    StringOutput sb = new StringOutput(100);
    renderer.renderBodyOnLoadJSFunctionCall(sb, vc);
    return sb;
  }
View Full Code Here


   * some js/css/onLoad code from the component to render/work correctly.
   *
   * @return
   */
  public StringOutput renderHeaderIncludes() {
    StringOutput sb = new StringOutput(100);
    renderer.renderHeaderIncludes(sb, vc);
    return sb;
  }
View Full Code Here

   * <p>
   * For static references (e.g. images which cannot be delivered using css):
   * use renderStaticURI instead!
   */
  public StringOutput relLink(String URI) {
    StringOutput sb = new StringOutput(100);
    Renderer.renderNormalURI(sb, URI);
    return sb;
  }
View Full Code Here

   *
   * @param URI
   * @return
   */
  public StringOutput staticLink(String URI) {
    StringOutput sb = new StringOutput(100);
    Renderer.renderStaticURI(sb, URI);
    return sb;
  }
View Full Code Here

   * @param pageName
   * @param hoverTextKey
   * @return
   */
  public StringOutput contextHelpWithWrapper(String packageName, String pageName, String hoverTextKey) {
    StringOutput sb = new StringOutput(100);
    if (ContextHelpModule.isContextHelpEnabled()) {
      sb.append("<div class=\"b_contexthelp_wrapper\">");
      sb.append(contextHelp(packageName, pageName, hoverTextKey));
      sb.append("</div>");
    }
    return sb;
  }
View Full Code Here

   * @param pageName
   * @param hoverTextKey
   * @return
   */
  public StringOutput contextHelp(String packageName, String pageName, String hoverTextKey) {
    StringOutput sb = new StringOutput(100);
    if (ContextHelpModule.isContextHelpEnabled()) {
      String hooverText = renderer.getTranslator().translate(hoverTextKey);
      if (hooverText != null) hooverText = StringEscapeUtils.escapeHtml(hooverText).toString();
      String langCode = renderer.getTranslator().getLocale().toString();
      sb.append("<a href=\"javascript:contextHelpWindow('");
      Renderer.renderNormalURI(sb, "help/");
      sb.append(langCode).append("/").append(packageName).append("/").append(pageName);
      sb.append("')\" title=\"").append(hooverText).append("\" class=\"b_contexthelp\"></a>");
    }
    return sb;
  }
View Full Code Here

   * @param bundleName e.g. "org.olat.core"
   * @param pageName e.g. "my-page.html"
   * @return
   */
  public StringOutput contextHelpRelativeLink(String bundleName, String pageName, String linkText) {
    StringOutput sb = new StringOutput(100);
    if (ContextHelpModule.isContextHelpEnabled()) {
      sb.append("<a href=\"");
      if (bundleName == null) {
        renderer.getUrlBuilder().buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { pageName }, isIframePostEnabled? AJAXFlags.MODE_TOBGIFRAME : AJAXFlags.MODE_NORMAL);       
      } else {
        renderer.getUrlBuilder().buildURI(sb, new String[] { VelocityContainer.COMMAND_ID, PARAM_CHELP_BUNDLE }, new String[] { pageName, bundleName }, isIframePostEnabled? AJAXFlags.MODE_TOBGIFRAME : AJAXFlags.MODE_NORMAL);       
      }
      sb.append("\" ");
      if(isIframePostEnabled) {
        renderer.getUrlBuilder().appendTarget(sb);
      }
      sb.append(">");
      sb.append(linkText);
      sb.append("</a>");
    }
    return sb;
 
View Full Code Here

   * @param componentName
   * @return
   */
  public StringOutput renderForce(String componentName) {
    Component source = renderer.findComponent(componentName);
    StringOutput sb;
    if (source == null) {
      sb = new StringOutput(1);
    } else {
      sb = renderer.render(source);
    }
    return sb;
  }
View Full Code Here

  }
 

  private StringOutput doRender(String componentName, String[] args) {
    Component source = renderer.findComponent(componentName);
    StringOutput sb;
    if (source == null) {
      sb = new StringOutput(1);
      sb.append(">>>>>>>>>>>>>>>>>>>>>>>>>> component " + componentName + " could not be found to be rendered!");
    } else {
      sb = renderer.render(source, args);
    }
    return sb;
  }
View Full Code Here

          cur.appendChild(doc.createTextNode(c.getDescription()));
          leaf.appendChild(cur);
         
          cur = doc.createElement(XML_TYPE);
          String typeName = re.getOlatResource().getResourceableTypeName();      // add the resource type
          StringOutput typeDisplayText = new StringOutput(100);
          if (typeName != null) { // add typename code
            RepositoryEntryIconRenderer reir = new RepositoryEntryIconRenderer();
            cur.setAttribute(XML_TYPE_CSS, reir.getIconCssClass(re));
            String tName = ControllerFactory.translateResourceableTypeName(typeName, repoTypeTranslator.getLocale());
            typeDisplayText.append(tName);
          } else {
            typeDisplayText.append(repoTypeTranslator.translate(NLS_CIF_TYPE_NA));
          }
          cur.appendChild(doc.createTextNode(typeDisplayText.toString()));
          leaf.appendChild(cur);

         
          Element links = doc.createElement(XML_LINKS);                          // links container
          String tmp = "";
View Full Code Here

TOP

Related Classes of org.olat.core.gui.render.StringOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.