Package com.intellij.openapi.editor.highlighter

Examples of com.intellij.openapi.editor.highlighter.EditorHighlighter


            DBLanguage dbLanguage = dbLanguageFile.getDBLanguage();
            if (dbLanguage != null) {
                ConnectionHandler connectionHandler = dbLanguageFile.getActiveConnection();
                DBLanguageSyntaxHighlighter syntaxHighlighter = getSyntaxHighlighter(dbLanguage, connectionHandler);

                EditorHighlighter editorHighlighter = HighlighterFactory.createHighlighter(syntaxHighlighter, editor.getColorsScheme());
                ((EditorEx) editor).setHighlighter(editorHighlighter);
            }
        }

        new CommandWriteActionRunner(editor.getProject()) {
View Full Code Here


  private static boolean isBetweenCfmlTags(PsiFile file, Editor editor, int offset) {
    if (offset == 0) return false;
    CharSequence chars = editor.getDocument().getCharsSequence();
    if (chars.charAt(offset - 1) != '>') return false;

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

    int retrieveCount = 1;
    while (!iterator.atEnd()) {
View Full Code Here

  private static boolean isBetweenHbTags(Editor editor, PsiFile file, int offset) {
    if (offset == 0) return false;
    CharSequence chars = editor.getDocument().getCharsSequence();
    if (chars.charAt(offset - 1) != '}') return false;

    EditorHighlighter highlighter = ((EditorEx)editor).getHighlighter();
    HighlighterIterator iterator = highlighter.createIterator(offset - 1);

    final PsiElement openerElement = file.findElementAt(iterator.getStart());

    PsiElement openTag = HbPsiUtil.findParentOpenTagElement(openerElement);
View Full Code Here

  }

  private void doTest() throws Throwable {
    final int pairOffset = configureByTestFile(getTestName(false));
    int offset = myFixture.getEditor().getCaretModel().getOffset();
    EditorHighlighter editorHighlighter = ((EditorEx)myFixture.getEditor()).getHighlighter();
    HighlighterIterator iterator = editorHighlighter.createIterator(offset);
    boolean forward = offset < pairOffset;
    boolean matched = BraceMatchingUtil
      .matchBrace(myFixture.getEditor().getDocument().getCharsSequence(), myFixture.getFile().getFileType(), iterator, forward);

    assertTrue(matched);
View Full Code Here

            appendToHistoryDocument(history, myPrompt);
        }

        final int localStartOffset = textRange.getStartOffset();
        String text;
        EditorHighlighter highlighter;
        if (consoleEditor instanceof EditorWindow) {
            EditorWindow editorWindow = (EditorWindow) consoleEditor;
            EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
            PsiFile file = editorWindow.getInjectedFile();
            final VirtualFile virtualFile = file.getVirtualFile();
            assert virtualFile != null;
            highlighter = HighlighterFactory.createHighlighter(virtualFile, scheme, getProject());
            String fullText = InjectedLanguageUtil.getUnescapedText(file, null, null);
            highlighter.setText(fullText);
            text = textRange.substring(fullText);
        } else {
            text = consoleEditor.getDocument().getText(textRange);
            highlighter = consoleEditor.getHighlighter();
        }
        //offset can be changed after text trimming after insert due to buffer constraints
        appendToHistoryDocument(history, text);
        int offset = history.getTextLength() - text.length();

        final HighlighterIterator iterator = highlighter.createIterator(localStartOffset);
        final int localEndOffset = textRange.getEndOffset();
        while (!iterator.atEnd()) {
            final int itStart = iterator.getStart();
            if (itStart > localEndOffset) break;
            final int itEnd = iterator.getEnd();
View Full Code Here

TOP

Related Classes of com.intellij.openapi.editor.highlighter.EditorHighlighter

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.