Examples of FaceletHandler


Examples of javax.faces.view.facelets.FaceletHandler

        // The alias is used later for informative purposes, so we append
        // some prefix to identify later where the errors comes from.
        String alias = "/compositeComponentMetadata/" + _removeFirst(url.getFile(), _baseUrl.getFile());
        try
        {
            FaceletHandler h = _compiler.compileCompositeComponentMetadata(url, alias);
            DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias,
                    alias, h, true);
            return f;
        }
        catch (FileNotFoundException fnfe)
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

                return true;
            }

            initFacetHandlersMap(ctx);

            FaceletHandler handler = _facetHandlersMap.get(name);

            if (handler != null)
            {
                AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
                // Pop the current composite component on stack, so #{cc} references
                // can be resolved correctly, because they are relative to the page
                // that define it.
                FaceletCompositionContext fcc = actx.getFaceletCompositionContext();
                UIComponent innerCompositeComponent = fcc.getCompositeComponentFromStack();
                fcc.popCompositeComponentToStack();
                // Pop the template context, so ui:xx tags and nested composite component
                // cases could work correctly
                TemplateContext itc = actx.popTemplateContext();
                try
                {
                    handler.apply(ctx, parent);
                }
                finally
                {
                    actx.pushTemplateContext(itc);
                    fcc.pushCompositeComponentToStack(innerCompositeComponent);
                }
                return true;
               
            }
            else
            {
                checkFacetRequired(ctx, parent, name);
                return true;
            }
        }
        else
        {
            AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
            // Pop the current composite component on stack, so #{cc} references
            // can be resolved correctly, because they are relative to the page
            // that define it.
            FaceletCompositionContext fcc = actx.getFaceletCompositionContext();
            UIComponent innerCompositeComponent = fcc.getCompositeComponentFromStack();
            fcc.popCompositeComponentToStack();
            // Pop the template context, so ui:xx tags and nested composite component
            // cases could work correctly
            TemplateContext itc = actx.popTemplateContext();
            try
            {
                for (FaceletHandler handler : _componentHandlers)
                {
                    handler.apply(ctx, parent);
                }
            }
            finally
            {
                actx.pushTemplateContext(itc);
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

        }

        String alias = "/" + _removeFirst(url.getFile(), _baseUrl.getFile());
        try
        {
            FaceletHandler h = _compiler.compile(url, alias);
            DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias, alias, h);
            return f;
        }
        catch (FileNotFoundException fnfe)
        {
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

        // some prefix to identify later where the errors comes from.
        String faceletId = "/"+ _removeFirst(url.getFile(), _baseUrl.getFile());
        String alias = "/viewMetadata" + faceletId;
        try
        {
            FaceletHandler h = _compiler.compileViewMetadata(url, alias);
            DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias,
                    faceletId, h);
            return f;
        }
        catch (FileNotFoundException fnfe)
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

        // The alias is used later for informative purposes, so we append
        // some prefix to identify later where the errors comes from.
        String alias = "/compositeComponentMetadata/" + _removeFirst(url.getFile(), _baseUrl.getFile());
        try
        {
            FaceletHandler h = _compiler.compileCompositeComponentMetadata(url, alias);
            DefaultFacelet f = new DefaultFacelet(this, _compiler.createExpressionFactory(), url, alias,
                    alias, h, true);
            return f;
        }
        catch (FileNotFoundException fnfe)
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

  public ScriptHandler(final ComponentConfig config) {
    super(config);
  }

  public void onComponentCreated(final FaceletContext context, final UIComponent component, final UIComponent parent) {
    final FaceletHandler next = getComponentConfig().getNextHandler();
    if (next instanceof TextHandler) {
      final String script = ((TextHandler) next).getText(context);
      if (StringUtils.isNotBlank(script)) {
        ((UIScript) component).setScript(script);
      }
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

    super(config);
  }

  public void onComponentCreated(final FaceletContext context, final UIComponent component, final UIComponent parent) {

    final FaceletHandler next = getComponentConfig().getNextHandler();
    if (next instanceof TextHandler) {
      final String style = ((TextHandler) next).getText(context);
      if (StringUtils.isNotBlank(style)) {
        ((UIStyle) component).setStyle(style);
      }
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

    } finally {
      if (is != null) {
        is.close();
      }
    }
    FaceletHandler result = new EncodingHandler(createFaceletHandler(mngr), encoding,
      getCompilationMessageHolder(mngr));
    setCompilationMessageHolder(mngr, null);
    // does not allow us to access at JBoss
    // FaceletHandler result = new EncodingHandler(mngr.createFaceletHandler(), encoding, mngr.getCompilationMessageHolder());
    // mngr.setCompilationMessageHolder(null);
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

  private Facelet createFacelet(InputStream is, URL url) throws IOException, FacesException, ELException {
    LOGGER.trace("Creating Facelet for: '{}'.", url);
    String alias = "/" + url.getFile().replaceFirst(this.baseUrl.getFile(), "");

    try {
      FaceletHandler h = ((LiteCompiler) this.compiler).compile(is, url, alias);
      return createDefaultFacelet(url, alias, h);
      //return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias, h);
    } catch (FileNotFoundException fnfe) {
      LOGGER.warn("{} not found at {}", alias, url.toExternalForm());
      throw new FileNotFoundException("Facelet Not Found: ");
View Full Code Here

Examples of javax.faces.view.facelets.FaceletHandler

  private Facelet createFacelet(InputStream is, String alias) throws IOException, FacesException, ELException {
    LOGGER.trace("Creating Facelet for: {}", alias);
    URL url = resolveURL("/");

    try {
      FaceletHandler h = ((LiteCompiler) this.compiler).compile(is, url, alias);

      return createDefaultFacelet(url, alias, h);
      //return new DefaultFacelet(this, this.compiler.createExpressionFactory(), url, alias, h);
    } catch (FileNotFoundException fnfe) {
      throw new FileNotFoundException("Facelet Not Found: " + alias);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.