use of org.pentaho.ui.xul.containers.XulTreeRow in project pentaho-kettle by pentaho.
the class DataHandler method setDefaultPoolParameters.
private void setDefaultPoolParameters() {
if (poolParameterTree != null) {
for (DatabaseConnectionPoolParameter parameter : BaseDatabaseMeta.poolingParameters) {
XulTreeRow row = poolParameterTree.getRootChildren().addNewRow();
row.addCellText(0, "false");
row.addCellText(1, parameter.getParameter());
row.addCellText(2, parameter.getDefaultValue());
}
}
}
use of org.pentaho.ui.xul.containers.XulTreeRow in project pentaho-kettle by pentaho.
the class DataHandler method editOptions.
public void editOptions(int index) {
if (index + 1 == optionsParameterTree.getRows()) {
// editing last row add a new one below
Object[][] values = optionsParameterTree.getValues();
Object[] row = values[values.length - 1];
if (row != null && (!StringUtils.isEmpty((String) row[0]) || !StringUtils.isEmpty((String) row[1]))) {
// acutally have something in current last row
XulTreeRow newRow = optionsParameterTree.getRootChildren().addNewRow();
newRow.addCellText(0, "");
newRow.addCellText(1, "");
}
}
}
use of org.pentaho.ui.xul.containers.XulTreeRow in project pentaho-kettle by pentaho.
the class DataHandler method setClusterData.
private void setClusterData(PartitionDatabaseMeta[] clusterInformation) {
if (clusterParameterTree == null) {
// there's nothing to do
return;
}
clusterParameterTree.getRootChildren().removeAll();
if ((clusterInformation != null) && (clusterParameterTree != null)) {
for (int i = 0; i < clusterInformation.length; i++) {
PartitionDatabaseMeta meta = clusterInformation[i];
XulTreeRow row = clusterParameterTree.getRootChildren().addNewRow();
row.addCellText(0, Const.NVL(meta.getPartitionId(), ""));
row.addCellText(1, Const.NVL(meta.getHostname(), ""));
row.addCellText(2, Const.NVL(meta.getPort(), ""));
row.addCellText(3, Const.NVL(meta.getDatabaseName(), ""));
row.addCellText(4, Const.NVL(meta.getUsername(), ""));
row.addCellText(5, Const.NVL(meta.getPassword(), ""));
}
}
// Add 5 blank rows if none are already there, otherwise, just add one.
int numToAdd = 5;
/*
* if(clusterInformation != null && clusterInformation.length > 0){ numToAdd = 1; }
*/
while (numToAdd-- > 0) {
XulTreeRow row = clusterParameterTree.getRootChildren().addNewRow();
// easy way of putting new cells in the row
row.addCellText(0, "");
row.addCellText(1, "");
row.addCellText(2, "");
row.addCellText(3, "");
row.addCellText(4, "");
row.addCellText(5, "");
}
}
use of org.pentaho.ui.xul.containers.XulTreeRow in project pentaho-kettle by pentaho.
the class DataHandler method poolingRowChange.
public void poolingRowChange(int idx) {
if (idx != -1) {
if (idx >= BaseDatabaseMeta.poolingParameters.length) {
idx = BaseDatabaseMeta.poolingParameters.length - 1;
}
if (idx < 0) {
idx = 0;
}
poolingDescription.setValue(BaseDatabaseMeta.poolingParameters[idx].getDescription());
XulTreeRow row = poolParameterTree.getRootChildren().getItem(idx).getRow();
if (row.getSelectedColumnIndex() == 2) {
row.addCellText(0, "true");
}
}
}
use of org.pentaho.ui.xul.containers.XulTreeRow in project pentaho-kettle by pentaho.
the class DataHandler method setOptionsData.
private void setOptionsData(Map<String, String> extraOptions) {
if (optionsParameterTree == null) {
return;
}
if (extraOptions != null) {
removeTypedOptions(extraOptions);
Iterator<String> keys = extraOptions.keySet().iterator();
Object connection = connectionBox.getSelectedItem();
String currentType = null;
if (connection != null) {
currentType = connectionMap.get(connection.toString()).getPluginId();
}
while (keys.hasNext()) {
String parameter = keys.next();
String value = extraOptions.get(parameter);
if ((value == null) || (value.trim().length() <= 0) || (value.equals(DatabaseMeta.EMPTY_OPTIONS_STRING))) {
value = "";
}
// If the parameter starts with a database type code we show it in the options, otherwise we don't.
// For example MySQL.defaultFetchSize
//
int dotIndex = parameter.indexOf('.');
if (dotIndex >= 0) {
String parameterOption = parameter.substring(dotIndex + 1);
String databaseTypeString = parameter.substring(0, dotIndex);
String databaseType = databaseTypeString;
if (currentType != null && currentType.equals(databaseType)) {
XulTreeRow row = optionsParameterTree.getRootChildren().addNewRow();
row.addCellText(0, parameterOption);
row.addCellText(1, value);
}
}
}
}
// Have at least 5 option rows, with at least one blank
int numToAdd = 15;
int numSet = optionsParameterTree.getRootChildren().getItemCount();
if (numSet < numToAdd) {
numToAdd -= numSet;
} else {
numToAdd = 1;
}
while (numToAdd-- > 0) {
XulTreeRow row = optionsParameterTree.getRootChildren().addNewRow();
// easy way of putting new cells in the row
row.addCellText(0, "");
row.addCellText(1, "");
}
}
Aggregations