use of org.pentaho.ui.xul.swing.SwingXulLoader in project pentaho-kettle by pentaho.
the class SwingTest method showDialog.
private void showDialog(final Document doc) {
XulDomContainer container = null;
try {
container = new SwingXulLoader().loadXul(DatabaseConnectionDialog.DIALOG_DEFINITION_FILE, Messages.getBundle());
if (database != null) {
container.getEventHandler("dataHandler").setData(database);
}
} catch (Exception e) {
e.printStackTrace();
}
XulDialog dialog = (XulDialog) container.getDocumentRoot().getRootElement();
container.initialize();
dialog.show();
try {
@SuppressWarnings("unused") Object data = container.getEventHandler("dataHandler").getData();
} catch (XulException e) {
System.out.println("Error getting data");
}
}
use of org.pentaho.ui.xul.swing.SwingXulLoader 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