use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class XulDatabaseExplorerController method displayRowCount.
public void displayRowCount() {
if (this.model.getTable() == null) {
return;
}
try {
GetTableSizeProgressDialog pd = new GetTableSizeProgressDialog(this.dbExplorerDialog.getShell(), this.model.getDatabaseMeta(), this.model.getTable(), model.getSchema());
Long theCount = pd.open();
if (theCount != null) {
XulMessageBox theMessageBox = (XulMessageBox) document.createElement("messagebox");
theMessageBox.setModalParent(this.dbExplorerDialog.getShell());
theMessageBox.setTitle(BaseMessages.getString(PKG, "DatabaseExplorerDialog.TableSize.Title"));
theMessageBox.setMessage(BaseMessages.getString(PKG, "DatabaseExplorerDialog.TableSize.Message", this.model.getTable(), theCount.toString()));
theMessageBox.open();
}
} catch (XulException e) {
LogChannel.GENERAL.logError("Error displaying row count", e);
}
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class FragmentHandler method showMessage.
protected void showMessage(String message) {
try {
XulMessageBox box = (XulMessageBox) document.createElement("messagebox");
box.setMessage(message);
box.open();
} catch (XulException e) {
System.out.println("Error creating messagebox " + e.getMessage());
}
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class DataHandler method showMessage.
protected void showMessage(String message, boolean scroll) {
try {
XulMessageBox box = (XulMessageBox) document.createElement("messagebox");
box.setMessage(message);
box.setModalParent(((XulRoot) document.getElementById("general-datasource-window")).getRootObject());
if (scroll) {
box.setScrollable(true);
box.setWidth(500);
box.setHeight(400);
}
box.open();
} catch (XulException e) {
System.out.println("Error creating messagebox " + e.getMessage());
}
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class EESpoonPlugin method onEvent.
@Override
public void onEvent(SpoonLifeCycleEvent evt) {
try {
switch(evt) {
case MENUS_REFRESHED:
break;
case REPOSITORY_CHANGED:
doOnSecurityUpdate();
break;
case REPOSITORY_CONNECTED:
final Spoon spoon = getSpoonInstance();
if (spoon != null) {
// Check permissions to see so we can decide how to close tabs that should not be open
// For example if user connects and does not have create content perms, then we should force
// closing of the tabs.
spoon.getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
try {
warnClosingOfOpenTabsBasedOnPerms(spoon);
} catch (KettleException ex) {
// Ok we are just checking perms
}
}
});
}
doOnSecurityUpdate();
break;
case REPOSITORY_DISCONNECTED:
updateMenuState(true, true);
break;
case STARTUP:
registerUISuppportForRepositoryExplorer();
break;
case SHUTDOWN:
break;
default:
break;
}
} catch (KettleException e) {
try {
initMainSpoonContainer();
XulMessageBox messageBox = // $NON-NLS-1$
(XulMessageBox) spoonXulContainer.getDocumentRoot().createElement("messagebox");
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Success"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
messageBox.setMessage(// $NON-NLS-1$
BaseMessages.getString(PKG, "AbsController.RoleActionPermission.Success"));
messageBox.open();
} catch (Exception ex) {
e.printStackTrace();
}
}
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class PurRepositoryDialog method displayRepositoryAlreadyExistMessage.
private void displayRepositoryAlreadyExistMessage(String name) {
try {
XulMessageBox messageBox = (XulMessageBox) container.getDocumentRoot().createElement("messagebox");
// $NON-NLS-1$
messageBox.setTitle(resourceBundle.getString("Dialog.Error"));
// $NON-NLS-1$
messageBox.setAcceptLabel(resourceBundle.getString("Dialog.Ok"));
// $NON-NLS-1$
messageBox.setMessage(BaseMessages.getString(PKG, "PurRepositoryDialog.Dialog.ErrorIdExist.Message", name));
messageBox.open();
} catch (XulException e) {
throw new RuntimeException(e);
}
}
Aggregations