public IWizardPage getNextPage(IWizardPage page) {
    if (page == importToolSelectionPage) {

      // The user has chosen an import tool and cannot change his/her selection; go get the
      // data entry pages from the import tool extension element and add all import wizard
      // pages.  Make sure we build and add the wizard pages only once.


      // get a hold of the import tool and the parameters configured for it in the defining
      // extension and create the import tool proxy
      IRecordElementsImportTool importTool =
      Properties importToolParms = activeRecordElementsImportToolExtensionElement.getParameters();
      proxy = new RecordElementsImportToolProxy(importTool, importToolParms);

      // return the first import tool data entry page or null if no data entry pages are
      // defined
      if (!dataEntryWizardPages.isEmpty()) {
        return dataEntryWizardPages.get(0);
      } else {
        return null;
    } else if (dataEntryWizardPages != null && dataEntryWizardPages.contains(page)) {
      // we need the next data entry page
      int i = dataEntryWizardPages.indexOf(page);
      if (i < 0) {
        throw new RuntimeException("logic error");
      } else {
        // get the next relevant data entry page, if any
        ImportWizardPage nextPage = getNextRelevantPageIndex(i);
        if (nextPage != null) {
          // there is a next relevant data entry page, so return it
          return nextPage;
        } else {
          // no next data entry page, prepare the preview page and return it
          SchemaRecord record = new RecordModelBuilder().build("DUMMY");
          String recordElementsDSL = Tools.generateRecordElementsDSL(record);
          return previewPage;
    return null;
 private void disposeImportTool() {
   if (proxy != null) {