use of org.pentaho.ui.xul.containers.XulDialog in project pentaho-kettle by pentaho.
the class DatabaseDialogHarness method showDialog.
private void showDialog() {
XulDomContainer container = null;
try {
DatabaseConnectionDialog dcDialog = new DatabaseConnectionDialog();
container = dcDialog.getSwtInstance(new Shell(SWT.NONE));
if (database != null) {
container.getEventHandler("dataHandler").setData(database);
}
} catch (XulException e) {
e.printStackTrace();
}
XulRoot root = (XulRoot) container.getDocumentRoot().getRootElement();
if (root instanceof XulDialog) {
((XulDialog) root).show();
}
if (root instanceof XulWindow) {
((XulWindow) root).open();
}
try {
database = (DatabaseMeta) container.getEventHandler("dataHandler").getData();
} catch (Exception e) {
e.printStackTrace();
}
String message = DatabaseDialogHarness.setMessage(database);
Shell shell = new Shell(SWT.DIALOG_TRIM);
shell.setLayout(new RowLayout());
Label label = new Label(shell, SWT.NONE);
label.setText(message);
Button button = new Button(shell, SWT.NONE);
button.setText("Edit Database ...");
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
try {
showDialog();
} catch (Exception e) {
e.printStackTrace();
}
}
});
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch()) {
shell.getDisplay().sleep();
}
}
}
use of org.pentaho.ui.xul.containers.XulDialog 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.containers.XulDialog in project data-access by pentaho.
the class MultiTableDatasource method onFinish.
@Override
public void onFinish(final XulServiceCallback<IDatasourceSummary> callback) {
if (this.validator.allTablesJoined()) {
String dsName = this.wizardModel.getDatasourceName();
MultiTableDatasourceDTO dto = this.joinGuiModel.createMultiTableDatasourceDTO(dsName);
dto.setSelectedConnection(this.connection);
joinSelectionServiceGwtImpl.serializeJoins(dto, this.connection, new XulServiceCallback<IDatasourceSummary>() {
public void success(IDatasourceSummary retVal) {
callback.success(retVal);
}
public void error(String message, Throwable error) {
MessageHandler.getInstance().closeWaitingDialog();
MessageHandler.getInstance().showErrorDetailsDialog(MessageHandler.getString("ERROR"), MessageHandler.getString("multitable.ERROR_SAVING_MODEL"), error.getLocalizedMessage());
}
});
} else {
MessageHandler.getInstance().closeWaitingDialog();
XulDialog wizardDialog = (XulDialog) document.getElementById("main_wizard_window");
wizardDialog.show();
this.displayErrors(this.validator.getError());
}
}
use of org.pentaho.ui.xul.containers.XulDialog in project data-access by pentaho.
the class MessageHandler method showErrorDialog.
public void showErrorDialog(String title, String message, boolean showWizardDialog) {
this.showWizardDialog = showWizardDialog;
XulDialog errorDialog = (XulDialog) document.getElementById("errorDialog");
errorDialog.setTitle(title);
XulLabel errorLabel = (XulLabel) document.getElementById("errorLabel");
errorLabel.setValue(message);
errorDialog.show();
}
use of org.pentaho.ui.xul.containers.XulDialog in project data-access by pentaho.
the class MessageHandler method showErrorDetailsDialog.
public void showErrorDetailsDialog(String title, String message, String detailMessage) {
XulDialog errorDialog = (XulDialog) document.getElementById("errorDetailsDialog");
errorDialog.setTitle(title);
XulLabel errorLabel = (XulLabel) document.getElementById("errorDetailsLabel");
errorLabel.setValue(message);
XulLabel detailMessageBox = (XulLabel) document.getElementById("error_dialog_details");
detailMessageBox.setValue(detailMessage);
errorDialog.show();
}
Aggregations