com.intellij.ide.util.projectWizard.WizardContext Java Examples

The following examples show how to use com.intellij.ide.util.projectWizard.WizardContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlazeImportProjectAction.java    From intellij with Apache License 2.0 6 votes vote down vote up
@Override
public void actionPerformed(AnActionEvent e) {
  BlazeNewProjectWizard wizard =
      new BlazeNewProjectWizard() {
        @Override
        protected ProjectImportWizardStep[] getSteps(WizardContext context) {
          return new ProjectImportWizardStep[] {
            new BlazeSelectWorkspaceImportWizardStep(context),
            new BlazeSelectBuildSystemBinaryStep(context),
            new BlazeSelectProjectViewImportWizardStep(context),
            new BlazeEditProjectViewImportWizardStep(context)
          };
        }
      };
  if (!wizard.showAndGet()) {
    return;
  }
  BlazeProjectCreator projectCreator = new BlazeProjectCreator(wizard.context, wizard.builder);
  projectCreator.createFromWizard();
}
 
Example #2
Source File: AsposeMavenModuleWizardStep.java    From Aspose.OCR-for-Java with MIT License 6 votes vote down vote up
public AsposeMavenModuleWizardStep(Project project, AsposeMavenModuleBuilder builder, WizardContext context, boolean includeArtifacts) {
    myProjectOrNull = project;
    myBuilder = builder;
    myContext = context;
    $$$setupUI$$$();
    initComponents();
    loadSettings();
    bannerLbl.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            int labelwidth = bannerLbl.getWidth();
            int labelheight = bannerLbl.getHeight();
            Image img = icon.getImage();
            bannerLbl.setIcon(new ImageIcon(img.getScaledInstance(labelwidth, labelheight, Image.SCALE_FAST)));
        }
    });
}
 
Example #3
Source File: HaxeHxmlDetectionStep.java    From intellij-haxe with Apache License 2.0 6 votes vote down vote up
public HaxeHxmlDetectionStep(ProjectFromSourcesBuilder builder, HaxeProjectConfigurationUpdater projectUpdater) {
  this.myProjectUpdater = projectUpdater;

  WizardContext context = builder.getContext();
  Vector<String> hxmlList = new Vector<>();
  String projectDir = context.getProjectFileDirectory();
  List<String> hxmlFiles = findHxmlFiles(projectDir);
  for(String hxmlPath:hxmlFiles) {
    try {
      List<HXMLData> hxmls = HXMLData.load(context.getProject(), projectDir, hxmlPath);
      if(!hasTarget(hxmls)) {
        throw new HXMLData.HXMLDataException("No compilation target.");
      }
      hxmlList.addElement(hxmlPath);
    }
    catch (HXMLData.HXMLDataException e) {
      //e.printStackTrace();
    }
  }

  myGui = new HXMLSelector(hxmlList);
}
 
Example #4
Source File: FlutterGeneratorPeer.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public FlutterGeneratorPeer(WizardContext context) {
  myContext = context;
  myInstallSdkAction = new InstallSdkAction(this);

  errorIcon.setText("");
  errorIcon.setIcon(AllIcons.Actions.Lightning);
  Messages.installHyperlinkSupport(errorText);

  // Hide pending real content.
  myVersionContent.setVisible(false);
  myProgressBar.setVisible(false);
  myProgressText.setVisible(false);
  myCancelProgressButton.setVisible(false);

  init();
}
 
Example #5
Source File: RoboVmModuleBuilder.java    From robovm-idea with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, ModulesProvider modulesProvider) {
    RoboVmModuleWizardStep wizardStep = new RoboVmModuleWizardStep(this, wizardContext, modulesProvider);

    if (!robovmDir.isEmpty()) {
        wizardStep.disableBuildSystem();
        buildSystem = BuildSystem.Gradle;
    }

    if (!robovmDir.isEmpty() && !RoboVmPlugin.isAndroidSdkSetup()) {
        RoboVmAndroidModuleWizardStep androidStep = new RoboVmAndroidModuleWizardStep(this, wizardContext,
                modulesProvider);
        return new ModuleWizardStep[] { androidStep, wizardStep };
    } else {
        return new ModuleWizardStep[] { wizardStep };
    }
}
 
