Package com.sun.facelets.tag

Examples of com.sun.facelets.tag.TagAttribute


    private void setAttribute(FaceletContext ctx, UIComponent cmp, String name) {
        setAttribute(ctx, cmp, name, null);
    }

    private void setAttribute(FaceletContext ctx, UIComponent cmp, String name, Object defaultValue) {
        TagAttribute attribute = this.getAttribute(name);
        if (attribute != null) {
            Object o = attribute.getObject(ctx);
            if (o == null && defaultValue == null) {
                throw new IllegalArgumentException("Attribute '" + name + "' resolved to null and no default value specified");
            } else if (o == null) {
                cmp.getAttributes().put(name, defaultValue);
            } else {
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

        this.config = config;
        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

  public ColumnsHandler(final ComponentConfig config) {
    super(config);
   
    final ComponentConfig columnConfig;
   
    TagAttribute idAttribute = config.getTag().getAttributes().get("id");
    if (idAttribute != null && idAttribute.isLiteral()) {
      columnConfig = new ColumnHandlerComponentConfig(config);
    } else {
      columnConfig = config;
    }
   
View Full Code Here

      public ToolTipTagHandlerBase(ComponentConfig config) {
       super(config);
   }
          protected MetaRuleset createMetaRuleset(Class type) {
       TagAttributes attributes = this.tag.getAttributes();
       TagAttribute eventAttribute = attributes.get("event");
       TagAttribute showEventAttribute = attributes.get("showEvent");
       MetaRuleset ruleset = super.createMetaRuleset(type);

       if (eventAttribute != null) {
           if (showEventAttribute != null) {
               TagAttribute idAttribute = attributes.get("id");
               FacesContext facesContext = FacesContext.getCurrentInstance();
               facesContext.getExternalContext().log("showEvent attribute has been already set for component with id: " +
                       idAttribute != null ? idAttribute.getValue() : null +
                       "[" + eventAttribute.getValue() + "]. event attribute is deprecated and thus has been dropped!");
               ruleset.ignore("event");
           } else {
               ruleset.alias("event", "showEvent");
           }
View Full Code Here

    super(config);
  }
 
  protected MetaRuleset createMetaRuleset(Class type) {
    TagAttributes attributes = this.tag.getAttributes();
    TagAttribute attribute = attributes.get("value");
    if (attribute != null && attributes.get("opened") != null) {
      TagAttribute idAttribute = attributes.get("id");
      FacesContext facesContext = FacesContext.getCurrentInstance();
      facesContext.getExternalContext().log("opened attribute has been already set for component with id: " +
          idAttribute != null ? idAttribute.getValue() : null +
          "[" + attribute.getValue() + "]. value attribute is deprecated and thus has been dropped!");
    }
    return super.createMetaRuleset(type).alias("opened", "value");
  }
View Full Code Here

    super(config);
  }
 
  protected MetaRuleset createMetaRuleset(Class type) {
    TagAttributes attributes = this.tag.getAttributes();
    TagAttribute attribute = attributes.get("value");
    if (attribute != null && attributes.get("expanded") != null) {
      TagAttribute idAttribute = attributes.get("id");
      FacesContext facesContext = FacesContext.getCurrentInstance();
      facesContext.getExternalContext().log("expanded attribute has been already set for component with id: " +
          idAttribute != null ? idAttribute.getValue() : null +
          "[" + attribute.getValue() + "]. value attribute is deprecated and thus has been dropped!");
    }
       
    return super.createMetaRuleset(type).alias("expanded", "value");
  }
View Full Code Here

    /**
     * @param config
     */
    public InsertHandler(TagConfig config) {
        super(config);
        TagAttribute attr = this.getAttribute("name");
        if (attr != null) {
            if (!attr.isLiteral()) {
                throw new TagAttributeException(this.tag, attr, "Must be Literal");
            }
            this.name = attr.getValue();
        } else {
            this.name = null;
        }
    }
View Full Code Here

    /**
     * @param config
     */
    public DefineHandler(TagConfig config) {
        super(config);
        TagAttribute attr = this.getRequiredAttribute("name");
        if (!attr.isLiteral()) {
            throw new TagAttributeException(this.tag, attr, "Must be Literal");
        }
        this.name = attr.getValue();
    }
View Full Code Here

        protected TagAttributes createAttributes(Attributes attrs) {
            int len = attrs.getLength();
            TagAttribute[] ta = new TagAttribute[len];
            for (int i = 0; i < len; i++) {
                ta[i] = new TagAttribute(this.createLocation(),
                        attrs.getURI(i), attrs.getLocalName(i), attrs
                                .getQName(i), attrs.getValue(i));
            }
            return new TagAttributes(ta);
        }
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.