use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class AbsController method applySystemRoleActionPermission.
/**
* Save the permission for the selected system role
*/
public void applySystemRoleActionPermission() {
XulMessageBox messageBox = this.getMessageBox();
IUIRole role = null;
IUIAbsRole absRole = null;
try {
role = absSecurity.getSelectedSystemRole();
if (role instanceof IUIAbsRole) {
absRole = (IUIAbsRole) role;
} else {
throw new IllegalStateException();
}
((IAbsSecurityManager) service).setLogicalRoles(absRole.getName(), absRole.getLogicalRoles());
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Success"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
// $NON-NLS-1$
messageBox.setMessage(BaseMessages.getString(PKG, "AbsController.RoleActionPermission.Success"));
messageBox.open();
// Refresh permissions in open tabs
SpoonPluginManager.getInstance().notifyLifecycleListeners(SpoonLifecycleListener.SpoonLifeCycleEvent.REPOSITORY_CHANGED);
} catch (KettleException e) {
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Error"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
messageBox.setMessage(BaseMessages.getString(PKG, "AbsController.RoleActionPermission.UnableToApplyPermissions", role.getName(), // $NON-NLS-1$
e.getLocalizedMessage()));
messageBox.open();
}
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class RepositoryLockController method viewLockNote.
public void viewLockNote() throws Exception {
List<UIRepositoryObject> selectedRepoObjects = browseController.getSelectedFileItems();
if (selectedRepoObjects.size() > 0 && selectedRepoObjects.get(0) instanceof UIRepositoryContent) {
final UIRepositoryContent contentToLock = (UIRepositoryContent) selectedRepoObjects.get(0);
// $NON-NLS-1$
XulMessageBox msgBox = (XulMessageBox) document.createElement("messagebox");
// $NON-NLS-1$
msgBox.setTitle(BaseMessages.getString(PKG, "PurRepository.LockNote.Title"));
msgBox.setMessage(((ILockObject) contentToLock).getLockMessage());
msgBox.open();
}
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class LazilyInitializedController method showErrorDialog.
private void showErrorDialog(final Exception e) {
XulMessageBox messageBox = null;
try {
messageBox = (XulMessageBox) document.createElement("messagebox");
} catch (XulException xe) {
throw new RuntimeException(xe);
}
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Error"));
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
if (e != null) {
messageBox.setMessage(BaseMessages.getString(PKG, "LazilyInitializedController.Message.UnableToInitWithParam", e.getLocalizedMessage()));
} else {
messageBox.setMessage(BaseMessages.getString(PKG, "LazilyInitializedController.Message.UnableToInit"));
}
messageBox.open();
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pentaho-kettle by pentaho.
the class ChangedWarningDialog method runXulChangedWarningDialog.
protected XulMessageBox runXulChangedWarningDialog(String fileName) throws IllegalArgumentException, XulException {
container = Spoon.getInstance().getMainSpoonContainer();
XulMessageBox messageBox = (XulMessageBox) container.getDocumentRoot().createElement("messagebox");
messageBox.setTitle(BaseMessages.getString(PKG, "Spoon.Dialog.PromptSave.Title"));
if (fileName != null) {
messageBox.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.PromptToSave.Message", fileName));
} else {
messageBox.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.PromptSave.Message"));
}
messageBox.setButtons(new Integer[] { SWT.YES, SWT.NO, SWT.CANCEL });
return messageBox;
}
use of org.pentaho.ui.xul.components.XulMessageBox in project pdi-dataservice-server-plugin by pentaho.
the class AbstractController method info.
protected void info(String title, String message) throws XulException {
XulMessageBox messageBox = createMessageBox();
messageBox.setTitle(title);
messageBox.setMessage(message);
messageBox.setIcon(SWT.ICON_INFORMATION);
messageBox.setButtons(new Object[] { SWT.OK });
messageBox.open();
}
Aggregations