use of org.pentaho.platform.dataaccess.datasource.wizard.controllers.WizardDatasourceController in project data-access by pentaho.
the class EmbeddedWizard method xulLoaded.
/*
* (non-Javadoc)
*
* @see org.pentaho.ui.xul.gwt.util.IXulLoaderCallback#xulLoaded(org.pentaho.ui.xul.gwt.GwtXulRunner)
*/
public void xulLoaded(GwtXulRunner runner) {
mainWizardContainer = runner.getXulDomContainers().get(0);
Document rootDocument = mainWizardContainer.getDocumentRoot();
BindingFactory bf = new GwtBindingFactory(rootDocument);
ResourceBundle resBundle = (ResourceBundle) mainWizardContainer.getResourceBundles().get(0);
datasourceMessages = new GwtDatasourceMessages();
datasourceMessages.setMessageBundle(resBundle);
MessageHandler.getInstance().setMessages(datasourceMessages);
connectionController = new ConnectionController(rootDocument);
connectionController.setDatasourceModel(datasourceModel);
// connectionController.setService(connectionService);
mainWizardContainer.addEventHandler(connectionController);
summaryDialogController.setBindingFactory(bf);
mainWizardContainer.addEventHandler(summaryDialogController);
wizardController = new MainWizardController(bf, wizardModel, datasourceService);
mainWizardContainer.addEventHandler(wizardController);
dialog = (XulDialog) rootDocument.getElementById(WIZARD_DIALOG_ID);
MessageHandler.getInstance().setWizardDialog(dialog);
datasourceController = new WizardDatasourceController();
datasourceController.setBindingFactory(bf);
datasourceController.setDatasourceMessages(datasourceMessages);
mainWizardContainer.addEventHandler(datasourceController);
mainWizardContainer.addEventHandler(MessageHandler.getInstance());
// add the steps ..
// physicalStep = new RelationalPhysicalStep(datasourceService, connectionService, datasourceMessages, this);
wizardController.addWizardListener(this);
// Controller for the File Import functionality
FileImportController fileImportController = new FileImportController(datasourceModel, datasourceMessages);
mainWizardContainer.addEventHandler(fileImportController);
// init other controllers
fileImportController.init();
MessageHandler.getInstance().init();
summaryDialogController.init();
// Create the gui
try {
// new WizardContentPanel(wizardController).addContent(mainWizardContainer);
wizardController.init();
initialized = true;
} catch (Exception throwable) {
throwable.printStackTrace();
}
// Remap the upload action in development mode
if (GWT.isScript() == false) {
// $NON-NLS-1$
XulFileUpload upload = (XulFileUpload) rootDocument.getElementById("fileUpload");
// $NON-NLS-1$
upload.setAction(GWT.getModuleBaseURL() + "UploadService");
}
initialized = true;
if (asyncConstructorListener != null) {
asyncConstructorListener.asyncConstructorDone(this);
}
}
Aggregations