use of org.pentaho.ui.xul.components.XulConfirmBox in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method showConfirm.
public void showConfirm(final JavaScriptObject callback, String message, String title, String okText, String cancelText) throws XulException {
XulConfirmBox confirm = (XulConfirmBox) wizard.getMainWizardContainer().getDocumentRoot().createElement("confirmbox");
confirm.setTitle(title);
confirm.setMessage(message);
confirm.setAcceptLabel(okText);
confirm.setCancelLabel(cancelText);
confirm.addDialogCallback(new XulDialogCallback<String>() {
public void onClose(XulComponent component, Status status, String value) {
if (status == XulDialogCallback.Status.ACCEPT) {
notifyDialogCallbackSuccess(callback, value);
}
}
public void onError(XulComponent component, Throwable err) {
notifyDialogCallbackError(callback, err.getMessage());
}
});
confirm.open();
}
use of org.pentaho.ui.xul.components.XulConfirmBox in project data-access by pentaho.
the class GwtDatasourceEditorEntryPoint method overwriteFileDialog.
/**
* used to handle the overwrite in repository message
*
* @param parentFormPanel
* @param message
* @param controller
*/
public void overwriteFileDialog(final FormPanel parentFormPanel, String message, final IOverwritableController controller) {
// Experiment
XulConfirmBox confirm = null;
try {
confirm = (XulConfirmBox) wizard.getMainWizardContainer().getDocumentRoot().createElement("confirmbox");
} catch (XulException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
confirm.setTitle("Confirmation");
confirm.setMessage(message);
confirm.setAcceptLabel("Ok");
confirm.setCancelLabel("Cancel");
confirm.addDialogCallback(new XulDialogCallback<String>() {
public void onClose(XulComponent component, Status status, String value) {
if (status == XulDialogCallback.Status.ACCEPT) {
controller.setOverwrite(true);
controller.removeHiddenPanels();
controller.buildAndSetParameters();
parentFormPanel.submit();
}
}
public void onError(XulComponent component, Throwable err) {
return;
}
});
confirm.open();
}
use of org.pentaho.ui.xul.components.XulConfirmBox in project data-access by pentaho.
the class AnalysisImportDialogController method overwriteFileDialog.
@Bindable
public void overwriteFileDialog(int code) {
if (code != PUBLISH_SCHEMA_CATALOG_EXISTS_ERROR && code != PUBLISH_SCHEMA_EXISTS_ERROR) {
return;
}
String msg = messages.getString("Mondrian.OVERWRITE_EXISTING_SCHEMA");
if (PUBLISH_SCHEMA_CATALOG_EXISTS_ERROR == code) {
msg = messages.getString("Mondrian.OVERWRITE_EXISTING_CATALOG");
}
XulConfirmBox confirm = null;
try {
confirm = (XulConfirmBox) document.createElement("confirmbox");
} catch (XulException e) {
Window.alert(e.getMessage());
}
confirm.setTitle("Confirmation");
confirm.setMessage(msg);
confirm.setAcceptLabel("Ok");
confirm.setCancelLabel("Cancel");
confirm.addDialogCallback(new XulDialogCallback<String>() {
public void onClose(XulComponent component, Status status, String value) {
if (status == XulDialogCallback.Status.ACCEPT) {
overwrite = true;
removeHiddenPanels();
buildAndSetParameters();
formPanel.submit();
}
}
public void onError(XulComponent component, Throwable err) {
return;
}
});
confirm.open();
}
use of org.pentaho.ui.xul.components.XulConfirmBox in project data-access by pentaho.
the class MetadataImportDialogController method confirm.
/**
* Shows a confirmation dialog
*
* @param title
* @param message
* @param okButtonLabel
* @param cancelButtonLabel
* @param onResulthandler
*/
private void confirm(final String title, final String message, final String okButtonLabel, final String cancelButtonLabel, final AsyncCallback<Boolean> onResulthandler) {
XulConfirmBox confirm = new GwtConfirmBox() {
@Override
public Panel getDialogContents() {
VerticalPanel vp = new VerticalPanel();
Label lbl = new Label(this.getMessage());
vp.add(lbl);
vp.setCellHorizontalAlignment(lbl, VerticalPanel.ALIGN_LEFT);
vp.setCellVerticalAlignment(lbl, VerticalPanel.ALIGN_MIDDLE);
return vp;
}
};
confirm.setTitle(title);
confirm.setMessage(message);
confirm.setAcceptLabel(okButtonLabel);
confirm.setCancelLabel(cancelButtonLabel);
confirm.addDialogCallback(new XulDialogCallback<String>() {
public void onClose(XulComponent component, Status status, String value) {
if (onResulthandler != null) {
onResulthandler.onSuccess(status == XulDialogCallback.Status.ACCEPT);
}
}
public void onError(XulComponent component, Throwable err) {
onResulthandler.onFailure(err);
return;
}
});
confirm.open();
}
Aggregations