Package com.sun.jsftemplating.layout.descriptors

Examples of com.sun.jsftemplating.layout.descriptors.LayoutElement


        + "' attribute not found on '" + FOREACH_ELEMENT
        + "' Element!");
  }

  // Create new LayoutForEach
  LayoutElement forEachElt =  new LayoutForEach(parent, list, key);

  // Add children...
  addChildLayoutElements(forEachElt, node);

  // Return the forEach
View Full Code Here


        + "' attribute not found on '" + WHILE_ELEMENT
        + "' Element!");
  }

  // Create new LayoutWhile
  LayoutElement whileElt =  new LayoutWhile(parent, condition);

  // Add children...
  addChildLayoutElements(whileElt, node);

  // Return the while
View Full Code Here

  if ((name == null) || (name.trim().equals(""))) {
      throw new RuntimeException("'" + NAME_ATTRIBUTE
        + "' attribute not found on '" + ATTRIBUTE_ELEMENT
        + "' Element!");
  }
  LayoutElement attributeElt = null;

  // Check if we're setting this on a LayoutComponent vs. LayoutMarkup
  // Do this after checking for "name" to show correct error message
  LayoutComponent comp = null;
  if (parent instanceof LayoutComponent) {
View Full Code Here

        + "' Element!");
  }

  // Check to see if this is inside a LayoutComponent, if so, we must
  // use a LayoutComponent for it to get rendered
  LayoutElement markupElt = null;
  if ((parent instanceof LayoutComponent)
    || LayoutElementUtil.isNestedLayoutComponent(parent)) {
      // Make a "markup" LayoutComponent..
      ComponentType type = ensureMarkupType(parent);
      markupElt = new LayoutComponent(
View Full Code Here

      TemplateReader reader = env.getReader();
      TemplateParser parser = reader.getTemplateParser();
      String condition = parser.readUntil('>', false).trim();

      // Create new LayoutIf
      LayoutElement parent = env.getParent();
// FIXME: the 'if' below checks to see if 'condition' ends with '/', yet I don't see this code removing the '/'... isn't that a problem?  Test and fix!
      LayoutElement ifElt =  new LayoutIf(parent, condition);
      parent.addChildLayoutElement(ifElt);

      if (condition.endsWith("/")) {
    reader.popTag()// Don't look for end tag
      } else {
View Full Code Here

      TemplateReader reader = env.getReader();
      TemplateParser parser = reader.getTemplateParser();
      String condition = parser.readUntil('>', false).trim();

      // Create new LayoutWhile
      LayoutElement parent = env.getParent();
// FIXME: Support condition="..."
      LayoutElement elt =  new LayoutWhile(parent, condition);
      parent.addChildLayoutElement(elt);

      if (condition.endsWith("/")) {
    reader.popTag()// Don't look for end tag
      } else {
View Full Code Here

// FIXME: Consider allowing #{} expressions -- they're interpretted as comments as written... fix this.
      String key = parser.readUntil(':', true).trim();
      String listExp = parser.readUntil('>', true).trim();

      // Create new LayoutForEach
      LayoutElement parent = env.getParent();
      LayoutElement elt =  new LayoutForEach(parent, listExp, key);
      parent.addChildLayoutElement(elt);

      if (listExp.endsWith("/")) {
    reader.popTag()// Don't look for end tag
      } else {
View Full Code Here

    }
    id = id.substring(1, id.length() - 1).trim();
      }

      // Create new LayoutFacet
      LayoutElement parent = env.getParent();
      LayoutFacet facetElt =  new LayoutFacet(parent, id);
      parent.addChildLayoutElement(facetElt);

      // Determine if this is a facet place holder (i.e. we're defining
      // a renderer w/ a facet), or if it is a facet value to set on a
      // containing component.
      boolean isRendered =
View Full Code Here

      // No LayoutDefinition to tell us how to create it... return null
      return null;
  }

  // Attempt to find a LayoutComponent matching the id
  LayoutElement elt =
      LayoutDefinition.getChildLayoutElementById(context, id, ld, comp);

  // Create the child from the LayoutComponent
  return getChild(comp, context, (LayoutComponent) elt);
    }
View Full Code Here

     @param  clientId    The component <code>clientId</code> for which to
     *          obtain a {@link LayoutComponent}.
     */
    public static LayoutComponent getLayoutComponent(FacesContext ctx, String ldKey, String clientId) throws LayoutDefinitionException {
        // Find the page first...
        LayoutElement layElt = null;
        if (ldKey != null) {
// FIXME: This fixme probably belongs in getLD(ctx, key): initPage should only be invoked if the page is accessed for the first time on the request.  This potentially calls it multiple times.
            layElt = getLayoutDefinition(ctx, ldKey);
            if (layElt == null) {
                throw new LayoutDefinitionException(
                        "Unable to find LayoutDefinition ('" + ldKey + "')");
            }
        } else {
      layElt = ViewRootUtil.getLayoutDefinition(
    FacesContext.getCurrentInstance().getViewRoot());
        }

  // Save the current LayoutComposition Stack
  //  - This is needed b/c we may be in the middle of walking the tree
  //  - already and we need ot use this Stack... so we must save the
  //  - Stack and use a fresh one.  We must restore it later.
  Stack<LayoutElement> oldStack = LayoutComposition.getCompositionStack(ctx);
  try {
      LayoutComposition.setCompositionStack(
    ctx, new Stack<LayoutElement>());

      // Create a StringTokenizer over the clientId
      StringTokenizer tok = new StringTokenizer(clientId, ":");

      // Walk the LD looking for the individual id's specified in the
      // clientId.
      String id = null;
      LayoutElement match = null;
      while (tok.hasMoreTokens()) {
    // I don't want to create a bunch of objects to check for
    // instanceof NamingContainer.  I can't check the class file
    // b/c there is no way for me to know what class gets created
    // before actually creating the UIComponent.  This is because
View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.layout.descriptors.LayoutElement

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.