@Override
  protected void backPressed() {
    // move workflow to previous state, start up a new thread to do it.
    final Workflow pipe = getWizard().getWorkflow();

    if (pipe.getCurrentState().getPreviousState() == null) {
      // this means that this wizard is part of a larger wizard and we need to return control
      // to it.  See setAdapter for details
      workflowWizardAdapter.backPressed();
    }

    IRunnableWithProgress runnable =
        new IRunnableWithProgress() {
          public void run(IProgressMonitor monitor)
              throws InvocationTargetException, InterruptedException {

            pipe.previous(monitor);
          }
        };
    try {
      run(false, true, runnable);
    } catch (InvocationTargetException e) {
      CatalogUIPlugin.log(e.getLocalizedMessage(), e);
    } catch (InterruptedException e) {
      CatalogUIPlugin.log(e.getLocalizedMessage(), e);
    }
  }
  @Override
  protected void nextPressed() {
    // if there are no more states, do nothing
    if (getWorkflowWizard().getWorkflow().isFinished()) {
      return;
    }
    if (!getCurrentPage().leavingPage()) {
      return;
    }

    // move workflow to next state, start up a new thread to do it.
    final Workflow pipe = getWizard().getWorkflow();

    try {
      // don't fork, can cancel during transition
      run(
          false,
          true,
          new IRunnableWithProgress() {

            public void run(IProgressMonitor monitor)
                throws InvocationTargetException, InterruptedException {
              pipe.next(monitor); // progress through the workflow
            }
          });
    } catch (Exception e) {
      CatalogUIPlugin.log("Exception while moving workflow forward", e); // $NON-NLS-1$
    }
  }
  @Override
  protected void finishPressed() {
    // if there are no more states, do nothing
    if (getWorkflowWizard().getWorkflow().isFinished()) return;

    /*
     * what happens if the page is driven by the state?  I
     * guess it means the state knows that it can pass so
     * go for it.
     */
    if (!getCurrentPage().leavingPage()) {
      return;
    }

    // move workflow to next state, start up a new thread to do it.
    final Workflow pipe = getWizard().getWorkflow();

    try {
      run(
          false,
          true,
          new IRunnableWithProgress() {

            public void run(IProgressMonitor monitor)
                throws InvocationTargetException, InterruptedException {
              pipe.run(monitor);
            }
          });
    } catch (Exception e) {
      CatalogUIPlugin.log("Exception while moving workflow forward", e); // $NON-NLS-1$
    }
  }
 protected void nextPressedSuper() {
   try {
     super.nextPressed();
   } catch (Exception e) {
     setErrorMessage(Messages.WorkflowWizard_PageTransitionError);
     CatalogUIPlugin.log(
         "WorkflowWizardDialog#nextPressedSuper(): Error moving to "
             + getWorkflowWizard().getWorkflow().getCurrentState().getName(),
         e); //$NON-NLS-1$
   }
 }