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

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

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

Project.getDisposed介绍

暂无

代码示例

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

@Override
public void invoke(@NotNull Project project,
          @NotNull PsiFile file,
          @NotNull PsiElement startElement,
          @NotNull PsiElement endElement) {
 if (!FileModificationService.getInstance().preparePsiElementsForWrite(startElement)) return;
 Runnable runnable = () -> {
  AsyncResult<DataContext> dataContextContainer = DataManager.getInstance().getDataContextFromFocus();
  dataContextContainer.doWhenDone(new Consumer<DataContext>() {
   @Override
   public void consume(DataContext dataContext) {
    RenameHandler renameHandler = RenameHandlerRegistry.getInstance().getRenameHandler(dataContext);
    if (renameHandler != null) {
     renameHandler.invoke(project, new PsiElement[]{startElement}, dataContext);
    }
    else {
     RefactoringActionHandler renameRefactoringHandler = RefactoringActionHandlerFactory.getInstance().createRenameHandler();
     renameRefactoringHandler.invoke(project, new PsiElement[]{startElement}, dataContext);
    }
   }
  });
 };
 if (ApplicationManager.getApplication().isUnitTestMode()) {
  runnable.run();
 }
 else {
  ApplicationManager.getApplication().invokeLater(runnable, project.getDisposed());
 }
}

代码示例来源:origin: JetBrains/Grammar-Kit

@Override
 public void processTerminated(@NotNull ProcessEvent event) {
  Runnable runnable = event.getExitCode() == 0 ? callback::setDone : callback::setRejected;
  ApplicationManager.getApplication().invokeLater(runnable, project.getDisposed());
  VfsUtil.markDirtyAndRefresh(true, false, true, virtualDir);
 }
});

相关文章