Package com.intellij.openapi.editor.highlighter

Examples of com.intellij.openapi.editor.highlighter.HighlighterIterator.atEnd()


    HighlighterIterator iterator = highlighter.createIterator(offset - 1);
    if (iterator.getTokenType() != CfmlTokenTypes.R_ANGLEBRACKET) return false;
    iterator.retreat();

    int retrieveCount = 1;
    while (!iterator.atEnd()) {
      final IElementType tokenType = iterator.getTokenType();
      if (tokenType == CfmlTokenTypes.LSLASH_ANGLEBRACKET) return false;
      if (tokenType == CfmlTokenTypes.OPENER) break;
      ++retrieveCount;
      iterator.retreat();
View Full Code Here


      ++retrieveCount;
      iterator.retreat();
    }
    for (int i = 0; i < retrieveCount; ++i) iterator.advance();
    iterator.advance();
    return !iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.LSLASH_ANGLEBRACKET;
  }
}
View Full Code Here

    if (DocumentUtils.getCharAt(document, offset - 2) == '/') {
      return false;
    }
    HighlighterIterator iterator = ((EditorEx)editor).getHighlighter().createIterator(offset - 2);

    while (!iterator.atEnd() && !iterator.getTokenType().equals(CfmlTokenTypes.CF_TAG_NAME)) {
      if (CfmlUtil.isControlToken(iterator.getTokenType())) {
        return false;
      }
      iterator.retreat();
    }
View Full Code Here

      if (CfmlUtil.isControlToken(iterator.getTokenType())) {
        return false;
      }
      iterator.retreat();
    }
    if (!iterator.atEnd()) {
      iterator.retreat();
      if (!iterator.atEnd() && iterator.getTokenType().equals(CfmlTokenTypes.LSLASH_ANGLEBRACKET)) {
        return false;
      }
      iterator.advance();
View Full Code Here

      }
      iterator.retreat();
    }
    if (!iterator.atEnd()) {
      iterator.retreat();
      if (!iterator.atEnd() && iterator.getTokenType().equals(CfmlTokenTypes.LSLASH_ANGLEBRACKET)) {
        return false;
      }
      iterator.advance();
    }
    if (iterator.atEnd()) {
View Full Code Here

      if (!iterator.atEnd() && iterator.getTokenType().equals(CfmlTokenTypes.LSLASH_ANGLEBRACKET)) {
        return false;
      }
      iterator.advance();
    }
    if (iterator.atEnd()) {
      return false;
    }
    String tagName = document.getCharsSequence().subSequence(iterator.getStart(), iterator.getEnd()).toString();
    if (CfmlUtil.isSingleCfmlTag(tagName, project) || CfmlUtil.isUserDefined(tagName)) {
      return false;
View Full Code Here

    if (tagElement.getLastChild() instanceof PsiErrorElement) {
      doInsertion = true;
    }
    else {
      iterator = ((EditorEx)editor).getHighlighter().createIterator(0);
      while (!iterator.atEnd() && iterator.getStart() < offset) {
        if (iterator.getTokenType() == CfmlTokenTypes.CF_TAG_NAME) {
          String currentTagName = document.getCharsSequence().subSequence(iterator.getStart(), iterator.getEnd()).toString();
          if (tagName.equals(currentTagName)) {
            PsiElement currentTagElement = file.findElementAt(iterator.getStart());
            currentTagElement = PsiTreeUtil.getParentOfType(currentTagElement, CfmlTag.class);
View Full Code Here

      return false;
    }

    iterator.advance();

    if (iterator.atEnd()) {
      // no more tokens, so certainly no close tag
      return false;
    }

    final PsiElement closerElement = file.findElementAt(iterator.getStart());
View Full Code Here

public class CfmlEditorUtil {
  public static int countSharpsBalance(Editor editor) {
    int sharpsCounter = 0;
    // count balance
    HighlighterIterator iterator = ((EditorEx)editor).getHighlighter().createIterator(0);
    while (!iterator.atEnd()) {
      if (iterator.getTokenType() == CfscriptTokenTypes.OPENSHARP ||
          iterator.getTokenType() == CfmlTokenTypes.START_EXPRESSION) {
        sharpsCounter++;
      }
      else if (iterator.getTokenType() == CfscriptTokenTypes.CLOSESHARP ||
View Full Code Here

      }
      result.addElement(TailTypeDecorator.withTail(LookupElementBuilder.create(s.getName()).
        withCaseSensitivity(false), new TailType() {
        public int processTail(Editor editor, int tailOffset) {
          HighlighterIterator iterator = ((EditorEx)editor).getHighlighter().createIterator(tailOffset);
          if (!iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.WHITE_SPACE) iterator.advance();
          if (!iterator.atEnd() && iterator.getTokenType() == CfmlTokenTypes.ASSIGN) {
            iterator.advance();
          }
          else {
            editor.getDocument().insertString(tailOffset, "=\"\"");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.