Package cfml.parsing

Examples of cfml.parsing.ParserTag


      CFMLPropertyManager propertyManager = new CFMLPropertyManager();
      String dict = propertyManager.getCurrentDictionary(((IFileEditorInput) editor.getEditorInput()).getFile().getProject());
      CFMLParser fCfmlParser = CFMLPlugin.newCFMLParser(dict);
      ICFDocument cfd = (ICFDocument) this.fViewer.getDocument();
      CFMLSource cfmlSource = fCfmlParser.addCFMLSource(cfd.getCFDocument().getFilename(),cfd.get());
      ParserTag tag = cfmlSource.getEnclosingTag(startpos);
      int start = 0;
      int length = 0;
      if (tag != null) {

        if ((e.stateMask & SWT.SHIFT) != 0) {
          start = tag.getBegin();
          length = tag.getEnd() - tag.getBegin();
        } else {
          if (tag.getEndTagBegin() <= startpos
              && tag.getEndTagEnd() >= startpos) {
            start = tag.getEndTagBegin();
            length = tag.getEndTagEnd() - tag.getEndTagBegin();
          } else {
            start = tag.getStartTagBegin();
            length = tag.getStartTagEnd() - tag.getStartTagBegin();
          }
        }

        TextSelection newSel = new TextSelection(cfd, start, length);
        this.fViewer.setSelection(newSel);
View Full Code Here


    this.ExpandTagSelectionDown(doc, sel);

  }

  private ParserTag getNextTagDown(int offset, CFMLSource cfmlSource) {
    ParserTag currentTag = cfmlSource.getEnclosingTag(offset);
    int maxLen = cfmlSource.getOutputDocument().getSourceText().length();
    if (currentTag == null) {
      while (offset < maxLen && currentTag == null) {
        currentTag = cfmlSource.getEnclosingTag(offset);
        offset++;
      }
    } else if (offset == currentTag.getEndTagEnd()) {
      offset = currentTag.getEndTagEnd() + 1;
      currentTag = null;
      while (offset < maxLen && currentTag == null) {
        currentTag = cfmlSource.getEnclosingTag(offset);
        offset++;
      }
View Full Code Here

    String dict = propertyManager.getCurrentDictionary(((IFileEditorInput) editor.getEditorInput()).getFile().getProject());
    CFMLParser fCfmlParser = CFMLPlugin.newCFMLParser(dict);
    ICFDocument cfd = (ICFDocument) doc;
    CFMLSource cfmlSource = fCfmlParser.addCFMLSource(cfd.getCFDocument().getFilename(), cfd.get());
    int offset = sel.getOffset();
    ParserTag currentTag = getNextTagDown(offset+sel.getLength(), cfmlSource);
    if (currentTag == null)
      // at end of doc
      return;
    int end = currentTag.getEndTagEnd();
    // int end = currentTag.getEndTagEnd();
    int start = currentTag.getStartTagBegin() < offset ? currentTag.getStartTagBegin() : offset;
    int length = end - start;
    editor.selectAndReveal(start, length);
  }
View Full Code Here

    this.expandTagSelection(doc, sel);

  }

  private ParserTag getNextTagLeft(int offset, CFMLSource cfmlSource) {
    ParserTag currentTag = cfmlSource.getEnclosingTag(offset);
    if (currentTag == null) {
      while (offset > 0 && currentTag == null) {
        currentTag = cfmlSource.getEnclosingTag(offset);
        offset--;
      }
    } else if (offset == currentTag.getStartTagBegin()) {
      offset = currentTag.getStartTagBegin() - 1;
      currentTag = null;
      while (offset > 0 && currentTag == null) {
        currentTag = cfmlSource.getEnclosingTag(offset);
        offset--;
      }
View Full Code Here

    String dict = propertyManager.getCurrentDictionary(((IFileEditorInput) editor.getEditorInput()).getFile().getProject());
    CFMLParser fCfmlParser = CFMLPlugin.newCFMLParser(dict);
    ICFDocument cfd = (ICFDocument) doc;
    CFMLSource cfmlSource = fCfmlParser.addCFMLSource(cfd.getCFDocument().getFilename(), cfd.get());
    int offset = sel.getOffset();
    ParserTag currentTag = getNextTagLeft(offset, cfmlSource);
    if (currentTag == null){
      // at end of doc
      return;     
    }
    int start = currentTag.getStartTagBegin();
    //int end = currentTag.getEndTagEnd();
    int end = currentTag.getEndTagEnd() > sel.getOffset() + sel.getLength() ? currentTag.getEndTagEnd() : sel
        .getOffset()
        + sel.getLength();
    int length = end - start;
    editor.selectAndReveal(start, length);
  }
View Full Code Here

TOP

Related Classes of cfml.parsing.ParserTag

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.