use of com.intellij.ide.util.DelegatingProgressIndicator in project intellij-community by JetBrains.
the class ProgressIndicatorTest method testWrappedIndicatorsAreSortedRight.
public void testWrappedIndicatorsAreSortedRight() {
EmptyProgressIndicator indicator1 = new EmptyProgressIndicator();
DelegatingProgressIndicator indicator2 = new DelegatingProgressIndicator(indicator1);
final DelegatingProgressIndicator indicator3 = new DelegatingProgressIndicator(indicator2);
ProgressManager.getInstance().executeProcessUnderProgress(() -> {
ProgressIndicator current = ProgressIndicatorProvider.getGlobalProgressIndicator();
assertSame(indicator3, current);
}, indicator3);
assertFalse(checkCanceledCalled);
}
use of com.intellij.ide.util.DelegatingProgressIndicator in project intellij-community by JetBrains.
the class JavaProjectStructureDetector method createWizardSteps.
@Override
public List<ModuleWizardStep> createWizardSteps(ProjectFromSourcesBuilder builder, ProjectDescriptor projectDescriptor, Icon stepIcon) {
final List<ModuleWizardStep> steps = new ArrayList<>();
final ModuleInsight moduleInsight = new JavaModuleInsight(new DelegatingProgressIndicator(), builder.getExistingModuleNames(), builder.getExistingProjectLibraryNames());
steps.add(new LibrariesDetectionStep(builder, projectDescriptor, moduleInsight, stepIcon, "reference.dialogs.new.project.fromCode.page1"));
steps.add(new ModulesDetectionStep(this, builder, projectDescriptor, moduleInsight, stepIcon, "reference.dialogs.new.project.fromCode.page2"));
if (builder.getContext().isCreatingNewProject()) {
final ModuleWizardStep jdkStep = ProjectWizardStepFactory.getInstance().createProjectJdkStep(builder.getContext());
steps.add(jdkStep);
if (jdkStep instanceof ProjectJdkStep) {
((ProjectJdkStep) jdkStep).setProjectDescriptor(projectDescriptor);
}
}
return steps;
}
use of com.intellij.ide.util.DelegatingProgressIndicator in project intellij-plugins by JetBrains.
the class FlexProjectStructureDetector method createWizardSteps.
public List<ModuleWizardStep> createWizardSteps(final ProjectFromSourcesBuilder builder, final ProjectDescriptor projectDescriptor, final Icon stepIcon) {
FlexModuleInsight moduleInsight = new FlexModuleInsight(new DelegatingProgressIndicator(), builder.getExistingModuleNames(), builder.getExistingProjectLibraryNames());
final List<ModuleWizardStep> steps = new ArrayList<>();
steps.add(new LibrariesDetectionStep(builder, projectDescriptor, moduleInsight, stepIcon, "reference.dialogs.new.project.fromCode.page1"));
steps.add(new ModulesDetectionStep(this, builder, projectDescriptor, moduleInsight, stepIcon, "reference.dialogs.new.project.fromCode.page2"));
steps.add(new FlexSdkStep(builder.getContext()));
return steps;
}
use of com.intellij.ide.util.DelegatingProgressIndicator in project intellij-community by JetBrains.
the class CommitHelper method delegateCommitToVcsThread.
private void delegateCommitToVcsThread(final GeneralCommitProcessor processor) {
final ProgressIndicator indicator = new DelegatingProgressIndicator();
final Semaphore endSemaphore = new Semaphore();
endSemaphore.down();
ChangeListManagerImpl.getInstanceImpl(myProject).executeOnUpdaterThread(new Runnable() {
@Override
public void run() {
indicator.setText("Performing VCS commit...");
try {
ProgressManager.getInstance().runProcess(new Runnable() {
@Override
public void run() {
indicator.checkCanceled();
generalCommit(processor);
}
}, indicator);
} finally {
endSemaphore.up();
}
}
});
indicator.setText("Waiting for VCS background tasks to finish...");
while (!endSemaphore.waitFor(20)) {
indicator.checkCanceled();
}
}
Aggregations