Package com.intellij.openapi.editor.event

Examples of com.intellij.openapi.editor.event.CaretListener


    final Editor grammarEditor = livePreviewLanguage == null ? null : getGrammarEditor(psiFile.getProject(), livePreviewLanguage);

    if (editor == null || grammarEditor == null) return;

    final Project project = psiFile.getProject();
    CaretListener caretListener = editor.getUserData(GRAMMAR_UPDATE_RUNNING);
    if (caretListener != null) {
      editor.putUserData(GRAMMAR_UPDATE_RUNNING, null);
      editor.getCaretModel().removeCaretListener(caretListener);
      HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
      highlightManager.hideHighlights(grammarEditor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY);
    }
    else {
      updateGrammarHighlighters(project, editor, livePreviewLanguage, grammarEditor);

      caretListener = new CaretAdapter() {
        @Override
        public void caretPositionChanged(final CaretEvent e) {
          final CaretListener caretListener = this;
          LivePreviewHelper.getUpdateQueue(project).queue(new Update(e.getEditor()) {
            @Override
            public void run() {
              if (grammarEditor.isDisposed()) {
                e.getEditor().getCaretModel().removeCaretListener(caretListener);
View Full Code Here


   *
   * @param editor the editor for which the structure view model is requested.
   */
  protected TextEditorBasedStructureViewModel(final Editor editor) {
    myEditor = editor;
    myCaretListener = new CaretListener() {
      public void caretPositionChanged(CaretEvent e) {
        if (Comparing.equal(e.getEditor(), myEditor)) {
          fireCaretPositionChanged();
        }
      }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.editor.event.CaretListener

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.