use of org.pentaho.ui.database.event.DataHandler in project mondrian by pentaho.
the class Workbench method connectionButtonActionPerformed.
private void connectionButtonActionPerformed(ActionEvent evt) {
if (connectionDialog == null) {
dbMeta = getDbMeta(null);
connectionDialogController = new DataHandler();
connectionDialogController.setName("dataHandler");
XulDomContainer container = null;
try {
XulLoader loader = new SwingXulLoader();
container = loader.loadXul(DatabaseConnectionDialog.DIALOG_DEFINITION_FILE, Messages.getBundle());
} catch (XulException e) {
throw new RuntimeException("Xul failed to initialize", e);
}
container.addEventHandler(connectionDialogController);
connectionDialogController.loadConnectionData();
connectionDialogController.setData(dbMeta);
connectionDialog = (XulDialog) container.getDocumentRoot().getRootElement();
}
connectionDialog.show();
dbMeta = (DatabaseMeta) connectionDialogController.getData();
if (dbMeta.hasChanged()) {
dbMeta.clearChanged();
syncToWorkspace(dbMeta);
// Enforces the JDBC preferences entered throughout all schemas
// currently opened in the workbench.
resetWorkbench();
}
}
Aggregations