本文整理汇总了Java中com.intellij.openapi.editor.impl.EditorImpl.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java EditorImpl.isDisposed方法的具体用法?Java EditorImpl.isDisposed怎么用?Java EditorImpl.isDisposed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.editor.impl.EditorImpl
的用法示例。
在下文中一共展示了EditorImpl.isDisposed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOrRefreshErrorStripeRenderer
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的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);
}
}
示例2: setOrRefreshErrorStripeRenderer
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的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);
}
}