Package org.cfeclipse.cfml.parser.docitems

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


      );
      int lineFound = 0;

      Iterator i = matchingNodes.iterator();
      while (i.hasNext()) {
        DocItem node = (DocItem) i.next();
        if (node instanceof CfmlTagItem) {
          CfmlTagItem currItem = (CfmlTagItem) node;
          if (lineFound == 0 ||
              (currItem.getEndPosition() < state.getOffset() && currItem.getLineNumber() > lineFound)) {
            lineFound = currItem.getLineNumber();
View Full Code Here


       * Added the lines below to check the partition type and thus get the cfincluded file
       */
   
      
       
      DocItem cti = null;
        try {
            cti = cfd.getTagAt(startpos, startpos);
        }
      catch (Exception e) {
          // do nothing.
View Full Code Here

 
  /**
   * Returns the indentation level at the position of code completion.
   */
  private static String getLeadingText(IDocument document, CFDocument model, int completionOffset) {
    DocItem project= model.getDocumentRoot();
    if (project == null) {
      return ""; //$NON-NLS-1$
    }
    /*
     *
 
View Full Code Here

   */
  public Object getParent(Object element)
  {
    if(element instanceof DocItem && ((DocItem)element).getParent() != rootdir)
    {
        DocItem item = (DocItem)element;
        if(element == null)
        {
            return null;
        }
        else if(item.getParent() == null)
        {
            return null;
        }
        //Assert.isNotNull(item.getParent().getName());
        if(item.getParent().getName() == null)
            throw new IllegalArgumentException("item parent getname is null");
       
      return item.getParent();
    }
   
    return null;
  }
View Full Code Here

        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");
            if(argType != null) {
              sb.append(argType.replaceAll("^string$", "String").replaceAll("^any$", "Any").replaceAll("^struct$", "Struct"));
            } else {
View Full Code Here

        CFNodeList children = function.getChildNodes();
        StringBuffer nameBuffer = new StringBuffer();
       
        if(children.size() > 0)
        {
            DocItem firstChild = (DocItem)children.get(0);
            if(firstChild instanceof ASTParameterList)
            {
                CFNodeList params = ((ASTParameterList)firstChild).getChildNodes();
                Iterator paramIter = params.iterator();
                while(paramIter.hasNext())
View Full Code Here

      e.printStackTrace();
    }
  }

  private void foldTags(HashMap markerMap, String tagName, boolean autoCollapse, int minLines) {
    DocItem rootItem = null;
    try {
      rootItem = doc.getCFDocument().getDocumentRoot();
    } catch (NullPointerException e) {
      // e.printStackTrace();
      System.out.println("CodeFoldingSetter::foldTags got a null from doc.getCFDocument().");
      return;
    }
    // nodes =
    // rootItem.selectNodes("//function[#startpos>=0 and #endpos < 200]");
    CFNodeList nodes = rootItem.selectNodes("//" + tagName.toLowerCase());

    Iterator it = nodes.iterator();
    while (it.hasNext()) {
      Object o = it.next();
      if (o instanceof CfmlTagItem && ((CfmlTagItem) o).matchingItem != null) {
View Full Code Here

     
      //there should only be 0 or 1 nodes in any one position (unless it spans
      //more then one tag I suppose
      if(matchingNodes.size() > 0)
      {
        DocItem node = (DocItem)matchingNodes.get(0);
        if (node instanceof CfmlTagItem) {         
          return (CfmlTagItem)node;
        } else {
          // probably a comment, but we could use this for udder stuff too?
          return node;
View Full Code Here

   * @return
   */
  public String getTagNameAt(int startpos, int endpos)
  {
    //String str = null;
    DocItem cti = getTagAt(startpos, endpos);
   
    if(cti != null)
    {
      return cti.getName();
    }
   
    return null;
  }
View Full Code Here

        }
        CFParser parser = new CFParser();
        CFDocument doc = parser.parseDoc(inputString);

        // Now we just want to add the nodes!
        DocItem docroot = doc.getDocumentRoot();
        CFNodeList nodes;
        nodes = docroot.selectNodes("//cffunction");
        Iterator iter = nodes.iterator();
        while (iter.hasNext())
        {
            TagItem thisTag = (TagItem) iter.next();
            FunctionNode funcnode = new FunctionNode(thisTag);
View Full Code Here

TOP

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

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.