com.intellij.openapi.project.Project.isOpen()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中com.intellij.openapi.project.Project.isOpen()方法的一些代码示例,展示了Project.isOpen()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.isOpen()方法的具体详情如下:
包路径:com.intellij.openapi.project.Project
类名称:Project
方法名:isOpen

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);
    }
  }
});

相关文章