Example #6
Source File: PantsProjectImportProvider.java    From intellij-pants-plugin with Apache License 2.0 6 votes vote down vote up
@Override
public ModuleWizardStep[] createSteps(WizardContext context) {
  /**
   * Newer export version project sdk can be automatically discovered and configured.
   */
  AtomicBoolean isSdkConfigured = new AtomicBoolean(true);
  String message = PantsBundle.message("pants.default.sdk.config.progress");
  ProgressManager.getInstance().run(new Task.Modal(context.getProject(), message, !CAN_BE_CANCELLED) {
    @Override
    public void run(@NotNull ProgressIndicator indicator) {
      if (isSdkConfigured.get()) {
        isSdkConfigured.set(isJvmProject(context.getProjectFileDirectory()));
      }
    }
  });
  if (isSdkConfigured.get()) {
    return super.createSteps(context);
  }
  return ArrayUtil.append(super.createSteps(context), new ProjectJdkStep(context));
}
 
Example #7
Source File: ProjectDetails.java    From intellij-spring-assistant with MIT License 6 votes vote down vote up
public boolean validate(ModuleBuilder moduleBuilder, WizardContext wizardContext)
    throws ConfigurationException {
  if (!request.hasValidGroupId()) {
    throw new ConfigurationException("Invalid group id", "Invalid Data");
  } else if (!request.hasValidArtifactId()) {
    throw new ConfigurationException("Invalid artifact id", "Invalid Data");
  } else if (!request.hasValidVersion()) {
    throw new ConfigurationException("Invalid version", "Invalid Data");
  } else if (!request.hasValidName()) {
    throw new ConfigurationException("Invalid name", "Invalid Data");
  } else if (!request.hasValidPackageName()) {
    throw new ConfigurationException("Invalid package", "Invalid Data");
  } else if (!request.hasCompatibleJavaVersion(moduleBuilder, wizardContext)) {
    JavaSdkVersion wizardSdkVersion = from(wizardContext, moduleBuilder);
    throw new ConfigurationException("Selected Java version " + requireNonNull(
        IdAndName.class.cast(javaVersion.getSelectedItem())).getName()
        + " is not supported. Max supported version is (" + requireNonNull(wizardSdkVersion)
        .getMaxLanguageLevel().getCompilerComplianceDefaultOption()
        + ").\n\n You can go back to first screen and change the Project/Module SDK version there if you need support for newer Java versions",
        "Java Compatibility");
  }
  return true;
}
 
Example #8
Source File: FlutterGeneratorPeer.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public FlutterGeneratorPeer(WizardContext context) {
  myContext = context;
  myInstallSdkAction = new InstallSdkAction(this);

  errorIcon.setText("");
  errorIcon.setIcon(AllIcons.Actions.Lightning);
  Messages.installHyperlinkSupport(errorText);

  // Hide pending real content.
  myVersionContent.setVisible(false);
  myProgressBar.setVisible(false);
  myProgressText.setVisible(false);
  myCancelProgressButton.setVisible(false);

  init();
}
 
Example #9
Source File: MuleMavenModuleBuilder.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable) {
    MuleVersionConfiguration step = new MuleVersionConfiguration(this, muleVersion);
    Disposer.register(parentDisposable, step);
    return step;
}
 
Example #10
Source File: BlazeNewProjectWizard.java    From intellij with Apache License 2.0 5 votes vote down vote up
public BlazeNewProjectWizard() {
  super("Import Project from " + Blaze.defaultBuildSystemName(), (Project) null);

  builder = new BlazeProjectImportBuilder();
  context = new WizardContext(null, getDisposable());
  context.setWizard(this);
  context.setProjectBuilder(builder);
  for (ProjectImportWizardStep step : getSteps(context)) {
    addStep(step);
  }
  init();
}
 
