protected void finish() {
    logger.trace("finish() - start");

    if (controller.finish(this)) {
      this.dispose();
    }

    logger.trace("finish() - end");
  }
  protected void abort() {
    logger.trace("abort() - start");

    if (controller.abort(this)) {
      this.dispose();
    }

    logger.trace("abort() - end");
  }
  protected void previousPage() {
    logger.trace("previousPage() - start");

    if (controller.previousPage(this, currentPage)) {
      int prevOrderPage = currentPage.order - 1;
      WizardPage prevPage = null;
      for (WizardPage page : pages) {
        if (page.order == prevOrderPage) {
          prevPage = page;
          break;
        }
      }
      // prevPage.update();
      ShowPage(prevPage);
    }

    logger.trace("previousPage() - end");
  }
  protected void nextPage() throws Exception {
    logger.trace("nextPage() - start");

    if (controller.nextPage(this, currentPage)) {
      int nextOrderPage = currentPage.order + 1;
      WizardPage nextPage = null;
      for (WizardPage page : pages) {
        if (page.order == nextOrderPage) {
          nextPage = page;
          break;
        }
      }
      nextPage.update();
      ShowPage(nextPage);
    }

    logger.trace("nextPage() - end");
  }
  /** @wbp.parser.constructor */
  public Wizard(String title, Rectangle rect, boolean show) {
    logger.trace("Wizard(String, Rectangle, boolean) - start");

    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    setModal(true);

    this.controller = GuiController.getInstance();
    this.controller.setCurrentWizard(this);
    this.setTitle(title);
    this.pages = new WizardPageList();
    setBounds(rect == null ? DEFAULT_DIMENSIONS : rect);
    getContentPane().setLayout(new BorderLayout(0, 0));

    navigationPanel = new JPanel();
    getContentPane().add(navigationPanel, BorderLayout.SOUTH);

    btnAbort =
        new JButton(
            Messages.getString("Wizard.btnAbort.text", "Annulla")); // $NON-NLS-1$ //$NON-NLS-2$
    btnAbort.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            logger.trace("$ActionListener.actionPerformed(ActionEvent) - start");

            abort();

            logger.trace("$ActionListener.actionPerformed(ActionEvent) - end");
          }
        });

    btnPrevious =
        new JButton(
            Messages.getString("Wizard.btnPrevious.text", "Indietro")); // $NON-NLS-1$ //$NON-NLS-2$
    btnPrevious.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            logger.trace("$ActionListener.actionPerformed(ActionEvent) - start");

            previousPage();

            logger.trace("$ActionListener.actionPerformed(ActionEvent) - end");
          }
        });

    btnNext =
        new JButton(
            Messages.getString("Wizard.btnNext.text", "Avanti")); // $NON-NLS-1$ //$NON-NLS-2$
    btnNext.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            logger.trace("$ActionListener.actionPerformed(ActionEvent) - start");

            try {
              nextPage();
            } catch (Exception e) {
              logger.warn("$ActionListener.actionPerformed(ActionEvent)", e);

              GuiUtility.showInfoBox(
                  "Error", e.getMessage().replace(". ", ".\n"), JOptionPane.ERROR_MESSAGE);
            }

            logger.trace("$ActionListener.actionPerformed(ActionEvent) - end");
          }
        });

    btnFinish =
        new JButton(
            Messages.getString("Wizard.btnFinish.text", "Fine")); // $NON-NLS-1$ //$NON-NLS-2$
    btnFinish.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            logger.trace("$ActionListener.actionPerformed(ActionEvent) - start");

            finish();

            logger.trace("$ActionListener.actionPerformed(ActionEvent) - end");
          }
        });

    navigationPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 5));
    navigationPanel.add(btnAbort);
    navigationPanel.add(btnPrevious);
    navigationPanel.add(btnNext);
    navigationPanel.add(btnFinish);

    contentPanel = new JPanel();
    contentPanel.addComponentListener(
        new ComponentAdapter() {
          @Override
          public void componentResized(ComponentEvent panel) {
            logger.trace("$ComponentAdapter.componentResized(ComponentEvent) - start");

            resizeWizardPage();

            logger.trace("$ComponentAdapter.componentResized(ComponentEvent) - end");
          }
        });
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new BorderLayout(0, 0));

    addWindowListener(this);

    GuiUtility.centerWindow(this);
    this.setVisible(show);

    logger.trace("Wizard(String, Rectangle, boolean) - end");
  }