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());
}
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();
}
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);
}
Aggregations