    public void run() {
        int currentState = 0; 
        WizardUndo undoStack = new WizardUndo();
        Object ret;
        boolean wizardComplete = false;
        while (!wizardComplete) {
            if (wdlg.isStopClicked()) {
                m_log.info(states[currentState].getStateName() + " clicked stop ");
                wizardComplete = true;
            } else if (wdlg.isNextClicked()) {
                m_log.info(states[currentState].getStateName() + " clicked next ");
                if (currentState == states.length - 1) {
                    wdlg.whichState(WizardDialog.STATE_LAST);
                    wizardComplete = true;
                } else {
                    wdlg.whichState(WizardDialog.STATE_INTERMEDIATE);
                    System.out.println("Will evaluate " + states[currentState].getStateName());
                    ret = wdlg.getCurrentStateUI().evaluate();
                    if (ret == null) continue;
                    else undoStack.push(ret);
                    currentState++;
                    wdlg.setCurrentStateUI(states[currentState]);                    
                }
            } else if (wdlg.isBackClicked()) {
                m_log.info(states[currentState].getStateName() + " clicked back ");
                if (currentState == 0) {
                    wdlg.whichState(WizardDialog.STATE_FIRST);
                    continue;
                } else wdlg.whichState(WizardDialog.STATE_INTERMEDIATE);
                undoStack.undo(currentState);
                currentState--;
                wdlg.setCurrentStateUI(states[currentState]);
            } else if (wdlg.isCancelClicked()) {
                m_log.info(states[currentState].getStateName() + " clicked cancel ");
                undoStack.undoAll(currentState);
                wizardComplete = true;
            }
        } 
    } 

    public void run() {
        int currentState = 0; 
        WizardUndo undoStack = new WizardUndo();
        Object ret;
        boolean wizardComplete = false;
        while (!wizardComplete) {
            if (wdlg.isStopClicked()) {
                m_log.info(states[currentState].getLabel().getText() + " clicked stop ");
                wizardComplete = true;
            } else if (wdlg.isNextClicked()) {
                m_log.info(states[currentState].getLabel().getText() + " clicked next ");
                if (currentState == states.length - 1) {
                    wdlg.whichState(WizardDialog.STATE_LAST);
                    wizardComplete = true;
                } else {
                    wdlg.whichState(WizardDialog.STATE_INTERMEDIATE);
                    ret = wdlg.getCurrentStateUI().evaluate();
                    if (ret == null) continue;
                    else undoStack.push(ret);
                    currentState++;
                    wdlg.setCurrentStateUI(states[currentState]);                    
                }
            } else if (wdlg.isBackClicked()) {
                m_log.info(states[currentState].getLabel().getText() + " clicked back ");
                if (currentState == 0) {
                    wdlg.whichState(WizardDialog.STATE_FIRST);
                    continue;
                } else wdlg.whichState(WizardDialog.STATE_INTERMEDIATE);
                undoStack.undo(currentState);
                currentState--;
                wdlg.setCurrentStateUI(states[currentState]);
            } else if (wdlg.isCancelClicked()) {
                m_log.info(states[currentState].getLabel().getText() + " clicked cancel ");
                undoStack.undoAll(currentState);
                wizardComplete = true;
            }
        } 
    } 
