use of org.pentaho.ui.xul.components.XulTextbox in project pentaho-kettle by pentaho.
the class FragmentHandler method refreshOptions.
/**
* This method handles the resource-like loading of the XUL fragment definitions based on connection type and access
* method. If there is a common definition, and no connection specific override definition, then the common definition
* is used. Connection specific definition resources follow the naming pattern [connection type code]_[access
* method].xul.
*/
public void refreshOptions() {
connectionBox = (XulListbox) document.getElementById("connection-type-list");
accessBox = (XulListbox) document.getElementById("access-type-list");
Object connectionKey = DataHandler.connectionNametoID.get(connectionBox.getSelectedItem());
String databaseName = null;
try {
databaseName = PluginRegistry.getInstance().getPlugin(DatabasePluginType.class, "" + connectionKey).getIds()[0];
} catch (Exception e) {
e.printStackTrace();
}
DatabaseInterface database = DataHandler.connectionMap.get(connectionBox.getSelectedItem());
Object accessKey = accessBox.getSelectedItem();
int access = DatabaseMeta.getAccessType((String) accessKey);
String fragment = null;
DataHandler dataHandler = null;
try {
dataHandler = (DataHandler) xulDomContainer.getEventHandler("dataHandler");
dataHandler.pushCache();
} catch (XulException e) {
// TODO not a critical function, but should log a problem...
}
switch(access) {
case DatabaseMeta.TYPE_ACCESS_JNDI:
fragment = getFragment(database, databaseName, "_jndi.xul", "common_jndi.xul");
break;
case DatabaseMeta.TYPE_ACCESS_NATIVE:
fragment = getFragment(database, databaseName, "_native.xul", "common_native.xul");
break;
case DatabaseMeta.TYPE_ACCESS_OCI:
fragment = getFragment(database, databaseName, "_oci.xul", "common_native.xul");
break;
case DatabaseMeta.TYPE_ACCESS_ODBC:
fragment = getFragment(database, databaseName, "_odbc.xul", "common_odbc.xul");
break;
case DatabaseMeta.TYPE_ACCESS_PLUGIN:
fragment = getFragment(database, databaseName, "_plugin.xul", "common_native.xul");
break;
default:
break;
}
try {
loadDatabaseOptionsFragment(fragment.toLowerCase());
} catch (XulException e) {
// TODO should be reporting as an error dialog; need error dialog in XUL framework
showMessage(Messages.getString("FragmentHandler.USER.CANT_LOAD_OPTIONS", databaseName));
}
XulTextbox portBox = (XulTextbox) document.getElementById("port-number-text");
if (portBox != null) {
int port = database.getDefaultDatabasePort();
if (port > 0) {
portBox.setValue(Integer.toString(port));
}
}
if (dataHandler != null) {
dataHandler.popCache();
}
}
use of org.pentaho.ui.xul.components.XulTextbox in project pentaho-kettle by pentaho.
the class DataOverrideHandler method getControls.
@Override
protected void getControls() {
super.getControls();
XulTextbox[] boxes = new XulTextbox[] { hostNameBox, databaseNameBox, portNumberBox, userNameBox, passwordBox, customDriverClassBox, customUrlBox, dataTablespaceBox, indexTablespaceBox, poolSizeBox, maxPoolSizeBox, languageBox, systemNumberBox, clientBox, serverInstanceBox, warehouseBox };
for (int i = 0; i < boxes.length; i++) {
XulTextbox xulTextbox = boxes[i];
if ((xulTextbox != null) && (xulTextbox instanceof ExtTextbox)) {
ExtTextbox ext = (ExtTextbox) xulTextbox;
ext.setVariableSpace(databaseMeta);
}
}
XulTree[] trees = new XulTree[] { poolParameterTree, clusterParameterTree, optionsParameterTree };
for (int i = 0; i < trees.length; i++) {
XulTree xulTree = trees[i];
if (xulTree != null) {
xulTree.setData(databaseMeta);
}
}
XulMenuList[] menus = new XulMenuList[] { namedClusterList };
for (int i = 0; i < menus.length; i++) {
XulMenuList xulMenu = menus[i];
if (xulMenu != null && xulMenu instanceof ExtMenuList) {
ExtMenuList ext = (ExtMenuList) xulMenu;
ext.setVariableSpace(databaseMeta);
}
}
}
use of org.pentaho.ui.xul.components.XulTextbox in project pentaho-kettle by pentaho.
the class AuthProviderController method browse.
public void browse() {
try {
XulTextbox filename = (XulTextbox) document.getElementById("keytab");
XulFileDialog dialog = (XulFileDialog) document.createElement("filedialog");
XulFileDialog.RETURN_CODE retval = dialog.showOpenDialog();
if (retval == XulFileDialog.RETURN_CODE.OK) {
File file = (File) dialog.getFile();
filename.setValue(file.getAbsolutePath());
}
} catch (XulException e) {
log.logError(resourceBundle.getString("error.file_browse"), e);
}
}
use of org.pentaho.ui.xul.components.XulTextbox in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceTestController method bindOptImpactInfo.
private void bindOptImpactInfo(BindingFactory bindingFactory) {
XulTextbox maxRows = (XulTextbox) document.getElementById("optimization-impact-info");
bindingFactory.setBindingType(Binding.Type.ONE_WAY);
Binding binding = bindingFactory.createBinding(model, "optimizationImpactDescription", maxRows, "value");
binding.initialize();
}
use of org.pentaho.ui.xul.components.XulTextbox in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceTestController method bindStreamingWindowParameters.
private void bindStreamingWindowParameters(BindingFactory bindingFactory) {
XulGroupbox streamingGroupBox = (XulGroupbox) document.getElementById("streaming-groupbox");
streamingGroupBox.setVisible(dataService.isStreaming());
XulRadio timeBasedRadio = (XulRadio) document.getElementById("time-based-radio");
XulRadio rowBasedRadio = (XulRadio) document.getElementById("row-based-radio");
XulTextbox sizeTextBox = (XulTextbox) document.getElementById("window-size");
XulTextbox everyTextBox = (XulTextbox) document.getElementById("window-every");
XulTextbox limitTextBox = (XulTextbox) document.getElementById("window-limit");
XulLabel sizeTimeUnitLabel = (XulLabel) document.getElementById("window-size-time-unit");
XulLabel everyTimeUnitLabel = (XulLabel) document.getElementById("window-every-time-unit");
XulLabel limitTimeUnitLabel = (XulLabel) document.getElementById("window-limit-time-unit");
XulLabel sizeRowUnitLabel = (XulLabel) document.getElementById("window-size-row-unit");
XulLabel everyRowUnitLabel = (XulLabel) document.getElementById("window-every-row-unit");
XulLabel limitRowUnitLabel = (XulLabel) document.getElementById("window-limit-row-unit");
model.setWindowMode(IDataServiceClientService.StreamingMode.TIME_BASED);
timeBasedRadio.setSelected(true);
rowBasedRadio.setSelected(false);
sizeTimeUnitLabel.setVisible(true);
everyTimeUnitLabel.setVisible(true);
limitTimeUnitLabel.setVisible(false);
sizeRowUnitLabel.setVisible(false);
everyRowUnitLabel.setVisible(false);
limitRowUnitLabel.setVisible(true);
sizeTextBox.setValue("");
everyTextBox.setValue("");
limitTextBox.setValue("");
bindingFactory.setBindingType(Binding.Type.BI_DIRECTIONAL);
bindingFactory.createBinding(model, "windowSize", sizeTextBox, "value", BindingConverters.longToStringEmptyZero());
bindingFactory.createBinding(model, "windowEvery", everyTextBox, "value", BindingConverters.longToStringEmptyZero());
bindingFactory.createBinding(model, "windowLimit", limitTextBox, "value", BindingConverters.longToStringEmptyZero());
bindingFactory.createBinding(timeBasedRadio, "selected", sizeTimeUnitLabel, "visible");
bindingFactory.createBinding(timeBasedRadio, "selected", everyTimeUnitLabel, "visible");
bindingFactory.createBinding(timeBasedRadio, "!selected", limitTimeUnitLabel, "visible");
bindingFactory.createBinding(timeBasedRadio, "!selected", sizeRowUnitLabel, "visible");
bindingFactory.createBinding(timeBasedRadio, "!selected", everyRowUnitLabel, "visible");
bindingFactory.createBinding(timeBasedRadio, "selected", limitRowUnitLabel, "visible");
bindingFactory.createBinding(rowBasedRadio, "!selected", sizeTimeUnitLabel, "visible");
bindingFactory.createBinding(rowBasedRadio, "!selected", everyTimeUnitLabel, "visible");
bindingFactory.createBinding(rowBasedRadio, "selected", limitTimeUnitLabel, "visible");
bindingFactory.createBinding(rowBasedRadio, "selected", sizeRowUnitLabel, "visible");
bindingFactory.createBinding(rowBasedRadio, "selected", everyRowUnitLabel, "visible");
bindingFactory.createBinding(rowBasedRadio, "!selected", limitRowUnitLabel, "visible");
}
Aggregations