Java 类com.intellij.openapi.editor.markup.ErrorStripeRenderer 实例源码

项目:intellij-ce-playground    文件:TrafficLightRenderer.java   
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);
  }
}
项目:tools-idea    文件:TrafficLightRenderer.java   
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);
}
项目:consulo    文件:TrafficLightRenderer.java   
@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);
  }
}
项目:intellij-ce-playground    文件:EditorMarkupModelImpl.java   
@Override
public void setErrorStripeRenderer(@NotNull ErrorStripeRenderer renderer) {
  assertIsDispatchThread();
  if (myErrorStripeRenderer instanceof Disposable) {
    Disposer.dispose((Disposable)myErrorStripeRenderer);
  }
  myErrorStripeRenderer = renderer;
  //try to not cancel tooltips here, since it is being called after every writeAction, even to the console
  //HintManager.getInstance().getTooltipController().cancelTooltips();

  myEditor.getVerticalScrollBar()
    .updateUI(); // re-create increase/decrease buttons, in case of not-null renderer it will show traffic light icon
  repaintVerticalScrollBar();
}
项目:tools-idea    文件:EditorMarkupModelImpl.java   
@Override
public void setErrorStripeRenderer(ErrorStripeRenderer renderer) {
  assertIsDispatchThread();
  if (myErrorStripeRenderer instanceof Disposable) {
    Disposer.dispose((Disposable)myErrorStripeRenderer);
  }
  myErrorStripeRenderer = renderer;
  //try to not cancel tooltips here, since it is being called after every writeAction, even to the console
  //HintManager.getInstance().getTooltipController().cancelTooltips();

  myEditor.getVerticalScrollBar()
    .updateUI(); // re-create increase/decrease buttons, in case of not-null renderer it will show traffic light icon
  repaintVerticalScrollBar();
}
项目:consulo    文件:EditorMarkupModelImpl.java   
@RequiredDispatchThread
@Override
public void setErrorStripeRenderer(ErrorStripeRenderer renderer) {
  assertIsDispatchThread();
  if (myErrorStripeRenderer instanceof Disposable) {
    Disposer.dispose((Disposable)myErrorStripeRenderer);
  }
  myErrorStripeRenderer = renderer;
  //try to not cancel tooltips here, since it is being called after every writeAction, even to the console
  //HintManager.getInstance().getTooltipController().cancelTooltips();

  repaintVerticalScrollBar();
}
项目:intellij-ce-playground    文件:EditorMarkupModelImpl.java   
@Nullable
@Override
public ErrorStripeRenderer getErrorStripeRenderer() {
  return myErrorStripeRenderer;
}
项目:tools-idea    文件:EditorMarkupModelImpl.java   
@Override
public ErrorStripeRenderer getErrorStripeRenderer() {
  return myErrorStripeRenderer;
}
项目:consulo    文件:EditorMarkupModel.java   
@RequiredDispatchThread
void setErrorStripeRenderer(ErrorStripeRenderer renderer);
项目:consulo    文件:EditorMarkupModelImpl.java   
@Override
public ErrorStripeRenderer getErrorStripeRenderer() {
  return myErrorStripeRenderer;
}
项目:intellij-ce-playground    文件:EditorMarkupModel.java   
void setErrorStripeRenderer(@NotNull ErrorStripeRenderer renderer);
项目:intellij-ce-playground    文件:EditorMarkupModel.java   
ErrorStripeRenderer getErrorStripeRenderer();
项目:tools-idea    文件:EditorMarkupModel.java   
void setErrorStripeRenderer(ErrorStripeRenderer renderer);
项目:tools-idea    文件:EditorMarkupModel.java   
ErrorStripeRenderer getErrorStripeRenderer();
项目:consulo    文件:EditorMarkupModel.java   
ErrorStripeRenderer getErrorStripeRenderer();