package org.formic.wizard.impl.gui;

import java.awt.event.ActionEvent;

import javax.swing.JOptionPane;

import org.formic.Installer;

import org.pietschy.wizard.Wizard;
import org.pietschy.wizard.WizardAction;
import org.pietschy.wizard.WizardStep;

/**
 * Action for canceling the installation.
 *
 * @author Eric Van Dewoestine (ervandew@yahoo.com)
 * @version $Revision$
 */
public class CancelAction
  extends WizardAction
{
  protected CancelAction(Wizard model)
  {
    super("cancel", model);
  }

  /**
   * {@inheritDoc}
   * @see WizardAction#doAction(ActionEvent)
   */
  public void doAction (ActionEvent e)
  {
    if(isEnabled()){
      int result = JOptionPane.showConfirmDialog(
          wizard,
          Installer.getString("quit.confirm.text"),
          Installer.getString("quit.confirm.title"),
          JOptionPane.YES_NO_OPTION);
      if(result == JOptionPane.OK_OPTION){
        getWizard().cancel();
      }
    }else{
      getWizard().cancel();
    }
  }

  /**
   * {@inheritDoc}
   * @see WizardAction#updateState()
   */
  protected void updateState()
  {
    WizardStep step = getWizard().getModel().getActiveStep();
    if(step != null){
      setEnabled(!getWizard().getModel().isLastStep(step));
    }
  }
}

@@ -77,61 +77,74 @@
 ort 
-javax.swing.JOptionPane;%0A%0Aimport org.formic.Installer
+org.formic.Installer;%0A%0Aimport org.formic.wizard.gui.dialog.Dialogs
 ;%0A%0Ai
@@ -664,252 +664,72 @@
    i
-nt result = JOptionPane.showConfirmDialog(%0A          wizard,%0A          Installer.getString(%22quit.confirm.text%22),%0A          Installer.getString(%22quit.confirm.title%22),%0A          JOptionPane.YES_NO_OPTION);%0A      if(result == JOptionPane.OK_OPTION
+f(Dialogs.showConfirm(%22quit.confirm.title%22, %22quit.confirm.text%22)
 )%7B%0A 

use new Dialogs util class