예제 #1
0
 protected final void doOKAction() {
   int idx = getCurrentStep();
   try {
     do {
       final ModuleWizardStep step = mySteps.get(idx);
       if (step != getCurrentStepObject()) {
         step.updateStep();
       }
       if (!commitStepData(step)) {
         return;
       }
       step.onStepLeaving();
       try {
         step._commit(true);
       } catch (CommitStepException e) {
         String message = e.getMessage();
         if (message != null) {
           Messages.showErrorDialog(getCurrentStepComponent(), message);
         }
         return;
       }
       if (!isLastStep(idx)) {
         idx = getNextStep(idx);
       } else {
         break;
       }
     } while (true);
   } finally {
     myCurrentStep = idx;
     updateStep();
   }
   super.doOKAction();
 }
예제 #2
0
  protected void updateStep() {
    final ModuleWizardStep currentStep = getCurrentStepObject();
    currentStep.updateStep();

    super.updateStep();

    updateButtons();

    final JButton nextButton = getNextButton();
    final JButton finishButton = getFinishButton();
    final boolean isLastStep = isLastStep(getCurrentStep());

    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            if (!isShowing()) {
              return;
            }
            final JComponent preferredFocusedComponent = currentStep.getPreferredFocusedComponent();
            if (preferredFocusedComponent != null) {
              preferredFocusedComponent.requestFocus();
            } else {
              if (isLastStep) {
                finishButton.requestFocus();
              } else {
                nextButton.requestFocus();
              }
            }
            getRootPane().setDefaultButton(isLastStep ? finishButton : nextButton);
          }
        });
  }
예제 #3
0
 private boolean showCustomOptions(@NotNull ModuleBuilder builder) {
   String card = builder.getBuilderId();
   if (!myCustomSteps.containsKey(card)) {
     ModuleWizardStep step = builder.getCustomOptionsStep(myContext, this);
     if (step == null) return false;
     step.updateStep();
     myCustomSteps.put(card, step);
     myOptionsPanel.add(step.getComponent(), card);
   }
   showCard(card);
   return true;
 }