Search in sources :

Example 1 with DelegatingProgressIndicator

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);
}
Also used : DelegatingProgressIndicator(com.intellij.ide.util.DelegatingProgressIndicator) DelegatingProgressIndicator(com.intellij.ide.util.DelegatingProgressIndicator) BombedProgressIndicator(com.intellij.testFramework.BombedProgressIndicator) DaemonProgressIndicator(com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator)

Example 2 with DelegatingProgressIndicator

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;
}
Also used : DelegatingProgressIndicator(com.intellij.ide.util.DelegatingProgressIndicator) ProjectJdkStep(com.intellij.ide.util.projectWizard.ProjectJdkStep) ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep) ArrayList(java.util.ArrayList)

Example 3 with DelegatingProgressIndicator

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;
}
Also used : DelegatingProgressIndicator(com.intellij.ide.util.DelegatingProgressIndicator) ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep) ArrayList(java.util.ArrayList) LibrariesDetectionStep(com.intellij.ide.util.importProject.LibrariesDetectionStep) ModulesDetectionStep(com.intellij.ide.util.importProject.ModulesDetectionStep)

Example 4 with DelegatingProgressIndicator

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();
    }
}
Also used : DelegatingProgressIndicator(com.intellij.ide.util.DelegatingProgressIndicator) DelegatingProgressIndicator(com.intellij.ide.util.DelegatingProgressIndicator) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) Semaphore(com.intellij.util.concurrency.Semaphore)

Aggregations

DelegatingProgressIndicator (com.intellij.ide.util.DelegatingProgressIndicator)4 ModuleWizardStep (com.intellij.ide.util.projectWizard.ModuleWizardStep)2 ArrayList (java.util.ArrayList)2 DaemonProgressIndicator (com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator)1 LibrariesDetectionStep (com.intellij.ide.util.importProject.LibrariesDetectionStep)1 ModulesDetectionStep (com.intellij.ide.util.importProject.ModulesDetectionStep)1 ProjectJdkStep (com.intellij.ide.util.projectWizard.ProjectJdkStep)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 BombedProgressIndicator (com.intellij.testFramework.BombedProgressIndicator)1 Semaphore (com.intellij.util.concurrency.Semaphore)1