CompositeEditor kindsPage = createKindsPage(facade, bndr);
CompositeEditor outPutFilePage = createFilePage(bndr);
CompositeEditor outPutFolderPage = createDirectoryPage(bndr);
CompositeEditor jdbcPage = createJDBCPage(bndr);
DisposeBindingListener.linkBindingLifeCycle(bndr, optionsPage);
FlowWizard newWizard = new FlowWizard(bndr, "Import") {
public boolean canFinish() {
// ExportData dat = (ExportData) bndr.getObject();
if (t.outPut != null && t.outPut.length() != 0) {
return true;
}
if (t.asBinary && t.jdbcConnection != null
&& t.jdbcConnection.length() != 0
&& t.jdbcDriverClassName != null
&& t.jdbcDriverClassName.length() != 0
&& t.jdbcDriverClassPath != null
&& t.jdbcDriverClassPath.size() != 0) {
return true;
}
return false;
}
public void onChanged() {
getContainer().updateButtons();
}
};
final IWizardPage oPage = newWizard.addPage("options", optionsPage);
// oPage.setTitle("Options");
final IWizardPage cPage = newWizard.addPage("columns", columnsPage);
// cPage.setTitle("Columns");
final IWizardPage kPage = newWizard.addPage("kinds", kindsPage);
// cPage.setTitle("Kinds");
final IWizardPage filePage = newWizard.addPage("file", outPutFilePage);
// cPage.setTitle("Kinds");
final IWizardPage folderPage = newWizard.addPage("folder",
outPutFolderPage);
// cPage.setTitle("Kinds");
final IWizardPage jPage = newWizard.addPage("file", jdbcPage);
// cPage.setTitle("Kinds");
INextPageProvider provider = new INextPageProvider() {
public IWizardPage getNextPage(IWizardPage cureIWizardPage) {
if (cureIWizardPage == oPage) {
if (t.asCsv) {
if (!t.filterColumns) {
return cPage;
}
}
if (t.entitiesOfSelectedKinds) {
return kPage;
}
}
if (cureIWizardPage == kPage && !t.asBinary) {
return folderPage;
}
if (t.asBinary) {
return jPage;
}
if (t.entitiesOfSelectedKinds) {
return folderPage;
}
return filePage;
}
};
newWizard.setNextPageProvider(provider);
WizardDialog dl = new WizardDialog(Display.getCurrent()
.getActiveShell(), newWizard);
Image createImage = AbstractUIPlugin.imageDescriptorFromPlugin(
Activator.PLUGIN_ID, "/icons/importpref_wiz.png").createImage();
dl.setTitleImage(createImage);