Example #11
Source File: FlutterModuleBuilder.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
@Override
public ModuleWizardStep getCustomOptionsStep(final WizardContext context, final Disposable parentDisposable) {
  if (!context.isCreatingNewProject()) {
    myProject = context.getProject();
  }
  myStep = new FlutterModuleWizardStep(context);
  mySettingsFields = new FlutterCreateAdditionalSettingsFields(new FlutterCreateAdditionalSettings(), this::getFlutterSdk, myProject);
  Disposer.register(parentDisposable, myStep);
  return myStep;
}
 
Example #12
Source File: FlutterModuleBuilder.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
@Override
public ModuleWizardStep getCustomOptionsStep(final WizardContext context, final Disposable parentDisposable) {
  if (!context.isCreatingNewProject()) {
    myProject = context.getProject();
  }
  myStep = new FlutterModuleWizardStep(context);
  mySettingsFields = new FlutterCreateAdditionalSettingsFields(new FlutterCreateAdditionalSettings(), this::getFlutterSdk, myProject);
  Disposer.register(parentDisposable, myStep);
  return myStep;
}
 
Example #13
Source File: SlingMavenModuleBuilder.java    From aem-ide-tooling-4-intellij with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable) {
    // Prepare the Sling / AEM Archetypes for IntelliJ
    if(archetypeTemplateList.isEmpty()) {
        archetypeTemplateList = obtainArchetypes();
    }
    List<ArchetypeTemplate> list = context.getProject() == null ? archetypeTemplateList : new ArrayList<ArchetypeTemplate>();
    // Instead of displaying a List of All Maven Archetypes we just show the ones applicable.
    SlingArchetypesStep step = new SlingArchetypesStep(this, list);
    Disposer.register(parentDisposable, step);
    return step;
}
 
Example #14
Source File: DubboModuleWizardStep.java    From intellij-idea-plugin with Apache License 2.0 5 votes vote down vote up
public DubboModuleWizardStep(DubboPluginModuleBuilder builder, WizardContext context, boolean includeArtifacts) {
    myProject = context.getProject();
    myBuilder = builder;
    myContext = context;
    System.out.println("start to init wizard step");
    initCheckBoxAndMap();
}
 
Example #15
Source File: TYPO3CMSProjectTemplatesFactory.java    From idea-php-typo3-plugin with MIT License 5 votes vote down vote up
@NotNull
@Override
public ProjectTemplate[] createTemplates(@Nullable String group, WizardContext context) {
    return new ProjectTemplate[]{
            new TYPO3CMSClassicLayoutDirectoryProjectGenerator(),
            new TYPO3CMSComposerLayoutDirectoryProjectGenerator()
    };
}
 
Example #16
Source File: ProjectCreationRequest.java    From intellij-spring-assistant with MIT License 5 votes vote down vote up
public boolean hasCompatibleJavaVersion(ModuleBuilder moduleBuilder,
    WizardContext wizardContext) {
  JavaSdkVersion wizardSdkVersion = from(wizardContext, moduleBuilder);
  if (wizardSdkVersion != null) {
    LanguageLevel selectedLanguageLevel = parse(javaVersion.getId());
    JavaSdkVersion selectedSdkVersion =
        selectedLanguageLevel != null ? fromLanguageLevel(selectedLanguageLevel) : null;
    // only if selected java version is compatible with wizard version
    return selectedSdkVersion == null || wizardSdkVersion.isAtLeast(selectedSdkVersion);
  }
  return true;
}
 
Example #17
Source File: InitializrUtil.java    From intellij-spring-assistant with MIT License 5 votes vote down vote up
@Nullable
public static JavaSdkVersion from(WizardContext context, ModuleBuilder builder) {
  Sdk wizardSdk = context.isCreatingNewProject() ?
      context.getProjectJdk() :
      chooseNotNull(builder.getModuleJdk(), context.getProjectJdk());
  return wizardSdk == null ? null : getInstance().getVersion(wizardSdk);
}
 
