use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.
the class AbstractProjectWizard method doCancelAction.
@Override
public void doCancelAction() {
final ModuleWizardStep step = getCurrentStepObject();
step.onStepLeaving();
super.doCancelAction();
}
use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.
the class NewProjectWizard method init.
protected void init(@NotNull ModulesProvider modulesProvider) {
myWizardContext.setModulesProvider(modulesProvider);
ProjectTypeStep projectTypeStep = new ProjectTypeStep(myWizardContext, this, modulesProvider);
Disposer.register(getDisposable(), projectTypeStep);
mySequence.addCommonStep(projectTypeStep);
ChooseTemplateStep chooseTemplateStep = new ChooseTemplateStep(myWizardContext, projectTypeStep);
mySequence.addCommonStep(chooseTemplateStep);
mySequence.addCommonFinishingStep(new ProjectSettingsStep(myWizardContext), null);
for (ModuleWizardStep step : mySequence.getAllSteps()) {
addStep(step);
}
if (myWizardContext.isCreatingNewProject()) {
projectTypeStep.loadRemoteTemplates(chooseTemplateStep);
}
super.init();
}
use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.
the class AbstractProjectWizard method dispose.
@Override
protected void dispose() {
StepSequence sequence = getSequence();
if (sequence != null) {
for (ModuleWizardStep step : sequence.getAllSteps()) {
step.disposeUIResources();
}
}
super.dispose();
}
use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.
the class AddModuleWizard method navigateToStep.
/**
* Allows to ask current wizard to move to the desired step.
*
* @param filter closure that allows to indicate target step - is called with each of registered steps and is expected
* to return {@code true} for the step to go to
* @return {@code true} if current wizard is navigated to the target step; {@code false} otherwise
*/
public boolean navigateToStep(@NotNull Function<Step, Boolean> filter) {
for (int i = 0, myStepsSize = mySteps.size(); i < myStepsSize; i++) {
ModuleWizardStep step = mySteps.get(i);
if (filter.fun(step) != Boolean.TRUE) {
continue;
}
// Update current step.
myCurrentStep = i;
updateStep();
return true;
}
return false;
}
use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.
the class ImportFromSourcesTestCase method importFromSources.
protected void importFromSources(File dir) {
myRootDir = dir;
try {
myProject = doCreateProject(getIprFile());
myBuilder.setBaseProjectPath(dir.getAbsolutePath());
List<DetectedRootData> list = RootDetectionProcessor.detectRoots(dir);
MultiMap<ProjectStructureDetector, DetectedProjectRoot> map = RootDetectionProcessor.createRootsMap(list);
myBuilder.setupProjectStructure(map);
for (ProjectStructureDetector detector : map.keySet()) {
List<ModuleWizardStep> steps = detector.createWizardSteps(myBuilder, myBuilder.getProjectDescriptor(detector), EmptyIcon.ICON_16);
try {
for (ModuleWizardStep step : steps) {
if (step instanceof AbstractStepWithProgress<?>) {
performStep((AbstractStepWithProgress<?>) step);
}
}
} finally {
for (ModuleWizardStep step : steps) {
step.disposeUIResources();
}
}
}
myBuilder.commit(myProject, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations