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

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

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

Project.isDisposed介绍

暂无

代码示例

代码示例来源:origin: hsz/idea-gitignore

/** Removes invalidated projects from the {@link #CACHE} map. */
public static void invalidateDisposedProjects() {
  for (Project project : CACHE.keySet()) {
    if (project.isDisposed()) {
      CACHE.remove(project);
    }
  }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
 public void run(@NotNull ProgressIndicator indicator) {
  if (doNotStart || myProject == null || myProject.isDisposed()) {
   return;
  }
  indicator.setIndeterminate(true);
  consumer.consume(execute());
 }
});

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
 public void after(@NotNull List<? extends VFileEvent> events) {
  if (!myProject.isDisposed()) {
   Set<VirtualFile> openFiles = ContainerUtil.newHashSet(fileEditorManager.getSelectedFiles());
   for (VFileEvent event : events) {
    VirtualFile file = event.getFile();
    if (file != null && openFiles.contains(file)) {
     notifications.updateNotifications(file);
    }
   }
  }
 }
});

代码示例来源:origin: KronicDeth/intellij-elixir

private void reparseFiles(@NotNull Project project) {
  ApplicationManager.getApplication().invokeLater(() -> {
    if (project.isDisposed()) {
      return;
    }
    FileContentUtil.reparseFiles(project, Collections.emptyList(), true);
  });
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
  public void run(@NotNull ProgressIndicator indicator) {
    if (doNotStart || myProject == null || myProject.isDisposed()) {
      return;
    }
    indicator.setIndeterminate(true);
    consumer.consume(execute());
  }
});

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
 protected boolean isSuitableForModule(@NotNull Module module) {
  if (module.isDisposed()) {
   return false;
  }
  Project project = module.getProject();
  return !project.isDisposed() && GoSdkService.getInstance(project).isGoModule(module);
 }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

public static void showModulesConfigurable(@NotNull Project project) {
 ApplicationManager.getApplication().assertIsDispatchThread();
 if (!project.isDisposed()) {
  ShowSettingsUtil.getInstance().editConfigurable(project, new GoConfigurableProvider.GoProjectSettingsConfigurable(project));
 }
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
  protected boolean isSuitableForModule(@NotNull Module module) {
    if (module.isDisposed()) {
      return false;
    }
    Project project = module.getProject();
    return !project.isDisposed() && BallerinaSdkService.getInstance(project).isBallerinaModule(module);
  }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

private static void startTemplate(@NotNull Editor editor, @NotNull Template template, @NotNull Project project) {
 Runnable runnable = () -> {
  if (project.isDisposed() || editor.isDisposed()) return;
  CommandProcessor.getInstance().executeCommand(project, () ->
   TemplateManager.getInstance(project).startTemplate(editor, template, null), "Introduce function", null);
 };
 if (ApplicationManager.getApplication().isUnitTestMode()) {
  runnable.run();
 }
 else {
  ApplicationManager.getApplication().invokeLater(runnable);
 }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

public static void showModulesConfigurable(@NotNull Project project) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (!project.isDisposed()) {
   Configurable configurable = new GoLibrariesConfigurableProvider(project).createConfigurable(true);
   ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
  }
 }
}

代码示例来源:origin: ballerina-platform/ballerina-lang

public static void showModulesConfigurable(@NotNull Project project) {
  ApplicationManager.getApplication().assertIsDispatchThread();
  if (!project.isDisposed()) {
    ShowSettingsUtil.getInstance().editConfigurable(project, new BallerinaConfigurableProvider
        .BallerinaProjectSettingsConfigurable(project));
  }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

private void cleanResolveCaches() {
 Project project = myModule.getProject();
 if (!project.isDisposed()) {
  ResolveCache.getInstance(project).clearCache(true);
  DaemonCodeAnalyzer.getInstance(project).restart();
 }
}

代码示例来源:origin: ballerina-platform/ballerina-lang

public static void showModulesConfigurable(@NotNull Project project) {
    ApplicationManager.getApplication().assertIsDispatchThread();
    if (!project.isDisposed()) {
      Configurable configurable = new BallerinaLibrariesConfigurableProvider(project).createConfigurable(true);
      ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
    }
  }
}

代码示例来源:origin: ballerina-platform/ballerina-lang

private void cleanResolveCaches() {
  Project project = myModule.getProject();
  if (!project.isDisposed()) {
    ResolveCache.getInstance(project).clearCache(true);
    DaemonCodeAnalyzer.getInstance(project).restart();
  }
}

代码示例来源:origin: JetBrains/ideavim

private void deinitLineNumbers(@NotNull Editor editor) {
 editor.getCaretModel().removeCaretListener(myLineNumbersCaretListener);
 EditorData.setEditorGroup(editor, false);
 editor.getGutter().closeAllAnnotations();
 final Project project = editor.getProject();
 if (project == null || project.isDisposed()) return;
 editor.getSettings().setLineNumbersShown(EditorData.isLineNumbersShown(editor));
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Override
  protected void tearDown() throws Exception {
    super.tearDown();

    if (myFixture != null) {
      Project project = getProject();

      if (project != null && !project.isDisposed()) {
        Disposer.dispose(project);
      }
    }
  }
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Override
  protected void tearDown() throws Exception {
    super.tearDown();

    if (myFixture != null) {
      Project project = getProject();

      if (project != null && !project.isDisposed()) {
        Disposer.dispose(project);
      }
    }
  }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
 public void execute(@NotNull Editor editor, char c, @NotNull DataContext dataContext) {
  if (myOriginalHandler != null) myOriginalHandler.execute(editor, c, dataContext);
  if (c != 'e') return;
  Project project = editor.getProject();
  if (project == null) return;
  int offset = editor.getCaretModel().getOffset();
  if (offset < 4) return;
  TextRange from = TextRange.from(offset - 4, 4);
  String text = editor.getDocument().getText(from);
  if ("case".equals(text)) {
   PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
   ApplicationManager.getApplication().runWriteAction(() -> {
    if (project.isDisposed()) return;
    PsiFile file = PsiUtilBase.getPsiFileInEditor(editor, project);
    if (file == null) return;
    CodeStyleManager.getInstance(project).adjustLineIndent(file, from);
   });
  }
 }
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Override
  protected void tearDown() throws Exception {
    super.tearDown();

    if (myFixture != null) {
      Project project = getProject();

      if (project != null && !project.isDisposed()) {
        Disposer.dispose(project);
      }
    }
  }
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Override
  protected void tearDown() throws Exception {
    super.tearDown();

    if (myFixture != null) {
      Project project = getProject();

      if (project != null && !project.isDisposed()) {
        Disposer.dispose(project);
      }
    }
  }
}

相关文章