Package com.sun.facelets.tag

Examples of com.sun.facelets.tag.TagAttribute


    this.config = config;
  }

  public void apply(FaceletContext faceletContext, UIComponent uiComponent) throws IOException, FacesException,
      FaceletException, ELException {
    TagAttribute testNameAttribute = getRequiredAttribute(ATTR_NAME_TEST_CONDITION);
    String testName = (String)testNameAttribute.getObject(faceletContext);
    Object testValue = faceletContext.getAttribute(testName);
   
    if (testValue != null) {     
      setTargetValue(faceletContext, testValue);   
      config.getNextHandler().apply(faceletContext, uiComponent);
    }
    else {
      TagAttribute defaultExpression = getAttribute(ATTR_NAME_NOT_DEFINED);
      if (defaultExpression != null) {
        testValue = defaultExpression.getObject(faceletContext);
        setTargetValue(faceletContext, testValue);   
      }
    }
  }
View Full Code Here


      }
    }
  }

  private void setTargetValue(FaceletContext faceletContext, Object targetValue) {
    TagAttribute tovar = getAttribute(ATTR_NAME_TARGET_VAR);
    if (tovar != null) {
      String varName = (String)tovar.getObject(faceletContext);
      faceletContext.setAttribute(varName, targetValue);
    }
  }
View Full Code Here

  protected MetaRuleset createMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    if (UIPanel.class.isAssignableFrom(aClass)) {
      TagAttribute [] attrs = tag.getAttributes().getAll();
      for (int i = 0; i < attrs.length; i++) {
        TagAttribute attr = attrs[i];
        if (!attr.getLocalName().equals("rendered")) {
          metaRuleset.ignore(attr.getLocalName());
        }
      }
      return metaRuleset;
    } else {
      metaRuleset.ignore(TobagoConstants.ATTR_LABEL);
View Full Code Here

  protected MetaRuleset createMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    if (UIPanel.class.isAssignableFrom(aClass)) {
      TagAttribute [] attrs = tag.getAttributes().getAll();
      for (int i = 0; i < attrs.length; i++) {
        TagAttribute attr = attrs[i];
        if (!attr.getLocalName().equals("rendered")) {
          metaRuleset.ignore(attr.getLocalName());
        }
      }
      return metaRuleset;
    } else {
      metaRuleset.ignore(TobagoConstants.ATTR_LABEL);
View Full Code Here

      metaRuleset.ignore(TobagoConstants.ATTR_VALUE);
      return metaRuleset;
    } else {
      TagAttribute [] attrs = tag.getAttributes().getAll();
      for (int i = 0; i < attrs.length; i++) {
        TagAttribute attr = attrs[i];
        if (!(attr.getLocalName().equals(TobagoConstants.ATTR_CONVERTER)
            || attr.getLocalName().equals(TobagoConstants.ATTR_VALUE))) {
          metaRuleset.ignore(attr.getLocalName());
        }
      }
      return metaRuleset;
    }
  }
View Full Code Here

  public ColumnsHandler(final ComponentConfig config) {
    super(config);
   
    final ComponentConfig columnConfig;
   
    TagAttribute idAttribute = config.getTag().getAttributes().get("id");
    if (idAttribute != null && idAttribute.isLiteral()) {
      columnConfig = new ComponentConfig() {

        private Tag tag;

        {
          Tag initialTag = config.getTag();
          TagAttribute[] allInitialAttributes = initialTag.getAttributes().getAll();
          TagAttribute[] attributes = new TagAttribute[allInitialAttributes.length];
          for (int i = 0; i < allInitialAttributes.length; i++) {
            TagAttribute initialAttribute = allInitialAttributes[i];
            String localName = initialAttribute.getLocalName();
            String attributeValue = initialAttribute.getValue();
           
            if ("id".equals(localName)) {
              attributeValue += ITERATION_INDEX_EXPRESSION;
            }
           
            attributes[i] = new TagAttribute(initialAttribute.getLocation(),
                initialAttribute.getNamespace(),
                localName,
                initialAttribute.getQName(),
                attributeValue);
          }
         
          TagAttributes tagAttributes = new TagAttributes(attributes);
          this.tag = new Tag(initialTag, tagAttributes);
View Full Code Here

    }
  }

  private void initRendered(FaceletContext ctx) {
    TagAttribute renderedAttribute = getAttribute("rendered");
    if (renderedAttribute != null) {
      try {
        this.rendered = (Boolean) renderedAttribute.getObject(ctx);
      } catch (ClassCastException e) {
        this.rendered = true;
      }
    }
  }
View Full Code Here

  protected MetaRuleset createMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    TagAttribute [] attrs = tag.getAttributes().getAll();
    for (int i = 0; i < attrs.length; i++) {
      TagAttribute attr = attrs[i];
      if (!attr.getLocalName().equals("rendered")) {
        metaRuleset.ignore(attr.getLocalName());
      }
    }
    return metaRuleset;
  }
View Full Code Here

  protected MetaRuleset createSubComponentMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    TagAttribute [] attrs = tag.getAttributes().getAll();
    for (int i = 0; i < attrs.length; i++) {
      TagAttribute attr = attrs[i];
      if (!(attr.getLocalName().equals(Attributes.CONVERTER)
          || attr.getLocalName().equals(Attributes.VALUE))) {
        metaRuleset.ignore(attr.getLocalName());
      }
    }
    return metaRuleset;
  }
View Full Code Here

  protected MetaRuleset createMetaRuleset(Class aClass) {
    MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    if (UIPanel.class.isAssignableFrom(aClass)) {
      TagAttribute [] attrs = tag.getAttributes().getAll();
      for (int i = 0; i < attrs.length; i++) {
        TagAttribute attr = attrs[i];
        if (!attr.getLocalName().equals("rendered")) {
          metaRuleset.ignore(attr.getLocalName());
        }
      }
      return metaRuleset;
    } else {
      metaRuleset.ignore(TobagoConstants.ATTR_LABEL);
View Full Code Here

TOP

Related Classes of com.sun.facelets.tag.TagAttribute

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.