Package org.ajax4jsf.resource

Examples of org.ajax4jsf.resource.InternetResource


   * @throws FacesException
   */
  public void writeLog(FacesContext context, PrintWriter out) throws FacesException {
    String logname = context.getExternalContext().getInitParameter(LOGFILE_PARAM);
    if (null != logname) {
      InternetResource logResource = InternetResourceBuilder.getInstance().createResource(this,logname);
      out.print("<h2 onclick=\"toggle('log')\" class=\"a4j_debug\">");
      writeToggleMark(out, "log");
      out
          .println("Faces log: </h2><div id='log' style='display: none;'  class='log a4j_debug'>");
      out.print("<iframe name='log' class='log' src='"+logResource.getUri(context,null)+"'><a href='src='"+logResource.getUri(context,null)+"'>Faces log file </a> </iframe>");
      out.println("</div>");
    }
  }
View Full Code Here


      InternetResource[] resources, UIComponent component) {
    if (null != resources) {
      LinkedHashSet<String> uris = new LinkedHashSet<String>(); // Collections.singleton(ajaxScript.getUri(context,
      // null));
      for (int i = 0; i < resources.length; i++) {
        InternetResource resource = resources[i];
        uris.add(resource.getUri(context, component));
      }
      return uris;
    }
    return null;
  }
View Full Code Here

   *      java.lang.String)
   */
  public String getResourceURL(FacesContext context, String url) {
    String resourceURL;
    if (url.startsWith(InternetResource.RESOURCE_URI_PREFIX)) {
      InternetResource resource = InternetResourceBuilder
          .getInstance()
          .createResource(
              null,
              url
                  .substring(InternetResource.RESOURCE_URI_PREFIX_LENGTH));
      resourceURL = resource.getUri(context, null);
    } else {
      resourceURL = super.getResourceURL(context, url);
    }
    return resourceURL;
  }
View Full Code Here

    return UIPaint2D.class;
  }

  protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
    String resourceClassName = ((UIPaint2D) component).isCacheable() ? Paint2DCachedResource.class.getName() : Paint2DResource.class.getName();
    InternetResource image = getResource(resourceClassName);
    image.encodeBegin(context, component, Collections.EMPTY_MAP);
   
    // fix for bug CH-1445
    String style = (String) component.getAttributes().get("style");
    if (null != style) writer.writeAttribute("style", style, null);
   
    String styleClass = (String) component.getAttributes().get("styleClass");
    String richPaint2DClass = "rich-paint2D";
    if (null != styleClass) {
      writer.writeAttribute("class", richPaint2DClass + " " + styleClass, null);
    } else {
      writer.writeAttribute("class", richPaint2DClass, null);
    }


    String hspace = (String) component.getAttributes().get("hspace");
    if (null != hspace) writer.writeAttribute("hspace", hspace, null);
    String vspace = (String) component.getAttributes().get("vspace");
    if (null != vspace) writer.writeAttribute("vspace", vspace, null);
   
    getUtils().encodeCustomId(context, component);
    getUtils().encodePassThru(context, component);
    image.encodeEnd(context, component);   
  }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.resource.InternetResource

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.