Package org.olat.core.gui.components

Examples of org.olat.core.gui.components.ComponentRenderer


  /* (non-Javadoc)
   * @see org.olat.core.gui.render.intercept.InterceptHandlerInstance#createInterceptComponentRenderer(org.olat.core.gui.components.ComponentRenderer)
   */
  public ComponentRenderer createInterceptComponentRenderer(final ComponentRenderer originalRenderer) {
    return new ComponentRenderer(){

      public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
        //source.getChangedExplanationObject
        if (source.isDomReplaceable() && source.isDirtyForUser() && isLargestDirty(source)) {
          sb.append("<fieldset><legend><a accesskey=\"2\" href=\"#zz\" name=\"zz\">changed</a></legend>");
View Full Code Here


  /**
   * @param source
   * @return
   */
  protected ComponentRenderer getComponentRendererFor(Component source) {
    ComponentRenderer compRenderer;
    // to do: let "source - renderer pairs" be configured via spring for each mode like
    // default, accessibility, printing
    if (isForScreenReader()) {
      ComponentRenderer cr = screenReaderRenderers.get(source.getClass());
      if (cr != null) {
        compRenderer = cr;
      } else {
        compRenderer = source.getHTMLRendererSingleton();
      }
View Full Code Here

        final InterceptHandlerInstance inlineTranslationI = (inlineTranslationH == null ? null : inlineTranslationH.createInterceptHandlerInstance());
       
        return new InterceptHandlerInstance() {

          public ComponentRenderer createInterceptComponentRenderer(ComponentRenderer originalRenderer) {
            ComponentRenderer toUse = originalRenderer;
            if (screenReaderI != null) {
              toUse = screenReaderI.createInterceptComponentRenderer(toUse);
            }
            if (winmgrImpl.isShowDebugInfo() && debugI != null) {
              toUse = debugI.createInterceptComponentRenderer(toUse);
View Full Code Here

  InlineTranslationInterceptHandlerController(UserRequest ureq, WindowControl control) {
    super(ureq, control);
    // the deleagating component is ony used to provide the
    // inlineTranslationURLBuilder to be able to create the translation tool
    // links
    delegatingComponent = new DelegatingComponent("delegatingComponent", new ComponentRenderer() {
      public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator,
          RenderResult renderResult, String[] args) {
        // save urlbuilder for later use (valid only for one
        // request scope thus
        // transient, normally you may not save the url builder
View Full Code Here

  public InterceptHandlerInstance createInterceptHandlerInstance() {
    return this;
  }

  public ComponentRenderer createInterceptComponentRenderer(final ComponentRenderer originalRenderer) {
    return new ComponentRenderer() {
      public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator,
          RenderResult renderResult, String[] args) {
        // ------------- show translator keys
        // we must let the original renderer do its work so that the
        // collecting translator is callbacked.
View Full Code Here

   * @param wControl needed for subsequent debug-actions e.g. on a modal screen
   */
  public GuiDebugDispatcherController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);

    dc = new DelegatingComponent("deleg", new ComponentRenderer() {

      public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator,
          RenderResult renderResult, String[] args) {
        // save urlbuilder for later use (valid only for one request scope thus
        // transient, normally you may not save the url builder for later usage)
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.olat.core.gui.render.debug.DebugHandler#createDebugComponentRenderer(org.olat.core.gui.components.ComponentRenderer)
   */
  public ComponentRenderer createInterceptComponentRenderer(final ComponentRenderer originalRenderer) {
    return new ComponentRenderer() {

      public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator,
          RenderResult renderResult, String[] args) {
        if (debugURLBuilder != null && !DebugHelper.isProtected(source)) {
          // remember source for later debug info access
View Full Code Here

   * @param source
   * @see org.olat.core.gui.render.ui.ComponentRenderer
   */
  public void renderBodyOnLoadJSFunctionCall(StringOutput sb, Component source, RenderingState rstate) {
    if (source != null && source.isVisible()) {
      ComponentRenderer cr = findComponentRenderer(source);
      cr.renderBodyOnLoadJSFunctionCall(this, sb, source, rstate);
    }
  }
View Full Code Here

   * @param sb
   * @param source
   */
  public void renderHeaderIncludes(StringOutput sb, Component source, RenderingState rstate) {
    if (source != null && source.isVisible()) {
      ComponentRenderer cr = findComponentRenderer(source);
     
      URLBuilder cubu = urlBuilder.createCopyFor(source);
      cr.renderHeaderIncludes(this, sb, source, cubu, translator, rstate);
    }
  }
View Full Code Here

        } else {
          sb.append("<div id=\"o_c").append(source.getDispatchID()).append("\">");
        }
      }     
     
      ComponentRenderer cr = findComponentRenderer(source);
      URLBuilder cubu = urlBuilder.createCopyFor(source);
     
      // OLAT-1973
      if (GUIInterna.isLoadPerformanceMode()) {
        StringBuilder pathsb = new StringBuilder();
        Component cc = source;
        Container ccpar = cc.getParent();
        while (ccpar != null) { // omit content pane
          // find out name under which cc was registered in its parent - that is the relevant name, not the name of the component itself
          Map namedChildren = ccpar.getComponents();
          for (Iterator it_chd = namedChildren.keySet().iterator(); it_chd.hasNext();) {
            String chdName = (String) it_chd.next();
            Component chd = ccpar.getComponent(chdName);
            if (chd == cc) {
              // found -> append name
              pathsb.append(chdName).append('!');
              break;
            }
          }
          cc = ccpar;
          ccpar = cc.getParent();
        }     
        cubu.setComponentPath(pathsb.toString());
      }
     
      renderResult.incNestedLevel();
 
      // ---- for gui debug mode, direct the rendering to a special componentrenderer
      InterceptHandlerInstance dhi = renderResult.getInterceptHandlerInstance();
      if (dhi != null) {
          cr = dhi.createInterceptComponentRenderer(cr);
      }
     
      try {
        int preRenderLength = sb.length();
        cr.render(this, sb, source, cubu, componentTranslator, renderResult, args);
        if (preRenderLength == sb.length()) {
          // Add bugfix for IE min-height on empty div problem: min-height does
          // not get applied when div contains an empty comment.
          // Affects IE6, IE7
          sb.append("<!-- empty -->");
View Full Code Here

TOP

Related Classes of org.olat.core.gui.components.ComponentRenderer

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.