use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.
the class UpdateDialog method get.
private void get() {
try {
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null && !r.isEmpty()) {
TableItemInsertListener listener = new TableItemInsertListener() {
public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
tableItem.setText(2, "=");
return true;
}
};
BaseStepDialog.getFieldsFromPrevious(r, wKey, 1, new int[] { 1, 3 }, new int[] {}, -1, -1, listener);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "UpdateDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "UpdateDialog.FailedToGetFields.DialogMessage"), ke);
}
}
use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.
the class WriteToLogDialog method get.
private void get() {
try {
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
TableItemInsertListener insertListener = new TableItemInsertListener() {
public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
return true;
}
};
BaseStepDialog.getFieldsFromPrevious(r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke);
}
}
use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.
the class SalesforceUpdateDialog method getUpdate.
private void getUpdate() {
try {
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
TableItemInsertListener listener = new TableItemInsertListener() {
public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
tableItem.setText(3, "N");
return true;
}
};
BaseStepDialog.getFieldsFromPrevious(r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "SalesforceUpdateDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "SalesforceUpdateDialog.FailedToGetFields.DialogMessage"), ke);
}
}
use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.
the class CheckSumDialog method get.
private void get() {
try {
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
TableItemInsertListener insertListener = new TableItemInsertListener() {
@Override
public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
tableItem.setText(2, BaseMessages.getString(PKG, "System.Combo.Yes"));
return true;
}
};
BaseStepDialog.getFieldsFromPrevious(r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke);
}
}
use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.
the class DimensionLookupDialog method getKeys.
/**
* Get the fields from the previous step and use them as "keys". Only get the the fields which are not yet in use as
* key, or in the field table. Also ignore technical key, version, fromdate, todate.
*/
private void getKeys() {
try {
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null && !r.isEmpty()) {
BaseStepDialog.getFieldsFromPrevious(r, wKey, 2, new int[] { 1, 2 }, new int[] { 3 }, -1, -1, new TableItemInsertListener() {
public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
int idx = wKey.indexOfString(v.getName(), 2);
return idx < 0 && !v.getName().equalsIgnoreCase(wTk.getText()) && !v.getName().equalsIgnoreCase(wVersion.getText()) && !v.getName().equalsIgnoreCase(wFromdate.getText()) && !v.getName().equalsIgnoreCase(wTodate.getText());
}
});
Table table = wKey.table;
for (int i = 0; i < r.size(); i++) {
ValueMetaInterface v = r.getValueMeta(i);
int idx = wKey.indexOfString(v.getName(), 2);
int idy = wUpIns.indexOfString(v.getName(), 2);
if (idx < 0 && idy < 0 && !v.getName().equalsIgnoreCase(wTk.getText()) && !v.getName().equalsIgnoreCase(wVersion.getText()) && !v.getName().equalsIgnoreCase(wFromdate.getText()) && !v.getName().equalsIgnoreCase(wTodate.getText())) {
TableItem ti = new TableItem(table, SWT.NONE);
ti.setText(1, v.getName());
ti.setText(2, v.getName());
ti.setText(3, v.getTypeDesc());
}
}
wKey.removeEmptyRows();
wKey.setRowNums();
wKey.optWidth(true);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "DimensionLookupDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "DimensionLookupDialog.FailedToGetFields.DialogMessage"), ke);
}
}
Aggregations