Search in sources :

Example 1 with XulListbox

use of org.pentaho.ui.xul.containers.XulListbox 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 2 with XulListbox

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

the class FragmentHandlerTest method testRefreshOptions.

@Test
public void testRefreshOptions() throws Exception {
    XulListbox connectionBox = mock(XulListbox.class);
    when(document.getElementById("connection-type-list")).thenReturn(connectionBox);
    when(connectionBox.getSelectedItem()).thenReturn("myDb");
    XulListbox accessBox = mock(XulListbox.class);
    when(document.getElementById("access-type-list")).thenReturn(accessBox);
    when(accessBox.getSelectedItem()).thenReturn("Native");
    DataHandler dataHandler = mock(DataHandler.class);
    when(xulDomContainer.getEventHandler("dataHandler")).thenReturn(dataHandler);
    DatabaseInterface dbInterface = mock(DatabaseInterface.class);
    when(dbInterface.getDefaultDatabasePort()).thenReturn(5309);
    DataHandler.connectionMap.put("myDb", dbInterface);
    XulComponent component = mock(XulComponent.class);
    XulComponent parent = mock(XulComponent.class);
    when(component.getParent()).thenReturn(parent);
    when(document.getElementById("database-options-box")).thenReturn(component);
    XulDomContainer fragmentContainer = mock(XulDomContainer.class);
    Document mockDoc = mock(Document.class);
    XulComponent firstChild = mock(XulComponent.class);
    when(mockDoc.getFirstChild()).thenReturn(firstChild);
    when(fragmentContainer.getDocumentRoot()).thenReturn(mockDoc);
    when(xulDomContainer.loadFragment(anyString(), any(Object.class))).thenReturn(fragmentContainer);
    XulTextbox portBox = mock(XulTextbox.class);
    when(document.getElementById("port-number-text")).thenReturn(portBox);
    fragmentHandler.refreshOptions();
    // Iterate through the other database access types
    when(accessBox.getSelectedItem()).thenReturn("JNDI");
    fragmentHandler.refreshOptions();
    when(accessBox.getSelectedItem()).thenReturn("ODBC");
    fragmentHandler.refreshOptions();
    when(accessBox.getSelectedItem()).thenReturn("OCI");
    fragmentHandler.refreshOptions();
    when(accessBox.getSelectedItem()).thenReturn("Plugin");
    fragmentHandler.refreshOptions();
}
Also used : DatabaseInterface(org.pentaho.di.core.database.DatabaseInterface) XulTextbox(org.pentaho.ui.xul.components.XulTextbox) XulListbox(org.pentaho.ui.xul.containers.XulListbox) XulDomContainer(org.pentaho.ui.xul.XulDomContainer) Document(org.pentaho.ui.xul.dom.Document) XulComponent(org.pentaho.ui.xul.XulComponent) Test(org.junit.Test)

Example 3 with XulListbox

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

the class QueryPhysicalStep method activating.

@Override
public void activating() {
    XulVbox queryVbox = (XulVbox) document.getElementById("queryBox");
    queryVbox.setVisible(true);
    XulVbox metadataVbox = (XulVbox) document.getElementById("metadata");
    metadataVbox.setVisible(false);
    XulVbox connectionsVbox = (XulVbox) document.getElementById("connectionsLbl");
    connectionsVbox.setVisible(false);
    XulListbox connections = (XulListbox) document.getElementById("connectionList");
    connections.setWidth(180);
    connections.setHeight(325);
}
Also used : XulVbox(org.pentaho.ui.xul.containers.XulVbox) XulListbox(org.pentaho.ui.xul.containers.XulListbox)

Aggregations

XulListbox (org.pentaho.ui.xul.containers.XulListbox)3 XulVbox (org.pentaho.ui.xul.containers.XulVbox)2 Test (org.junit.Test)1 DatabaseInterface (org.pentaho.di.core.database.DatabaseInterface)1 XulComponent (org.pentaho.ui.xul.XulComponent)1 XulDomContainer (org.pentaho.ui.xul.XulDomContainer)1 XulException (org.pentaho.ui.xul.XulException)1 XulRadio (org.pentaho.ui.xul.components.XulRadio)1 XulTextbox (org.pentaho.ui.xul.components.XulTextbox)1 Document (org.pentaho.ui.xul.dom.Document)1