Exemplo n.º 1
0
 /** Go to the next panel, or finish if this is the last panel */
 public void next() {
   if (!nextButton.isEnabled()) return;
   currentPanel.canAdvance = true;
   currentPanel.wizardNext();
   if (!currentPanel.canAdvance) return;
   for (WizardListener listener : listeners) listener.wizardNext(currentPanel);
 }
Exemplo n.º 2
0
  /**
   * Set the current panel
   *
   * @param panel the panel
   */
  protected void setCurrentPanel(WizardPanel panel) {

    currentPanel = panel;
    currentPanel.prepare();

    cardLayout.show(cardPanel, currentPanel.toString());

    backButton.setEnabled(currentPanel != firstPanel);
    cancelButton.setText("Cancel");
    nextButton.setText("Next");
    cancelButton.setEnabled(true);
  }
Exemplo n.º 3
0
  /**
   * Register a wizard panel
   *
   * @param id the panel ID
   * @param panel the panel
   */
  protected void registerWizardPanel(Object id, WizardPanel panel) {

    panel.key = id;
    panel.wizard = this;

    panels.add(panel);
    panelMap.put(id, panel);

    cardPanel.add(panel.getPanel(), panel.toString());

    if (firstPanel == null) {
      firstPanel = panel;
      currentPanel = panel;
      setCurrentPanel(panel);
      pack();
    }
  }
Exemplo n.º 4
0
 /** Cancel the dialog */
 public void cancel() {
   if (!cancelButton.isEnabled()) return;
   currentPanel.wizardCancel();
   for (WizardListener listener : listeners) returnCode = listener.wizardCancel(currentPanel);
   setVisible(false);
 }
Exemplo n.º 5
0
 /** Go to the previous panel */
 public void back() {
   if (!backButton.isEnabled()) return;
   currentPanel.wizardBack();
   for (WizardListener listener : listeners) listener.wizardBack(currentPanel);
 }
Exemplo n.º 6
0
 public void setWizardControllerOnPanel(WizardPanel panel) {
   panel.setWizardController(getWizardController());
 }