Package tk.eclipse.plugin.htmleditor.assist

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


      tagInfo.setJavaProject(getJavaProject());
      return tagInfo;
    }
    List tagList = getTagList();
    for (int i = 0; i < tagList.size(); i++) {
      TagInfo info = (TagInfo) tagList.get(i);
      if (info.getTagName() != null) {
        if (name.equals(info.getTagName().toLowerCase())) {
          return info;
        }
      }
    }
    return null;
View Full Code Here


        } else if(elementName.equals("shortname") || elementName.equals("short-name")){
          if(prefix==null){
            prefix = getChildText(childElement);
          }
        } else if(elementName.equals("tag-file")){
          TagInfo tagInfo = parseTagFileElement(childElement);
          if(tagInfo!=null){
            result.add(tagInfo);
          }
        }
      }
View Full Code Here

          attributes.add(attrInfo);
        }
      }
    }
   
    TagInfo info = new TagInfo(name, hasBody);
    info.setDescription(description);
    for(int i=0;i<attributes.size();i++){
      info.addAttributeInfo(attributes.get(i));
    }

    return info;
  }
View Full Code Here

          description = wrap(getChildText(element));
        } else if(elementName.equals("path") && project!=null){
          String path = getChildText(element);
          InputStream in = getTagFile(path);
          if(in != null){
            TagInfo tagInfo = TagFileParser.parseTagFile(null, null, in);
            for(int i=0;i<tagInfo.getAttributeInfo().length;i++){
              attributes.add(tagInfo.getAttributeInfo()[i]);
            }
          } else {
            return null;
          }
        }
      }
    }
   
    TagInfo info = new TagInfo(name, hasBody);
    info.setDescription(description);
    for(int i=0;i<attributes.size();i++){
      info.addAttributeInfo(attributes.get(i));
    }

    return info;
  }
View Full Code Here

  private JSPScriptletAssistProcessor _scriptletProcessor = new JSPScriptletAssistProcessor();
  private IFile _file = null;

  public JSPAssistProcessor() {
    // JSP actions
    TagInfo useBean = new TagInfo("jsp:useBean", true);
    useBean.addAttributeInfo(new AttributeInfo("id", true));
    useBean.addAttributeInfo(new AttributeInfo("scope", true, SCOPE));
    useBean.addAttributeInfo(new AttributeInfo("class", true, CLASS));
    _tagList.add(useBean);

    TagInfo setProperty = new TagInfo("jsp:setProperty", false);
    setProperty.addAttributeInfo(new AttributeInfo("name", true));
    setProperty.addAttributeInfo(new AttributeInfo("param", true));
    setProperty.addAttributeInfo(new AttributeInfo("property", true));
    _tagList.add(setProperty);

    TagInfo include = new TagInfo("jsp:include", false);
    include.addAttributeInfo(new AttributeInfo("page", true));
    _tagList.add(include);

    TagInfo forward = new TagInfo("jsp:forward", true);
    forward.addAttributeInfo(new AttributeInfo("page", true));
    _tagList.add(forward);

    TagInfo param = new TagInfo("jsp:param", false);
    param.addAttributeInfo(new AttributeInfo("name", true));
    param.addAttributeInfo(new AttributeInfo("value", true));
    _tagList.add(param);

    TagInfo attribute = new TagInfo("jsp:attribute", true);
    attribute.addAttributeInfo(new AttributeInfo("name", true));
    _tagList.add(attribute);

    TagInfo body = new TagInfo("jsp:body", true);
    _tagList.add(body);

    TagInfo element = new TagInfo("jsp:element", true);
    element.addAttributeInfo(new AttributeInfo("name", true));
    _tagList.add(element);

    TagInfo text = new TagInfo("jsp:text", true);
    _tagList.add(text);

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

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

  private static final Pattern NAME      = Pattern.compile("name\\s*=\\s*\"(.+?)\"");
  private static final Pattern REQUIRED  = Pattern.compile("required\\s*=\\s*\"(.+?)\"");
 
  public static TagInfo parseTagFile(String prefix, String tagName, InputStream in) throws Exception {
   
    TagInfo tag = new TagInfo(prefix + ":" + tagName, true);
   
    byte[] buf = HTMLUtil.readStream(in);
    Matcher matcher = ATTRIBUTE.matcher(new String(buf));
    while (matcher.find()) {
      String content = matcher.group(1);
      String name = getAttribute(content, NAME);
      boolean required = getBooleanValue(getAttribute(content, REQUIRED));
     
      tag.addAttributeInfo(new AttributeInfo(name, true, AttributeInfo.NONE, required));
    }
   
    return tag;
  }
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.