Search in sources :

Example 26 with XulException

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

the class MultiTableDatasource method activating.

@Override
public void activating() throws XulException {
    this.connectionSelectionStep.activating();
    this.tablesSelectionStep.activating();
    this.joinDefinitionsStep.activating();
    XulVbox queryVbox = (XulVbox) document.getElementById("queryBox");
    queryVbox.setVisible(false);
    XulVbox metadataVbox = (XulVbox) document.getElementById("metadata");
    metadataVbox.setVisible(true);
    XulVbox connectionsVbox = (XulVbox) document.getElementById("connectionsLbl");
    connectionsVbox.setVisible(true);
    XulListbox connections = (XulListbox) document.getElementById("connectionList");
    connections.setWidth(568);
    connections.setHeight(275);
    try {
        // RPB: BISERVER-9258.
        // conditionally hiding the selection of reporting vs reporting+olap in the case where reporting only makes no
        // sense.
        // bf.createBinding(wizardModel, "reportingOnlyValid", "metadata", "visible").fireSourceChanged();
        // Use a binding to keep the radio buttons in sync
        bf.setBindingType(Type.BI_DIRECTIONAL);
        XulRadio olapRadio = (XulRadio) document.getElementById("reporting_analysis");
        bf.createBinding(olapRadio, "checked", joinGuiModel, "doOlap");
        bf.setBindingType(Type.ONE_WAY);
        XulRadio reportingRadio = (XulRadio) document.getElementById("reporting");
        bf.createBinding(wizardModel, "reportingOnlyValid", reportingRadio, "checked").fireSourceChanged();
    } catch (Exception e) {
        e.printStackTrace();
    }
    this.errorDialog = (XulDialog) document.getElementById("errorDialog");
    this.errorLabel = (XulLabel) document.getElementById("errorLabel");
    this.connectionSelectionStep.setValid(true);
    this.setConnection(connectionSelectionStep.getConnection());
}
Also used : XulVbox(org.pentaho.ui.xul.containers.XulVbox) XulRadio(org.pentaho.ui.xul.components.XulRadio) XulListbox(org.pentaho.ui.xul.containers.XulListbox) XulException(org.pentaho.ui.xul.XulException)

Example 27 with XulException

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

the class AnalysisImportDialogController method showMessagebox.

/**
 * Shows a informational dialog.
 *
 * @param title   title of dialog
 * @param message message within dialog
 */
private void showMessagebox(final String title, final String message) {
    try {
        // $NON-NLS-1$
        XulMessageBox messagebox = (XulMessageBox) document.createElement("messagebox");
        messagebox.setTitle(title);
        messagebox.setMessage(message);
        int option = messagebox.open();
    } catch (XulException e) {
        Window.alert("Show MessabeBox " + e.getMessage());
    }
}
Also used : XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox) XulException(org.pentaho.ui.xul.XulException)

Example 28 with XulException

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

the class MainWizardController method setSelectedDatasource.

@Bindable
public void setSelectedDatasource(IWizardDatasource datasource) {
    IWizardDatasource prevSelection = activeDatasource;
    activeDatasource = datasource;
    if (datasource == null || prevSelection == activeDatasource) {
        return;
    }
    try {
        datasource.activating();
        if (prevSelection != null) {
            steps.removeAll(prevSelection.getSteps());
            prevSelection.deactivating();
        }
        for (int i = 1; i < datasource.getSteps().size(); i++) {
            steps.add(datasource.getSteps().get(i));
        }
        steps.addAll(datasource.getSteps());
        wizardModel.setSelectedDatasource(datasource);
        activeStep = 0;
        updateBindings();
    } catch (XulException e) {
        // To change body of catch statement use File | Settings | File Templates.
        e.printStackTrace();
    }
}
Also used : XulException(org.pentaho.ui.xul.XulException) IWizardDatasource(org.pentaho.platform.dataaccess.datasource.wizard.IWizardDatasource) Bindable(org.pentaho.ui.xul.stereotype.Bindable)

Example 29 with XulException

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

the class DatasourceSelectionDialogController method showMessagebox.

/**
 * Shows a informational dialog.
 *
 * @param title   title of dialog
 * @param message message within dialog
 */
private void showMessagebox(final String title, final String message) {
    XulMessageBox messagebox = null;
    try {
        // $NON-NLS-1$
        messagebox = (XulMessageBox) document.createElement("messagebox");
    } catch (XulException e) {
        e.printStackTrace();
        return;
    }
    messagebox.setTitle(title);
    messagebox.setMessage(message);
    messagebox.open();
}
Also used : XulMessageBox(org.pentaho.ui.xul.components.XulMessageBox) XulException(org.pentaho.ui.xul.XulException)

Example 30 with XulException

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

the class DataHandlerTest method testShowMessage.

@Test
public void testShowMessage() throws Exception {
    dataHandler.showMessage("MyMessage", false);
    dataHandler.showMessage("MyMessage", true);
    when(document.createElement("messagebox")).thenThrow(new XulException());
    dataHandler.showMessage("MyMessage", false);
}
Also used : XulException(org.pentaho.ui.xul.XulException) Test(org.junit.Test)

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