Search in sources :

Example 6 with XulMessageBox

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();
    }
}
Also used : IUIAbsRole(org.pentaho.di.ui.repository.pur.repositoryexplorer.abs.IUIAbsRole) KettleException(org.pentaho.di.core.exception.KettleException) XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox) IAbsSecurityManager(org.pentaho.di.ui.repository.pur.services.IAbsSecurityManager) IUIRole(org.pentaho.di.ui.repository.pur.repositoryexplorer.IUIRole)

Example 7 with XulMessageBox

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();
    }
}
Also used : UIRepositoryObject(org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryObject) XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox) UIRepositoryContent(org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent)

Example 8 with XulMessageBox

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();
}
Also used : XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox) XulException(org.pentaho.ui.xul.XulException)

Example 9 with XulMessageBox

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;
}
Also used : XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox)

Example 10 with XulMessageBox

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();
}
Also used : XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox)

Aggregations

XulMessageBox (org.pentaho.ui.xul.components.XulMessageBox)22 XulException (org.pentaho.ui.xul.XulException)12 KettleException (org.pentaho.di.core.exception.KettleException)4 Spoon (org.pentaho.di.ui.spoon.Spoon)3 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)2 IUIRole (org.pentaho.di.ui.repository.pur.repositoryexplorer.IUIRole)2 IUIAbsRole (org.pentaho.di.ui.repository.pur.repositoryexplorer.abs.IUIAbsRole)2 IAbsSecurityManager (org.pentaho.di.ui.repository.pur.services.IAbsSecurityManager)2 Image (org.eclipse.swt.graphics.Image)1 Test (org.junit.Test)1 BaseMessages.getString (org.pentaho.di.i18n.BaseMessages.getString)1 JobMeta (org.pentaho.di.job.JobMeta)1 RepositoryLock (org.pentaho.di.repository.pur.model.RepositoryLock)1 TransMeta (org.pentaho.di.trans.TransMeta)1 PushDownOptimizationMeta (org.pentaho.di.trans.dataservice.optimization.PushDownOptimizationMeta)1 ParameterGeneration (org.pentaho.di.trans.dataservice.optimization.paramgen.ParameterGeneration)1 UIRepositoryContent (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent)1 UIRepositoryObject (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryObject)1 XulComponent (org.pentaho.ui.xul.XulComponent)1 XulDomContainer (org.pentaho.ui.xul.XulDomContainer)1