Package org.cfeclipse.cfml.parser.docitems

Examples of org.cfeclipse.cfml.parser.docitems.TagItem


            }
          }
        //}
      }
      else if(tname.equalsIgnoreCase("cffunction")){
        TagItem tagItem = (TagItem)element;
        String name = tagItem.getAttributeValue("name");
        String returnType = tagItem.getAttributeValue("returntype");
        sb.append(name+" (");
        Iterator kids = tagItem.getChildNodes().iterator();
        while(kids.hasNext()) {
          DocItem kid = (DocItem) kids.next();
          if(kid instanceof TagItem && kid.getName().equals("cfargument")) {           
            String argName = ((TagItem)kid).getAttributeValue("name");
            String argType = ((TagItem)kid).getAttributeValue("type");
View Full Code Here


       //TODO: for scopes such as FORM, URL and ATTRIBUTES, we need to do something different, since we will go and search for them tags that are CFPARAM
      
       boolean isScope = false;
       //if the variable exists
       if(variableParserItem != null){
         TagItem chosenTag = (TagItem)variableParserItem.getTagItem();
       //  System.out.println("Found Chosen Tag" + chosenTag);
         //Lets check we have a pre-defined scope for this type
         System.out.println(chosenTag.getClass().getName());
         if(chosenTag != null && (chosenTag instanceof TagItem || chosenTag instanceof CfmlTagItem)){
             TagItem leTag = (TagItem)chosenTag;
             String tagname  = leTag.getName();
              
               if(tagname.equalsIgnoreCase("cfquery")){
                 isScope = true;
                   // we now look for either result or name
                 //TODO: tokenise SELECT something, something FROM so we have those proposals too!
                 //foo.subString(foo.indexOf("."))
                 if(varName.equalsIgnoreCase(leTag.getAttributeValue("result"))){
                   scopeProposals =  ((ISyntaxDictionary)this.sourceDict).getFilteredScopeVars("CFQUERY");
              
                 }else{
                  
                   //Go and get the proposals for this item, which is one set for the items, and another for the columns
                   //TODO: Add icons to this. so maybe we do a generic scope thing that adds scopeProposals with icons
                                     
                   scopeProposals =  ((ISyntaxDictionary)this.sourceDict).getFilteredScopeVars("QUERY");
                   //Get the contents of the SQL and parse them
                   //get the end of leTag
                   int sqlStart = leTag.getEndPosition() + 1;
                   int sqlEnd = leTag.getMatchingItem().getStartPosition();
                   String docText = doc.get();
                   String sql = docText.substring(sqlStart, sqlEnd);
                   scopeProposals.addAll(parseSQL(sql));
                  
                 }
               } //end cfquery
               else if(tagname.equalsIgnoreCase("cfdirectory")){
                 isScope = true;
                 scopeProposals = ((ISyntaxDictionary)this.sourceDict).getFilteredScopeVars("CFDIRECTORY");
               }
               else if(tagname.equalsIgnoreCase("cfftp")){
                 isScope = true;
                   if(varName.equalsIgnoreCase(leTag.getAttributeValue("result"))){
                     scopeProposals = ((ISyntaxDictionary)this.sourceDict).getFilteredScopeVars("CFFTP");
                   }
                   else{
                     scopeProposals = ((ISyntaxDictionary)this.sourceDict).getFilteredScopeVars("CFFTPList");
                   }
View Full Code Here

        CFNodeList nodes;
        nodes = docroot.selectNodes("//cffunction");
        Iterator iter = nodes.iterator();
        while (iter.hasNext())
        {
            TagItem thisTag = (TagItem) iter.next();
            FunctionNode funcnode = new FunctionNode(thisTag);
            funcnode.setParent(this);
            this.addChild(funcnode);

        }
View Full Code Here

         
          CFNodeList nodes = docroot.selectNodes("//cffunction");
     
         Iterator funcIter =  nodes.iterator();
         while(funcIter.hasNext()){
              TagItem thisFunction = (TagItem)funcIter.next();

              System.out.println("function " + thisFunction.getAttributeValue("name"));
         }
         
     
    System.out.println("running the action" + compNodes.get(1));
   
View Full Code Here

   *
   * @param filter
   * @return
   */
  public DocItem getItems(String filter) {
    DocItem scratch = new TagItem(1, 1, 1, "root");

    DocItem rootItem = getRootInput();
    CFNodeList nodes = rootItem.selectNodes(filter);

    Iterator i = nodes.iterator();
    while (i.hasNext()) {
      try {
        scratch.addChild((DocItem) i.next());
      } catch (Exception e) {
        System.err.println("Tree item set error ");
        e.printStackTrace();
      }
    }
View Full Code Here

    // a fake root
    return createFakeRoot();
  }

  private TagItem createFakeRoot() {
    TagItem tg = new TagItem(1, 1, 1, "Unk");
    return tg;
  }
View Full Code Here

      if(firstItem.getClass().getName().endsWith("CfmlComment")){
        editor.selectAndReveal(firstItem.getStartPosition(), firstItem.getEndPosition() - firstItem.getStartPosition() + 1);
        return;
      }
      if (firstItem instanceof TagItem) {
        TagItem cti = (TagItem) firstItem;
        if (cti.matchingItem != null) {
          if (cti.matchingItem.getStartPosition() < cti.getStartPosition()) {
            startPos = cti.matchingItem.getStartPosition();
            endPos = cti.getEndPosition();
          } else {
            startPos = cti.getStartPosition();
            endPos = cti.matchingItem.getEndPosition();
          }
        } else {
          startPos = cti.getStartPosition();
          endPos = cti.getEndPosition();
        }
      } else {
        ScriptItem csi = (ScriptItem) firstItem;
        startPos = csi.getStartPosition();
        endPos = csi.getEndPosition();
View Full Code Here

*/
public class CFCMethodsComparator implements Comparator {

    public int compare(Object o1, Object o2) {
        if (o1 instanceof TagItem && o1 instanceof TagItem) {
            TagItem t1 = (TagItem)o1;
            TagItem t2 = (TagItem)o2;
            return t1.getAttributeValue("name").compareToIgnoreCase(t2.getAttributeValue("name"));
        }
        return 0;
    }
View Full Code Here

      method.append(" ( ");
      CFNodeList args = functionTag.selectNodes("//cfargument");
      Iterator j = args.iterator();
      while(j.hasNext()) {
        try {
          TagItem thisArg = (TagItem)j.next();
          method.append(thisArg.getAttributeValue("type") + " " + thisArg.getAttributeValue("name"));
          if (j.hasNext()) {
            method.append(", ");
          }
        }
        catch (Exception e) {
View Full Code Here

      method.append("(");
      CFNodeList args = functionTag.selectNodes("//argument");
      Iterator j = args.iterator();
      while(j.hasNext()) {
        try {
          TagItem thisArg = (TagItem)j.next();
          method.append(thisArg.getAttributeValue("type") + " " + thisArg.getAttributeValue("name"));
          if (j.hasNext()) {
            method.append(", ");
          }
        }
        catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.parser.docitems.TagItem

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.