本文整理了Java中com.intellij.openapi.project.Project.isOpen()
方法的一些代码示例,展示了Project.isOpen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.isOpen()
方法的具体详情如下:
包路径:com.intellij.openapi.project.Project
类名称:Project
方法名:isOpen
暂无
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public void run() {
if (project.isOpen() && !project.isDisposed()) {
contentUi.restoreLayout();
}
}
});
代码示例来源:origin: kornilova-l/FlameViewer
/**
* Removes all profiler gutter icons
*/
@Override
public void fileClosed(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
if (source.getProject().isOpen()) {
if (Objects.equals(file.getFileType().getDefaultExtension(), "java")) {
lineMarkersHolder.removeAllIcons(file);
}
}
}
});
代码示例来源:origin: JetBrains/Grammar-Kit
private static void reparseAllLivePreviews(@NotNull Project project) {
if (!project.isOpen()) return;
PsiDocumentManager.getInstance(project).commitAllDocuments();
Collection<VirtualFile> files = ContainerUtil.newLinkedHashSet();
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
PsiManager psiManager = PsiManager.getInstance(project);
for (VirtualFile file : fileEditorManager.getOpenFiles()) {
PsiFile psiFile = psiManager.findFile(file);
Language language = psiFile == null? null : psiFile.getLanguage();
if (!(language instanceof LivePreviewLanguage)) continue;
files.add(file);
}
FileContentUtil.reparseFiles(project, files, false);
}
代码示例来源:origin: Microsoft/azure-devops-intellij
public void run() {
if (project.isOpen() && (!project.isDisposed()) && (!project.isDefault())) {
final VcsDirtyScopeManager mgr = VcsDirtyScopeManager.getInstance(project);
mgr.fileDirty(virtualBaseDirectory);
}
}
});
内容来源于网络,如有侵权,请联系作者删除!