Package tk.eclipse.plugin.htmleditor.assist

Examples of tk.eclipse.plugin.htmleditor.assist.TagInfo


          TLDInfo tld = getTLDInfo(prefix);
          if(tld==null){
            // tld does not exist.
            addElementMarker(element,"Validation.NoTLD",prefix);
          } else if(tld.getUri()!=null || tld.getTagdir()!=null){
            TagInfo tagInfo = getTagInfo(tld,element.getName());
            if(tagInfo==null){
              // taglib does not exist.
              addElementMarker(element,"Validation.NoCustomTag",element.getName());
            } else {
              AttributeInfo[] attrs = tagInfo.getAttributeInfo();
              for(int i=0;i<attrs.length;i++){
                if(attrs[i].isRequired() && !element.hasAttribute(attrs[i].getAttributeName())){
                  // check jsp:attribute
                  boolean findAttribute = false;
                  FuzzyXMLNode[] nodes = element.getChildren();
View Full Code Here


 
  private TagInfo getTagInfo(TLDInfo tld,String tagName){
    List list = tld.getTagInfo();
//    boolean tagFound = false;
    for(int j=0;j<list.size();j++){
      TagInfo tagInfo = (TagInfo)list.get(j);
      if(tagInfo.getTagName().equals(tagName)){
        return tagInfo;
      }
    }
    return null;
  }
View Full Code Here

          DTDItem item = element.getContent();
          boolean hasBody = true;
          if (item instanceof DTDEmpty) {
            hasBody = false;
          }
          TagInfo tagInfo = new TagInfo(name, hasBody);
          Iterator ite = element.attributes.keySet().iterator();

          // set child tags
          if (item instanceof DTDSequence) {
            DTDSequence seq = (DTDSequence) item;
            setChildTagName(tagInfo, seq.getItem());
          }
          else if (item instanceof DTDMixed) {
            // #PCDATA
          }

          while (ite.hasNext()) {
            String attrName = (String) ite.next();
            DTDAttribute attr = element.getAttribute(attrName);

            DTDDecl decl = attr.getDecl();
            boolean required = false;
            if (decl == DTDDecl.REQUIRED) {
              required = true;
            }

            AttributeInfo attrInfo = new AttributeInfo(attrName, true, AttributeInfo.NONE, required);
            tagInfo.addAttributeInfo(attrInfo);

            Object attrType = attr.getType();
            if (attrType instanceof DTDEnumeration) {
              DTDEnumeration dtdEnum = (DTDEnumeration) attrType;
              String[] items = dtdEnum.getItems();
View Full Code Here

    }
  }

  private void parseXSDElement(List<TagInfo> tagList, XSElementDeclaration element) {
    TagInfo tagInfo = new TagInfo(element.getName(), true);
    if (tagList.contains(tagInfo)) {
      return;
    }
    tagList.add(tagInfo);

    XSTypeDefinition type = element.getTypeDefinition();
    if (type instanceof XSComplexTypeDefinition) {
      XSParticle particle = ((XSComplexTypeDefinition) type).getParticle();
      if (particle != null) {
        XSTerm term = particle.getTerm();
        if (term instanceof XSElementDeclaration) {
          parseXSDElement(tagList, (XSElementDeclaration) term);
          tagInfo.addChildTagName(((XSElementDeclaration) term).getName());
        }
        if (term instanceof XSModelGroup) {
          parseXSModelGroup(tagInfo, tagList, (XSModelGroup) term);
        }
      }
      XSObjectList attrs = ((XSComplexTypeDefinition) type).getAttributeUses();
      for (int i = 0; i < attrs.getLength(); i++) {
        XSAttributeUse attrUse = (XSAttributeUse) attrs.item(i);
        XSAttributeDeclaration attr = attrUse.getAttrDeclaration();
        AttributeInfo attrInfo = new AttributeInfo(attr.getName(), true, AttributeInfo.NONE, attrUse.getRequired());
        tagInfo.addAttributeInfo(attrInfo);
      }

    }
  }
View Full Code Here

        list.addAll(this._nsTagListMap.get(uri));
      }
      else {
        List<TagInfo> nsTagList = this._nsTagListMap.get(uri);
        for (int i = 0; i < nsTagList.size(); i++) {
          TagInfo tagInfo = nsTagList.get(i);
          list.add(createPrefixTagInfo(tagInfo, prefix));
        }
      }
    }
    return list;
View Full Code Here

   * @param tagInfo the <code>TagInfo</code> instance
   * @param prefix the prefix to add
   * @return the new <code>TagInfo</code> instance that is added the prefix
   */
  private TagInfo createPrefixTagInfo(TagInfo tagInfo, String prefix) {
    TagInfo newTagInfo = new TagInfo(prefix + ":" + tagInfo.getTagName(), tagInfo.hasBody());
    AttributeInfo[] attrInfos = tagInfo.getAttributeInfo();
    for (int i = 0; i < attrInfos.length; i++) {
      AttributeInfo newAttrInfo = new AttributeInfo(prefix + ":" + attrInfos[i].getAttributeName(), true, AttributeInfo.NONE, attrInfos[i].isRequired());
      newTagInfo.addAttributeInfo(newAttrInfo);
    }
    String[] children = tagInfo.getChildTagNames();
    for (int i = 0; i < children.length; i++) {
      newTagInfo.addChildTagName(prefix + ":" + children[i]);
    }
    return newTagInfo;
  }
View Full Code Here

   */
  @Override
  protected TagInfo getTagInfo(String name) {
    List tagList = getTagList();
    for (int i = 0; i < tagList.size(); i++) {
      TagInfo info = (TagInfo) tagList.get(i);
      if (info.getTagName().equals(name)) {
        return info;
      }
    }
    return new XMLTagInfo(name);
  }
View Full Code Here

          TLDInfo tld = getTLDInfo(prefix);
          if(tld==null){
            // tld does not exist.
            addElementMarker(element,"Validation.NoTLD",prefix);
          } else if(tld.getUri()!=null || tld.getTagdir()!=null){
            TagInfo tagInfo = getTagInfo(tld,element.getName());
            if(tagInfo==null){
              // taglib does not exist.
              addElementMarker(element,"Validation.NoCustomTag",element.getName());
            } else {
              AttributeInfo[] attrs = tagInfo.getAttributeInfo();
              for(int i=0;i<attrs.length;i++){
                if(attrs[i].isRequired() && !element.hasAttribute(attrs[i].getAttributeName())){
                  // check jsp:attribute
                  boolean findAttribute = false;
                  FuzzyXMLNode[] nodes = element.getChildren();
View Full Code Here

 
  private TagInfo getTagInfo(TLDInfo tld,String tagName){
    List list = tld.getTagInfo();
//    boolean tagFound = false;
    for(int j=0;j<list.size();j++){
      TagInfo tagInfo = (TagInfo)list.get(j);
      if(tagInfo.getTagName().equals(tagName)){
        return tagInfo;
      }
    }
    return null;
  }
View Full Code Here

    _buildProperties = buildProperties;
    _editorPart = editorPart;
    _cache = wodParserCache;
    _tagList = new ArrayList<TagInfo>(TagDefinition.getTagInfoAsList());

    TagInfo webobject = new TagInfo("webobject", true);
    webobject.addAttributeInfo(new AttributeInfo("name", true, AttributeInfo.NONE, true));
    _tagList.add(webobject);

    TagInfo wo = new TagInfo("wo", true);
    wo.addAttributeInfo(new AttributeInfo("name", true, AttributeInfo.NONE, true));
    _tagList.add(wo);

    //    // JSP directives
    //    _tagList.add(new TextInfo("<%  %>", 3));
    //    _tagList.add(new TextInfo("<%=  %>", 4));
View Full Code Here

TOP

Related Classes of tk.eclipse.plugin.htmleditor.assist.TagInfo

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.