Search in sources :

Example 11 with TableItemInsertListener

use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.

the class StringOperationsDialog method get.

private void get() {
    try {
        RowMetaInterface r = transMeta.getPrevStepFields(stepname);
        if (r != null) {
            TableItemInsertListener listener = new TableItemInsertListener() {

                public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
                    if (v.getType() == ValueMetaInterface.TYPE_STRING) {
                        // Only process strings
                        tableItem.setText(3, BaseMessages.getString(PKG, "StringOperationsMeta.TrimType.None"));
                        tableItem.setText(4, BaseMessages.getString(PKG, "StringOperationsMeta.LowerUpper.None"));
                        tableItem.setText(5, BaseMessages.getString(PKG, "StringOperationsMeta.Padding.None"));
                        tableItem.setText(8, BaseMessages.getString(PKG, "System.Combo.No"));
                        tableItem.setText(9, BaseMessages.getString(PKG, "StringOperationsMeta.MaskXML.None"));
                        tableItem.setText(10, BaseMessages.getString(PKG, "StringOperationsMeta.Digits.None"));
                        tableItem.setText(11, BaseMessages.getString(PKG, "StringOperationsMeta.RemoveSpecialCharacters.None"));
                        return true;
                    } else {
                        return false;
                    }
                }
            };
            BaseStepDialog.getFieldsFromPrevious(r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, listener);
        }
    } catch (KettleException ke) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "StringOperationsDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "StringOperationsDialog.FailedToGetFields.DialogMessage"), ke);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TableItemInsertListener(org.pentaho.di.ui.trans.step.TableItemInsertListener) TableItem(org.eclipse.swt.widgets.TableItem) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 12 with TableItemInsertListener

use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.

the class SynchronizeAfterMergeDialog method get.

private void get() {
    try {
        RowMetaInterface r = transMeta.getPrevStepFields(stepname);
        if (r != null) {
            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, "SynchronizeAfterMergeDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.FailedToGetFields.DialogMessage"), ke);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TableItemInsertListener(org.pentaho.di.ui.trans.step.TableItemInsertListener) TableItem(org.eclipse.swt.widgets.TableItem) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 13 with TableItemInsertListener

use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.

the class SynchronizeAfterMergeDialog 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, "Y");
                    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, "SynchronizeAfterMergeDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.FailedToGetFields.DialogMessage"), ke);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TableItemInsertListener(org.pentaho.di.ui.trans.step.TableItemInsertListener) TableItem(org.eclipse.swt.widgets.TableItem) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 14 with TableItemInsertListener

use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.

the class ReplaceStringDialog method get.

private void get() {
    try {
        RowMetaInterface r = transMeta.getPrevStepFields(stepname);
        if (r != null) {
            TableItemInsertListener listener = new TableItemInsertListener() {

                public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
                    if (v.getType() == ValueMetaInterface.TYPE_STRING) {
                        // Only process strings
                        tableItem.setText(3, BaseMessages.getString(PKG, "System.Combo.No"));
                        tableItem.setText(6, BaseMessages.getString(PKG, "System.Combo.No"));
                        tableItem.setText(8, BaseMessages.getString(PKG, "System.Combo.No"));
                        tableItem.setText(9, BaseMessages.getString(PKG, "System.Combo.No"));
                        tableItem.setText(10, BaseMessages.getString(PKG, "System.Combo.No"));
                        return true;
                    } else {
                        return false;
                    }
                }
            };
            BaseStepDialog.getFieldsFromPrevious(r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, listener);
        }
    } catch (KettleException ke) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "ReplaceStringDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "ReplaceStringDialog.FailedToGetFields.DialogMessage"), ke);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TableItemInsertListener(org.pentaho.di.ui.trans.step.TableItemInsertListener) TableItem(org.eclipse.swt.widgets.TableItem) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 15 with TableItemInsertListener

use of org.pentaho.di.ui.trans.step.TableItemInsertListener in project pentaho-kettle by pentaho.

the class DatabaseLookupDialog 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, "DatabaseLookupDialog.GetFieldsFailed.DialogTitle"), BaseMessages.getString(PKG, "DatabaseLookupDialog.GetFieldsFailed.DialogMessage"), ke);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) TableItemInsertListener(org.pentaho.di.ui.trans.step.TableItemInsertListener) TableItem(org.eclipse.swt.widgets.TableItem) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

TableItem (org.eclipse.swt.widgets.TableItem)43 KettleException (org.pentaho.di.core.exception.KettleException)43 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)43 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)43 TableItemInsertListener (org.pentaho.di.ui.trans.step.TableItemInsertListener)43 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)42 Point (org.eclipse.swt.graphics.Point)4 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)3 Cursor (org.eclipse.swt.graphics.Cursor)2 MessageBox (org.eclipse.swt.widgets.MessageBox)2 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)2 FileDialog (org.eclipse.swt.widgets.FileDialog)1 Table (org.eclipse.swt.widgets.Table)1 Database (org.pentaho.di.core.database.Database)1 SAPR3DatabaseMeta (org.pentaho.di.core.database.sap.SAPR3DatabaseMeta)1 RowMeta (org.pentaho.di.core.row.RowMeta)1 SAPConnection (org.pentaho.di.trans.steps.sapinput.sap.SAPConnection)1 SAPField (org.pentaho.di.trans.steps.sapinput.sap.SAPField)1 SAPFunctionSignature (org.pentaho.di.trans.steps.sapinput.sap.SAPFunctionSignature)1 MasterReport (org.pentaho.reporting.engine.classic.core.MasterReport)1