Search in sources :

Example 1 with DataHandler

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();
    }
}
Also used : SwingXulLoader(org.pentaho.ui.xul.swing.SwingXulLoader) DataHandler(org.pentaho.ui.database.event.DataHandler) SwingXulLoader(org.pentaho.ui.xul.swing.SwingXulLoader)

Aggregations

DataHandler (org.pentaho.ui.database.event.DataHandler)1 SwingXulLoader (org.pentaho.ui.xul.swing.SwingXulLoader)1