Search in sources :

Example 41 with XulException

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

the class BrowseController method confirm.

protected void confirm(String title, String message, final Callable<Void> onAccept) throws XulException {
    String yes = BaseMessages.getString(PKG, "Dialog.YesDelete");
    String no = BaseMessages.getString(PKG, "Dialog.No");
    try {
        confirmDialog(onAccept, BaseMessages.getString(PKG, title), BaseMessages.getString(PKG, message), yes, no);
    } catch (Exception e) {
        throw new XulException(e);
    }
}
Also used : XulException(org.pentaho.ui.xul.XulException) XulException(org.pentaho.ui.xul.XulException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) UIObjectCreationException(org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException) KettleException(org.pentaho.di.core.exception.KettleException)

Example 42 with XulException

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

the class ConnectionsController method doLazyInit.

@Override
protected boolean doLazyInit() {
    try {
        mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
    } catch (XulException e) {
        return false;
    }
    try {
        setRepReadOnly(this.repository.getRepositoryMeta().getRepositoryCapabilities().isReadOnly());
        // Load the SWT Shell from the explorer dialog
        shell = ((SwtDialog) document.getElementById("repository-explorer-dialog")).getShell();
        bf = new DefaultBindingFactory();
        bf.setDocument(this.getXulDomContainer().getDocumentRoot());
        if (bf != null) {
            createBindings();
        }
        enableButtons(true, false, false);
        return true;
    } catch (Exception e) {
        if (mainController == null || !mainController.handleLostRepository(e)) {
            return false;
        }
    }
    return false;
}
Also used : DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) XulException(org.pentaho.ui.xul.XulException) XulException(org.pentaho.ui.xul.XulException) KettleException(org.pentaho.di.core.exception.KettleException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) UIObjectCreationException(org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException)

Example 43 with XulException

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

the class PartitionsController method doLazyInit.

protected boolean doLazyInit() {
    // Load the SWT Shell from the explorer dialog
    shell = ((SwtDialog) document.getElementById("repository-explorer-dialog")).getShell();
    try {
        mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
    } catch (XulException e) {
        return false;
    }
    enableButtons(true, false, false);
    bf = new SwtBindingFactory();
    bf.setDocument(this.getXulDomContainer().getDocumentRoot());
    if (bf != null) {
        createBindings();
    }
    return true;
}
Also used : SwtBindingFactory(org.pentaho.ui.xul.swt.SwtBindingFactory) XulException(org.pentaho.ui.xul.XulException)

Example 44 with XulException

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

the class SecurityController method doLazyInit.

@Override
protected boolean doLazyInit() {
    try {
        mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
    } catch (XulException e) {
        return false;
    }
    try {
        boolean serviceInitialized = initService();
        if (!serviceInitialized) {
            return false;
        }
    } catch (Exception e) {
        if (mainController == null || !mainController.handleLostRepository(e)) {
            throw new RuntimeException(e);
        }
        return false;
    }
    try {
        managed = service.isManaged();
        createModel();
        messageBox = (XulMessageBox) document.createElement("messagebox");
        bf = new SwtBindingFactory();
        bf.setDocument(this.getXulDomContainer().getDocumentRoot());
    } catch (Exception e) {
        if (mainController == null || !mainController.handleLostRepository(e)) {
            throw new RuntimeException(e);
        }
    }
    if (bf != null) {
        createBindings();
    }
    if (!managed) {
        showButtons(false, false, false);
    }
    setInitialDeck();
    return true;
}
Also used : SwtBindingFactory(org.pentaho.ui.xul.swt.SwtBindingFactory) XulException(org.pentaho.ui.xul.XulException) XulException(org.pentaho.ui.xul.XulException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)

Example 45 with XulException

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

the class SlavesController method doLazyInit.

@Override
protected boolean doLazyInit() {
    // Load the SWT Shell from the explorer dialog
    shell = ((SwtDialog) document.getElementById("repository-explorer-dialog")).getShell();
    enableButtons(true, false, false);
    bf = new SwtBindingFactory();
    bf.setDocument(this.getXulDomContainer().getDocumentRoot());
    try {
        mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
    } catch (XulException e) {
        return false;
    }
    if (bf != null) {
        createBindings();
    }
    return true;
}
Also used : SwtBindingFactory(org.pentaho.ui.xul.swt.SwtBindingFactory) 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