mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
EA-36409 - IAE: LibrariesContainerFactory.createContainer
This commit is contained in:
@@ -56,6 +56,7 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
private static final String ADD_MODULE_TITLE = IdeBundle.message("title.add.module");
|
||||
private static final String NEW_PROJECT_TITLE = IdeBundle.message("title.new.project");
|
||||
private final Project myCurrentProject;
|
||||
private final ModulesProvider myModulesProvider;
|
||||
private WizardContext myWizardContext;
|
||||
private ProjectCreateModeStep myRootStep;
|
||||
|
||||
@@ -63,22 +64,24 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
/**
|
||||
* @param project if null, the wizard will start creating new project, otherwise will add a new module to the existing project.
|
||||
*/
|
||||
public AddModuleWizard(final Project project, final ModulesProvider modulesProvider, @Nullable String defaultPath) {
|
||||
public AddModuleWizard(final Project project, final @NotNull ModulesProvider modulesProvider, @Nullable String defaultPath) {
|
||||
super(project == null ? NEW_PROJECT_TITLE : ADD_MODULE_TITLE, project);
|
||||
myCurrentProject = project;
|
||||
initModuleWizard(project, modulesProvider, defaultPath);
|
||||
myModulesProvider = modulesProvider;
|
||||
initModuleWizard(project, defaultPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param project if null, the wizard will start creating new project, otherwise will add a new module to the existing proj.
|
||||
*/
|
||||
public AddModuleWizard(Component parent, final Project project, ModulesProvider modulesProvider) {
|
||||
public AddModuleWizard(Component parent, final Project project, @NotNull ModulesProvider modulesProvider) {
|
||||
super(project == null ? NEW_PROJECT_TITLE : ADD_MODULE_TITLE, parent);
|
||||
myCurrentProject = project;
|
||||
initModuleWizard(project, modulesProvider, null);
|
||||
myModulesProvider = modulesProvider;
|
||||
initModuleWizard(project, null);
|
||||
}
|
||||
|
||||
private void initModuleWizard(final Project project, final ModulesProvider modulesProvider, @Nullable final String defaultPath) {
|
||||
private void initModuleWizard(final Project project, @Nullable final String defaultPath) {
|
||||
myWizardContext = new WizardContext(project);
|
||||
if (defaultPath != null) {
|
||||
myWizardContext.setProjectFileDirectory(defaultPath);
|
||||
@@ -101,7 +104,7 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
};
|
||||
addStep(myRootStep);
|
||||
for (WizardMode mode : myRootStep.getModes()) {
|
||||
appendSteps(mode.getSteps(myWizardContext, modulesProvider));
|
||||
appendSteps(mode.getSteps(myWizardContext, myModulesProvider));
|
||||
}
|
||||
init();
|
||||
}
|
||||
@@ -257,7 +260,7 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
|
||||
protected final int getNextStep(int step) {
|
||||
ModuleWizardStep nextStep = null;
|
||||
final StepSequence stepSequence = getMode().getSteps(myWizardContext, null);
|
||||
final StepSequence stepSequence = getMode().getSteps(myWizardContext, myModulesProvider);
|
||||
if (stepSequence != null) {
|
||||
if (myRootStep == mySteps.get(step)) {
|
||||
return mySteps.indexOf(stepSequence.getFirstStep());
|
||||
@@ -272,7 +275,7 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
|
||||
protected final int getPreviousStep(final int step) {
|
||||
ModuleWizardStep previousStep = null;
|
||||
final StepSequence stepSequence = getMode().getSteps(myWizardContext, null);
|
||||
final StepSequence stepSequence = getMode().getSteps(myWizardContext, myModulesProvider);
|
||||
if (stepSequence != null) {
|
||||
previousStep = stepSequence.getPreviousStep(mySteps.get(step));
|
||||
while (previousStep != null && !previousStep.isStepVisible()) {
|
||||
@@ -381,7 +384,7 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
|
||||
// Switch to the target mode if necessary.
|
||||
for (WizardMode mode : myRootStep.getModes()) {
|
||||
StepSequence steps = mode.getSteps(myWizardContext, null);
|
||||
StepSequence steps = mode.getSteps(myWizardContext, myModulesProvider);
|
||||
if (steps == null || !steps.getAllSteps().contains(step)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CreateFromScratchMode extends WizardMode {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected StepSequence createSteps(final WizardContext context, @Nullable final ModulesProvider modulesProvider) {
|
||||
protected StepSequence createSteps(final WizardContext context, @NotNull final ModulesProvider modulesProvider) {
|
||||
final StepSequence sequence = new StepSequence();
|
||||
sequence.addCommonStep(new ProjectNameWithTypeStep(context, sequence, this));
|
||||
for (ModuleBuilder builder : ModuleBuilder.getAllBuilders()) {
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class CreateFromSourcesMode extends WizardMode {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected StepSequence createSteps(final WizardContext context, @Nullable final ModulesProvider modulesProvider) {
|
||||
protected StepSequence createSteps(final WizardContext context, @NotNull final ModulesProvider modulesProvider) {
|
||||
final ProjectFromSourcesBuilderImpl projectBuilder = new ProjectFromSourcesBuilderImpl(context, modulesProvider);
|
||||
myProjectBuilder = projectBuilder;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ImportImlMode extends WizardMode {
|
||||
|
||||
|
||||
@Nullable
|
||||
protected StepSequence createSteps(final WizardContext context, @Nullable final ModulesProvider modulesProvider) {
|
||||
protected StepSequence createSteps(final WizardContext context, @NotNull final ModulesProvider modulesProvider) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ImportMode extends WizardMode {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected StepSequence createSteps(final WizardContext context, @Nullable final ModulesProvider modulesProvider) {
|
||||
protected StepSequence createSteps(final WizardContext context, @NotNull final ModulesProvider modulesProvider) {
|
||||
final StepSequence stepSequence = new StepSequence();
|
||||
final ProjectImportProvider[] providers = Extensions.getExtensions(ProjectImportProvider.PROJECT_IMPORT_PROVIDER);
|
||||
if (providers.length == 1) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class WizardMode implements Disposable {
|
||||
public abstract boolean isAvailable(final WizardContext context);
|
||||
|
||||
@Nullable
|
||||
public StepSequence getSteps(final WizardContext context, @Nullable final ModulesProvider modulesProvider) {
|
||||
public StepSequence getSteps(final WizardContext context, @NotNull final ModulesProvider modulesProvider) {
|
||||
if (myStepSequence == null) {
|
||||
myStepSequence = createSteps(context, modulesProvider);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public abstract class WizardMode implements Disposable {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected abstract StepSequence createSteps(final WizardContext context, @Nullable final ModulesProvider modulesProvider);
|
||||
protected abstract StepSequence createSteps(final WizardContext context, @NotNull final ModulesProvider modulesProvider);
|
||||
|
||||
@Nullable
|
||||
public abstract ProjectBuilder getModuleBuilder();
|
||||
|
||||
Reference in New Issue
Block a user