Search in sources :

Example 1 with XulMessageBox

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

Example 2 with XulMessageBox

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

Example 3 with XulMessageBox

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

Example 4 with XulMessageBox

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();
        }
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox) Spoon(org.pentaho.di.ui.spoon.Spoon) XulException(org.pentaho.ui.xul.XulException) KettleException(org.pentaho.di.core.exception.KettleException)

Example 5 with XulMessageBox

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

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