Package com.sun.facelets.tag

Examples of com.sun.facelets.tag.TagAttribute


  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


    super(config);
  }
 
  protected MetaRuleset createMetaRuleset(Class type) {
    TagAttributes attributes = this.tag.getAttributes();
    TagAttribute attribute = attributes.get("value");
    if (attribute != null && attributes.get("selectedTab") != null) {
      TagAttribute idAttribute = attributes.get("id");
      FacesContext facesContext = FacesContext.getCurrentInstance();
      facesContext.getExternalContext().log("selectedTab 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("selectedTab", "value");
  }
View Full Code Here

                Location location = new Location("cdr", 1, 2);
                String ns = "urn:unk";

                tag = new Tag(location, ns, "tag", null,
                        new TagAttributes(new TagAttribute[] {
                                new TagAttribute(location, "", "beanName", null, beanName),
                                new TagAttribute(location, "", "ajaxOnly", null, String.valueOf(ajaxOnly)) }));
            }

            public FaceletHandler getNextHandler() {
                return null;
            }
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

  }
    }
   
    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

    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

        return UILibrary.Namespace.equals(ns)
                && (CompositionHandler.Name.equals(name) || ComponentRefHandler.Name.equals(name));
    }

    private String[] determineQName(Tag tag) {
        TagAttribute attr = tag.getAttributes().get("jsfc");
        if (attr != null) {
            if (log.isLoggable(Level.FINE)) {
                log.fine(attr + " JSF Facelet Compile Directive Found");
            }
            String value = attr.getValue();
            String namespace, localName;
            int c = value.indexOf(':');
            if (c == -1) {
                namespace = this.namespaceManager.getNamespace("");
                localName = value;
View Full Code Here

            return new String[] { tag.getNamespace(), tag.getLocalName() };
        }
    }

    private Tag trimJSFCAttribute(Tag tag) {
        TagAttribute attr = tag.getAttributes().get("jsfc");
        if (attr != null) {
            TagAttribute[] oa = tag.getAttributes().getAll();
            TagAttribute[] na = new TagAttribute[oa.length - 1];
            int p = 0;
            for (int i = 0; i < oa.length; i++) {
View Full Code Here

      metaRuleset.ignore(TobagoConstants.ATTR_LABEL);
      return metaRuleset;
    } else {
      TagAttribute[] attrs = tag.getAttributes().getAll();
      for (int i = 0; i < attrs.length; i++) {
        TagAttribute attr = attrs[i];
        metaRuleset.ignore(attr.getLocalName());
      }
      return metaRuleset;
    }
  }
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

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.