コード例 #1
0
  public SelectTemplateStep(
      WizardContext context,
      StepSequence sequence,
      final MultiMap<TemplatesGroup, ProjectTemplate> map) {

    myWizardContext = context;
    mySequence = sequence;
    Messages.installHyperlinkSupport(myDescriptionPane);

    myFormatPanel = new ProjectFormatPanel();
    myNamePathComponent = initNamePathComponent(context);
    if (context.isCreatingNewProject()) {
      mySettingsPanel.add(myNamePathComponent, BorderLayout.NORTH);
      addExpertPanel(myModulePanel);
    } else {
      mySettingsPanel.add(myModulePanel, BorderLayout.NORTH);
    }
    bindModuleSettings();

    myExpertDecorator = new HideableDecorator(myExpertPlaceholder, "Mor&e Settings", false);
    myExpertPanel.setBorder(
        IdeBorderFactory.createEmptyBorder(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0));
    myExpertDecorator.setContentComponent(myExpertPanel);

    myList = new ProjectTypesList(myTemplatesList, map, context);
    myList.installKeyAction(getNameComponent());

    myTemplatesList
        .getSelectionModel()
        .addListSelectionListener(
            new ListSelectionListener() {

              @Override
              public void valueChanged(ListSelectionEvent e) {
                ProjectTemplate template = getSelectedTemplate();
                boolean loading = template instanceof LoadingProjectTemplate;
                myModuleBuilder =
                    template == null || loading ? null : template.createModuleBuilder();
                setupPanels(template);
                mySequence.setType(myModuleBuilder == null ? null : myModuleBuilder.getBuilderId());
                myWizardContext.requestWizardButtonsUpdate();
              }
            });

    if (myWizardContext.isCreatingNewProject()) {
      addProjectFormat(myModulePanel);
    }
  }
コード例 #2
0
 @TestOnly
 public boolean setSelectedTemplate(String group, String name) {
   return myList.setSelectedTemplate(group, name);
 }
コード例 #3
0
 @Override
 public void onStepLeaving() {
   SelectTemplateSettings settings = SelectTemplateSettings.getInstance();
   settings.EXPERT_MODE = myExpertDecorator.isExpanded();
   myList.saveSelection();
 }
コード例 #4
0
 @Nullable
 public ProjectTemplate getSelectedTemplate() {
   return myList.getSelectedTemplate();
 }
コード例 #5
0
 @Override
 public void updateStep() {
   myList.resetSelection();
   myExpertDecorator.setOn(SelectTemplateSettings.getInstance().EXPERT_MODE);
 }