Example #18
Source File: NutzBootMakerChooseWizardStep.java    From NutzCodeInsight with Apache License 2.0 5 votes vote down vote up
public NutzBootMakerChooseWizardStep(NutzBootModuleBuilder moduleBuilder, WizardContext wizardContext) {
    this.moduleBuilder = moduleBuilder;
    this.wizardContext = wizardContext;
    makerUrl.setText("https://get.nutz.io");
    reloadButton.addActionListener((event -> {
        try {
            refresh(HttpUtil.get(makerUrl.getText() + "/maker.json"));
        } catch (Exception e) {
            Messages.showErrorDialog("网络异常!请稍候尝试!" + e.getMessage(), "错误提示");
        }
    }));
}
 
Example #19
Source File: BlazeEditProjectViewImportWizardStep.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void validateAndUpdateModel() throws ConfigurationException {
  BlazeValidationResult validationResult = control.validate();
  validationResult.throwConfigurationExceptionIfNotSuccess();

  BlazeNewProjectBuilder builder = getProjectBuilder();
  control.updateBuilder(builder);

  WizardContext wizardContext = getWizardContext();
  wizardContext.setProjectName(builder.getProjectName());
  wizardContext.setProjectFileDirectory(builder.getProjectDataDirectory());
}
 
Example #20
Source File: SlingMavenModuleBuilder.java    From aem-ide-tooling-4-intellij with Apache License 2.0 5 votes vote down vote up
@Override
public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider) {
    // It is not possible with IntelliJ to use the same Form with another class AFAIK
    // The original Select Properties Step is replaced by our own as we need to handle additional Properties from
    // archetype (required properties) and provide a Name field for convenience.
    return new ModuleWizardStep[]{
        new MavenModuleWizardStep(this, wizardContext, !wizardContext.isNewWizard()),
        new ArchetypePropertiesStep(wizardContext.getProject(), this)
    };
}
 
Example #21
Source File: CrudTemplateFactory.java    From crud-intellij-plugin with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public ProjectTemplate[] createTemplates(@Nullable String group, WizardContext context) {
    return new ProjectTemplate[]{
            new BuilderBasedTemplate(new SpringBootModuleBuilder()),
    };
}
 
Example #22
Source File: RPiJavaModuleBuilder.java    From embeddedlinux-jvmdebugger-intellij with Apache License 2.0 5 votes vote down vote up
/**
 * Adds a custom wizard GUI
 * @param context
 * @param parentDisposable
 * @return
 */
@Nullable
@Override
public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable) {
    EmbeddedJavaModuleStep step = new EmbeddedJavaModuleStep(this);
    Disposer.register(parentDisposable, step);
    return step;
}
 
Example #23
Source File: RoboVmTemplatesFactory.java    From robovm-idea with GNU General Public License v2.0 5 votes vote down vote up
@NotNull
@Override
public ProjectTemplate[] createTemplates(String group, WizardContext context) {
    return new ProjectTemplate[] {
            new RoboVmProjectTemplate("RoboVM iOS & Android Cross-Platform App", "A multi module project with support for Android and iOS, with a shared code project", new RoboVmModuleBuilder("cross-platform", "ios")),
            new RoboVmProjectTemplate("RoboVM iOS Single View App", "A basic single view app using storyboards", new RoboVmModuleBuilder("single-view")),
            new RoboVmProjectTemplate("RoboVM iOS App without storyboards", "A basic single view app without storyboards", new RoboVmModuleBuilder("default")),
            new RoboVmProjectTemplate("RoboVM Console App", "A console app for Mac OS X or Linux", new RoboVmModuleBuilder("console")),
    };
}
 
Example #24
Source File: VueModuleBuilder.java    From vue-for-idea with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
@Override
public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable) {
    VueModuleWizardStep step = new VueModuleWizardStep(context, loadSettings());
    Disposer.register(parentDisposable, step);
    return step;
}
 
