use of com.intellij.openapi.progress.DumbProgressIndicator in project android by JetBrains.
the class ConvertToWebpAction method convert.
public void convert(@NotNull Project project, @NotNull WebpConversionSettings settings, boolean showBalloon, @NotNull Collection<VirtualFile> files) {
boolean isUnitTest = ApplicationManager.getApplication().isUnitTestMode();
WebpConversionTask task = new WebpConversionTask(project, settings, showBalloon && !isUnitTest, files);
if (isUnitTest) {
// Do it immediately
task.run(new DumbProgressIndicator());
settings.previewConversion = false;
task.onFinished();
} else {
ProgressManager.getInstance().run(task);
}
}
use of com.intellij.openapi.progress.DumbProgressIndicator in project intellij-community by JetBrains.
the class DetectAndAdjustIndentOptionsTask method scheduleInBackgroundForCommittedDocument.
public void scheduleInBackgroundForCommittedDocument() {
if (myProject.isDisposed())
return;
if (ApplicationManager.getApplication().isUnitTestMode()) {
PsiDocumentManager.getInstance(myProject).commitDocument(myDocument);
Continuation continuation = performInReadAction(new DumbProgressIndicator());
if (continuation != null) {
continuation.getAction().run();
}
} else {
PsiDocumentManager manager = PsiDocumentManager.getInstance(myProject);
manager.performForCommittedDocument(myDocument, () -> ProgressIndicatorUtils.scheduleWithWriteActionPriority(myExecutor, this));
}
}
use of com.intellij.openapi.progress.DumbProgressIndicator in project intellij-community by JetBrains.
the class JUnit4IntegrationTest method before.
@Before
public void before() throws Throwable {
EdtTestUtil.runInEdtAndWait(() -> {
setUp();
Module module = createEmptyModule();
String communityPath = PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/');
String methodName = myNameRule.getMethodName();
methodName = methodName.substring(0, methodName.indexOf("["));
String testDataPath = communityPath + File.separator + "plugins" + File.separator + "junit5_rt_tests" + File.separator + "testData" + File.separator + "integration" + File.separator + methodName;
MavenId mavenId = new MavenId("junit", "junit", myJUnitVersion);
MavenRepositoryInfo repositoryInfo = new MavenRepositoryInfo("maven", "maven", "http://maven.labs.intellij.net/repo1");
RepositoryAttachHandler.doResolveInner(getProject(), mavenId, Collections.emptyList(), Collections.singleton(repositoryInfo), artifacts -> {
for (MavenArtifact artifact : artifacts) {
ModuleRootModificationUtil.addModuleLibrary(module, VfsUtilCore.pathToUrl(artifact.getPath()));
}
return true;
}, new DumbProgressIndicator());
ModuleRootModificationUtil.setModuleSdk(module, JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk());
ModuleRootModificationUtil.updateModel(module, model -> {
ContentEntry contentEntry = model.addContentEntry(VfsUtilCore.pathToUrl(testDataPath));
contentEntry.addSourceFolder(VfsUtilCore.pathToUrl(testDataPath + File.separator + "test"), true);
CompilerModuleExtension moduleExtension = model.getModuleExtension(CompilerModuleExtension.class);
moduleExtension.inheritCompilerOutputPath(false);
moduleExtension.setCompilerOutputPathForTests(VfsUtilCore.pathToUrl(testDataPath + File.separator + "out"));
});
});
}
Aggregations