當前位置: 首頁>>代碼示例>>Java>>正文


Java EditorMarkupModelImpl類代碼示例

本文整理匯總了Java中com.intellij.openapi.editor.impl.EditorMarkupModelImpl的典型用法代碼示例。如果您正苦於以下問題:Java EditorMarkupModelImpl類的具體用法?Java EditorMarkupModelImpl怎麽用?Java EditorMarkupModelImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EditorMarkupModelImpl類屬於com.intellij.openapi.editor.impl包,在下文中一共展示了EditorMarkupModelImpl類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: show

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
@Override
public LightweightHint show(@NotNull Editor editor, @NotNull Point p, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint) {
  myTrafficLightRenderer = (TrafficLightRenderer)((EditorMarkupModelImpl)editor.getMarkupModel()).getErrorStripeRenderer();
  myPanel = new TrafficProgressPanel(myTrafficLightRenderer, editor, hintHint);
  repaintTooltipWindow();
  LineTooltipRenderer.correctLocation(editor, myPanel, p, alignToRight, true, myPanel.getMinWidth());
  LightweightHint hint = new LightweightHint(myPanel);

  HintManagerImpl hintManager = (HintManagerImpl)HintManager.getInstance();
  hintManager.showEditorHint(hint, editor, p,
                             HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_OTHER_HINT |
                             HintManager.HIDE_BY_SCROLLING, 0, false, hintHint);
  hint.addHintListener(new HintListener() {
    @Override
    public void hintHidden(EventObject event) {
      if (myPanel == null) return; //double hide?
      myPanel = null;
      onHide.run();
    }
  });
  return hint;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:TrafficTooltipRendererImpl.java

示例2: repaintTrafficIcon

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
private void repaintTrafficIcon(@NotNull final PsiFile file, final Editor editor, double progress) {
  if (ApplicationManager.getApplication().isCommandLine()) return;

  if (repaintIconAlarm.isEmpty() || progress >= 1) {
    repaintIconAlarm.addRequest(new Runnable() {
      @Override
      public void run() {
        Project myProject = file.getProject();
        if (myProject.isDisposed()) return;
        Editor myeditor = editor;
        if (myeditor == null) {
          myeditor = PsiUtilBase.findEditor(file);
        }
        if (myeditor == null || myeditor.isDisposed()) return;
        EditorMarkupModelImpl markup = (EditorMarkupModelImpl)myeditor.getMarkupModel();
        markup.repaintTrafficLightIcon();
        DaemonListeners.repaintErrorStripeRenderer(myeditor, myProject);
      }
    }, 50, null);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:DefaultHighlightInfoProcessor.java

示例3: setOrRefreshErrorStripeRenderer

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
static void setOrRefreshErrorStripeRenderer(@NotNull EditorMarkupModel editorMarkupModel,
                                            @NotNull Project project,
                                            @NotNull Document document,
                                            PsiFile file) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (!editorMarkupModel.isErrorStripeVisible() || !DaemonCodeAnalyzer.getInstance(project).isHighlightingAvailable(file)) {
    return;
  }
  ErrorStripeRenderer renderer = editorMarkupModel.getErrorStripeRenderer();
  if (renderer instanceof TrafficLightRenderer) {
    TrafficLightRenderer tlr = (TrafficLightRenderer)renderer;
    tlr.refresh();
    ((EditorMarkupModelImpl)editorMarkupModel).repaintVerticalScrollBar();
    if (tlr.myFile == null || tlr.myFile.isValid()) return;
    Disposer.dispose(tlr);
  }
  EditorImpl editor = (EditorImpl)editorMarkupModel.getEditor();

  if (!editor.isDisposed()) {
    renderer = new TrafficLightRenderer(project, document, file);
    Disposer.register(editor.getDisposable(), (Disposable)renderer);
    editorMarkupModel.setErrorStripeRenderer(renderer);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:TrafficLightRenderer.java

示例4: show

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
@Override
public LightweightHint show(@NotNull Editor editor, @NotNull Point p, boolean alignToRight, @NotNull TooltipGroup group, @NotNull HintHint hintHint) {
  myTrafficLightRenderer = (TrafficLightRenderer)((EditorMarkupModelImpl)editor.getMarkupModel()).getErrorStripeRenderer();
  myPanel = new TrafficProgressPanel(myTrafficLightRenderer, editor, hintHint);
  LineTooltipRenderer.correctLocation(editor, myPanel, p, alignToRight, false, -1);
  LightweightHint hint = new LightweightHint(myPanel);

  HintManagerImpl hintManager = (HintManagerImpl)HintManager.getInstance();
  hintManager.showEditorHint(hint, editor, p,
                             HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_OTHER_HINT |
                             HintManager.HIDE_BY_SCROLLING, 0, false, hintHint);
  hint.addHintListener(new HintListener() {
    @Override
    public void hintHidden(EventObject event) {
      if (myPanel == null) return; //double hide?
      myPanel = null;
      onHide.run();
    }
  });
  repaintTooltipWindow();
  return hint;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:23,代碼來源:TrafficTooltipRendererImpl.java

示例5: setOrRefreshErrorStripeRenderer

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
public static void setOrRefreshErrorStripeRenderer(@NotNull EditorMarkupModel editorMarkupModel,
                                                   @NotNull Project project,
                                                   @NotNull Document document,
                                                   PsiFile file) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (!editorMarkupModel.isErrorStripeVisible() || !DaemonCodeAnalyzer.getInstance(project).isHighlightingAvailable(file)) {
    return;
  }
  ErrorStripeRenderer renderer = editorMarkupModel.getErrorStripeRenderer();
  if (renderer instanceof TrafficLightRenderer) {
    TrafficLightRenderer tlr = (TrafficLightRenderer)renderer;
    tlr.refresh();
    ((EditorMarkupModelImpl)editorMarkupModel).repaintVerticalScrollBar();
    if (tlr.myFile == null || tlr.myFile.isValid()) return;
    Disposer.dispose(tlr);
  }
  renderer = new TrafficLightRenderer(project, document, file);
  Disposer.register(((EditorImpl)editorMarkupModel.getEditor()).getDisposable(), (Disposable)renderer);
  editorMarkupModel.setErrorStripeRenderer(renderer);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:21,代碼來源:TrafficLightRenderer.java

示例6: repaintTrafficIcon

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
private void repaintTrafficIcon() {
  if (ApplicationManager.getApplication().isCommandLine()) return;

  if (repaintIconAlarm.isEmpty() || getProgressCount() >= getProgressLimit()) {
    repaintIconAlarm.addRequest(new Runnable() {
      @Override
      public void run() {
        if (myProject.isDisposed()) return;
        Editor editor = myFile == null ? null : PsiUtilBase.findEditor(myFile);
        if (editor == null || editor.isDisposed()) return;
        EditorMarkupModelImpl markup = (EditorMarkupModelImpl)editor.getMarkupModel();
        markup.repaintTrafficLightIcon();
      }
    }, 50, null);
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:17,代碼來源:ProgressableTextEditorHighlightingPass.java

示例7: show

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
@Override
public LightweightHint show(@Nonnull Editor editor, @Nonnull Point p, boolean alignToRight, @Nonnull TooltipGroup group, @Nonnull HintHint hintHint) {
  myTrafficLightRenderer = (TrafficLightRenderer)((EditorMarkupModelImpl)editor.getMarkupModel()).getErrorStripeRenderer();
  myPanel = new TrafficProgressPanel(myTrafficLightRenderer, editor, hintHint);
  repaintTooltipWindow();
  LineTooltipRenderer.correctLocation(editor, myPanel, p, alignToRight, true, myPanel.getMinWidth());
  LightweightHint hint = new LightweightHint(myPanel);

  HintManagerImpl hintManager = (HintManagerImpl)HintManager.getInstance();
  hintManager.showEditorHint(hint, editor, p,
                             HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_OTHER_HINT |
                             HintManager.HIDE_BY_SCROLLING, 0, false, hintHint);
  hint.addHintListener(new HintListener() {
    @Override
    public void hintHidden(EventObject event) {
      if (myPanel == null) return; //double hide?
      myPanel = null;
      onHide.run();
    }
  });
  return hint;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:23,代碼來源:TrafficTooltipRendererImpl.java

示例8: repaintTrafficIcon

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
private void repaintTrafficIcon(@Nonnull final PsiFile file, @Nullable Editor editor, double progress) {
  if (ApplicationManager.getApplication().isCommandLine()) return;

  if (repaintIconAlarm.isEmpty() || progress >= 1) {
    repaintIconAlarm.addRequest(() -> {
      Project myProject = file.getProject();
      if (myProject.isDisposed()) return;
      Editor myeditor = editor;
      if (myeditor == null) {
        myeditor = PsiUtilBase.findEditor(file);
      }
      if (myeditor == null || myeditor.isDisposed()) return;
      EditorMarkupModelImpl markup = (EditorMarkupModelImpl)myeditor.getMarkupModel();
      markup.repaintTrafficLightIcon();
      DaemonListeners.repaintErrorStripeRenderer(myeditor, myProject);
    }, 50, null);
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:19,代碼來源:DefaultHighlightInfoProcessor.java

示例9: setOrRefreshErrorStripeRenderer

import com.intellij.openapi.editor.impl.EditorMarkupModelImpl; //導入依賴的package包/類
@RequiredDispatchThread
static void setOrRefreshErrorStripeRenderer(@Nonnull EditorMarkupModel editorMarkupModel,
                                            @Nonnull Project project,
                                            @Nonnull Document document,
                                            PsiFile file) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (!editorMarkupModel.isErrorStripeVisible() || !DaemonCodeAnalyzer.getInstance(project).isHighlightingAvailable(file)) {
    return;
  }
  ErrorStripeRenderer renderer = editorMarkupModel.getErrorStripeRenderer();
  if (renderer instanceof TrafficLightRenderer) {
    TrafficLightRenderer tlr = (TrafficLightRenderer)renderer;
    tlr.refresh();
    ((EditorMarkupModelImpl)editorMarkupModel).repaintVerticalScrollBar();
    if (tlr.myFile == null || tlr.myFile.isValid()) return;
    Disposer.dispose(tlr);
  }
  EditorImpl editor = (EditorImpl)editorMarkupModel.getEditor();

  if (!editor.isDisposed()) {
    renderer = new TrafficLightRenderer(project, document, file);
    Disposer.register(editor.getDisposable(), (Disposable)renderer);
    editorMarkupModel.setErrorStripeRenderer(renderer);
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:26,代碼來源:TrafficLightRenderer.java


注:本文中的com.intellij.openapi.editor.impl.EditorMarkupModelImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。