Example #25
Source File: PantsProjectImportBuilder.java    From intellij-pants-plugin with Apache License 2.0 5 votes vote down vote up
@Override
protected void applyExtraSettings(@NotNull WizardContext context) {
  Optional.ofNullable(getExternalProjectNode())
    .map(node -> ExternalSystemApiUtil.find(node, ProjectSdkData.KEY))
    .map(DataNode::getData)
    .map(ProjectSdkData::getSdkName)
    .map(ProjectJdkTable.getInstance()::findJdk)
    .ifPresent(context::setProjectJdk);
}
 
Example #26
Source File: DemoModuleType.java    From intellij-sdk-docs with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext,
                                            @NotNull DemoModuleBuilder moduleBuilder,
                                            @NotNull ModulesProvider modulesProvider) {
  return super.createWizardSteps(wizardContext, moduleBuilder, modulesProvider);
}
 
Example #27
Source File: DemoModuleWizardStep.java    From intellij-sdk-docs with Apache License 2.0 5 votes vote down vote up
@Override
public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext,
                                            @NotNull ModulesProvider modulesProvider) {
  return new ModuleWizardStep[]{new ModuleWizardStep() {
    @Override
    public JComponent getComponent() {
      return new JLabel("Put your content here");
    }

    @Override
    public void updateDataModel() {

    }
  }};
}
 
Example #28
Source File: HaxeModuleType.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
public ModuleWizardStep[] createWizardSteps(final WizardContext wizardContext,
                                            final HaxeModuleBuilder moduleBuilder,
                                            final ModulesProvider modulesProvider) {
  HaxeSdkType type = HaxeSdkType.getInstance();
  type.ensureSdk();

  return new ModuleWizardStep[]{
    new HaxeSdkWizardStep(moduleBuilder, wizardContext, type)
  };
}
 
Example #29
Source File: HaxeProjectStructureDetector.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
@Override
public List<ModuleWizardStep> createWizardSteps(ProjectFromSourcesBuilder builder, ProjectDescriptor projectDescriptor, Icon stepIcon) {
  HaxeSdkType type = HaxeSdkType.getInstance();
  type.ensureSdk();
  WizardContext wizardContext = builder.getContext();
  HaxeProjectConfigurationUpdater projectUpdater = new HaxeProjectConfigurationUpdater(wizardContext.getProjectFileDirectory());
  ((ProjectFromSourcesBuilderImpl)builder).addConfigurationUpdater(projectUpdater);
  HaxeModuleInsight moduleInsight = new HaxeModuleInsight(new DelegatingProgressIndicator(), builder);
  final List<ModuleWizardStep> steps = new ArrayList<>();
  steps.add(new HaxeLibrariesDetectionStep(builder, moduleInsight, projectUpdater));
  steps.add(new ModulesDetectionStep(this, builder, projectDescriptor, moduleInsight, stepIcon, "reference.dialogs.new.project.fromCode.page2"));
  steps.add(new ProjectJdkForModuleStep(wizardContext, type));
  steps.add(new HaxeHxmlDetectionStep(builder, projectUpdater));
  return steps;
}
 
Example #30
Source File: CppModuleType.java    From CppTools with Apache License 2.0 5 votes vote down vote up
public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, CppModuleBuilder cppModuleBuilder, ModulesProvider modulesProvider) {
  final List<Sdk> list = CppSdkType.getInstance().getCppSdks();
  final ModuleWizardStep sourceModuleWizardStep = ProjectWizardStepFactory.getInstance().createSourcePathsStep(wizardContext, cppModuleBuilder, null, null);
  final ModuleWizardStep createSampleCode = new CreateEntryCodeStep(cppModuleBuilder);

  if (list.size() == 0) {
    return new ModuleWizardStep[] { new ChooseCppSdkStep(cppModuleBuilder, wizardContext),sourceModuleWizardStep, createSampleCode };
  }
  return new ModuleWizardStep[] { sourceModuleWizardStep, createSampleCode };
}