本文整理了Java中com.intellij.openapi.project.Project.getDisposed()
方法的一些代码示例,展示了Project.getDisposed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getDisposed()
方法的具体详情如下:
包路径:com.intellij.openapi.project.Project
类名称: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);
}
});
内容来源于网络,如有侵权,请联系作者删除!