Search in sources :

Example 6 with XulException

use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.

the class FragmentHandler method loadDatabaseOptionsFragment.

protected void loadDatabaseOptionsFragment(String fragmentUri) throws XulException {
    XulComponent groupElement = document.getElementById("database-options-box");
    XulComponent parentElement = groupElement.getParent();
    XulDomContainer fragmentContainer;
    try {
        // Get new group box fragment ...
        // This will effectively set up the SWT parent child relationship...
        fragmentContainer = this.xulDomContainer.loadFragment(fragmentUri, Messages.getBundle());
        XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild();
        parentElement.replaceChild(groupElement, newGroup);
    } catch (XulException e) {
        e.printStackTrace();
        throw e;
    }
}
Also used : XulException(org.pentaho.ui.xul.XulException) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) XulComponent(org.pentaho.ui.xul.XulComponent)

Example 7 with XulException

use of org.pentaho.ui.xul.XulException 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 8 with XulException

use of org.pentaho.ui.xul.XulException 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 9 with XulException

use of org.pentaho.ui.xul.XulException 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)

Example 10 with XulException

use of org.pentaho.ui.xul.XulException in project pentaho-kettle by pentaho.

the class AbsController method initializeLogicalSystemRolesUI.

/**
 * Initialized the ActionPermissions UI with all the possible values from LogicalSystemRoles enum
 */
private void initializeLogicalSystemRolesUI() {
    try {
        Map<String, String> logicalRoles = ((IAbsSecurityManager) service).getAllLogicalRoles(GlobalMessages.getLocale().getDisplayName());
        for (Entry<String, String> logicalRole : logicalRoles.entrySet()) {
            XulCheckbox logicalSystemRoleCheckbox;
            // $NON-NLS-1$
            logicalSystemRoleCheckbox = (XulCheckbox) document.createElement("checkbox");
            logicalSystemRoleCheckbox.setLabel(logicalRole.getValue());
            logicalSystemRoleCheckbox.setId(logicalRole.getValue());
            // $NON-NLS-1$
            logicalSystemRoleCheckbox.setCommand("iSecurityController.updateSystemRoleActionPermission()");
            logicalSystemRoleCheckbox.setFlex(1);
            logicalSystemRoleCheckbox.setDisabled(true);
            logicalSystemRolesBox.addChild(logicalSystemRoleCheckbox);
            logicalSystemRoleChecboxMap.put(logicalSystemRoleCheckbox, logicalRole.getKey());
            bf.setBindingType(Binding.Type.ONE_WAY);
            // $NON-NLS-1$ //$NON-NLS-2$
            bf.createBinding(systemRoleListBox, "selectedIndex", logicalSystemRoleCheckbox, "disabled", buttonConverter);
        }
    } catch (XulException xe) {
    } catch (KettleException xe) {
    }
}
Also used : XulCheckbox(org.pentaho.ui.xul.components.XulCheckbox) KettleException(org.pentaho.di.core.exception.KettleException) IAbsSecurityManager(org.pentaho.di.ui.repository.pur.services.IAbsSecurityManager) XulException(org.pentaho.ui.xul.XulException)

Aggregations

XulException (org.pentaho.ui.xul.XulException)60 KettleException (org.pentaho.di.core.exception.KettleException)20 Test (org.junit.Test)11 XulMessageBox (org.pentaho.ui.xul.components.XulMessageBox)10 XulComponent (org.pentaho.ui.xul.XulComponent)9 Shell (org.eclipse.swt.widgets.Shell)7 ControllerInitializationException (org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)7 KettleXulLoader (org.pentaho.di.ui.xul.KettleXulLoader)7 SwtXulRunner (org.pentaho.ui.xul.swt.SwtXulRunner)7 XulDomContainer (org.pentaho.ui.xul.XulDomContainer)6 SwtDialog (org.pentaho.ui.xul.swt.tags.SwtDialog)6 XulRunner (org.pentaho.ui.xul.XulRunner)5 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 Document (org.pentaho.ui.xul.dom.Document)4 ResourceBundle (java.util.ResourceBundle)3 Mockito.doAnswer (org.mockito.Mockito.doAnswer)3 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 Answer (org.mockito.stubbing.Answer)3 XulLoader (org.pentaho.ui.xul.XulLoader)3 SwtBindingFactory (org.pentaho.ui.xul.swt.SwtBindingFactory)3