Search in sources :

Example 1 with EnterMappingDialog

use of org.pentaho.di.ui.core.dialog.EnterMappingDialog in project pentaho-kettle by pentaho.

the class BaseStepDialog method generateFieldMapping.

/**
 * Create a new field mapping between source and target steps.
 *
 * @param shell        the shell of the parent window
 * @param sourceFields the source fields
 * @param targetFields the target fields
 * @param fieldMapping the list of source to target mappings to default to (can be empty but not null)
 * @throws KettleException in case something goes wrong during the field mapping
 */
public static final void generateFieldMapping(Shell shell, RowMetaInterface sourceFields, RowMetaInterface targetFields, List<SourceToTargetMapping> fieldMapping) throws KettleException {
    // Build the mapping: let the user decide!!
    String[] source = sourceFields.getFieldNames();
    for (int i = 0; i < source.length; i++) {
        ValueMetaInterface v = sourceFields.getValueMeta(i);
        source[i] += EnterMappingDialog.STRING_ORIGIN_SEPARATOR + v.getOrigin() + ")";
    }
    String[] target = targetFields.getFieldNames();
    EnterMappingDialog dialog = new EnterMappingDialog(shell, source, target, fieldMapping);
    List<SourceToTargetMapping> newMapping = dialog.open();
    if (newMapping != null) {
        fieldMapping.clear();
        fieldMapping.addAll(newMapping);
    }
}
Also used : EnterMappingDialog(org.pentaho.di.ui.core.dialog.EnterMappingDialog) SourceToTargetMapping(org.pentaho.di.core.SourceToTargetMapping) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 2 with EnterMappingDialog

use of org.pentaho.di.ui.core.dialog.EnterMappingDialog in project pentaho-kettle by pentaho.

the class SelectValuesDialog method generateMappings.

/**
 * Reads in the fields from the previous steps and from the ONE next step and opens an EnterMappingDialog with this
 * information. After the user did the mapping, those information is put into the Select/Rename table.
 */
private void generateMappings() {
    if (!bPreviousFieldsLoaded) {
        MessageDialog.openError(shell, BaseMessages.getString(PKG, "SelectValuesDialog.ColumnInfo.Loading"), BaseMessages.getString(PKG, "SelectValuesDialog.ColumnInfo.Loading"));
        return;
    }
    if ((wRemove.getItemCount() > 0) || (wMeta.getItemCount() > 0)) {
        for (int i = 0; i < wRemove.getItemCount(); i++) {
            String[] columns = wRemove.getItem(i);
            for (int a = 0; a < columns.length; a++) {
                if (columns[a].length() > 0) {
                    MessageDialog.openError(shell, BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.NoDeletOrMetaTitle"), BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.NoDeletOrMeta"));
                    return;
                }
            }
        }
        for (int i = 0; i < wMeta.getItemCount(); i++) {
            String[] columns = wMeta.getItem(i);
            for (int a = 0; a < columns.length; a++) {
                String col = columns[a];
                if (col.length() > 0) {
                    MessageDialog.openError(shell, BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.NoDeletOrMetaTitle"), BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.NoDeletOrMeta"));
                    return;
                }
            }
        }
    }
    RowMetaInterface nextStepRequiredFields = null;
    StepMeta stepMeta = new StepMeta(stepname, input);
    List<StepMeta> nextSteps = transMeta.findNextSteps(stepMeta);
    if (nextSteps.size() == 0 || nextSteps.size() > 1) {
        MessageDialog.openError(shell, BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.NoNextStepTitle"), BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.NoNextStep"));
        return;
    }
    StepMeta outputStepMeta = nextSteps.get(0);
    StepMetaInterface stepMetaInterface = outputStepMeta.getStepMetaInterface();
    try {
        nextStepRequiredFields = stepMetaInterface.getRequiredFields(transMeta);
    } catch (KettleException e) {
        logError(BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.UnableToFindOutput"));
        nextStepRequiredFields = new RowMeta();
    }
    String[] inputNames = new String[prevFields.size()];
    for (int i = 0; i < prevFields.size(); i++) {
        ValueMetaInterface value = prevFields.getValueMeta(i);
        inputNames[i] = value.getName() + EnterMappingDialog.STRING_ORIGIN_SEPARATOR + value.getOrigin() + ")";
    }
    String[] outputNames = new String[nextStepRequiredFields.size()];
    for (int i = 0; i < nextStepRequiredFields.size(); i++) {
        outputNames[i] = nextStepRequiredFields.getValueMeta(i).getName();
    }
    String[] selectName = new String[wFields.getItemCount()];
    String[] selectRename = new String[wFields.getItemCount()];
    for (int i = 0; i < wFields.getItemCount(); i++) {
        selectName[i] = wFields.getItem(i, 1);
        selectRename[i] = wFields.getItem(i, 2);
    }
    List<SourceToTargetMapping> mappings = new ArrayList<SourceToTargetMapping>();
    StringBuilder missingFields = new StringBuilder();
    for (int i = 0; i < selectName.length; i++) {
        String valueName = selectName[i];
        String valueRename = selectRename[i];
        int inIndex = prevFields.indexOfValue(valueName);
        if (inIndex < 0) {
            missingFields.append(Const.CR + "   " + valueName + " --> " + valueRename);
            continue;
        }
        if (null == valueRename || valueRename.equals("")) {
            valueRename = valueName;
        }
        int outIndex = nextStepRequiredFields.indexOfValue(valueRename);
        if (outIndex < 0) {
            missingFields.append(Const.CR + "   " + valueName + " --> " + valueRename);
            continue;
        }
        SourceToTargetMapping mapping = new SourceToTargetMapping(inIndex, outIndex);
        mappings.add(mapping);
    }
    // show a confirm dialog if some misconfiguration was found
    if (missingFields.length() > 0) {
        MessageDialog.setDefaultImage(GUIResource.getInstance().getImageSpoon());
        boolean goOn = MessageDialog.openConfirm(shell, BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.SomeFieldsNotFoundTitle"), BaseMessages.getString(PKG, "SelectValuesDialog.DoMapping.SomeFieldsNotFound", missingFields.toString()));
        if (!goOn) {
            return;
        }
    }
    EnterMappingDialog d = new EnterMappingDialog(SelectValuesDialog.this.shell, inputNames, outputNames, mappings);
    mappings = d.open();
    // 
    if (mappings != null) {
        wFields.table.removeAll();
        wFields.table.setItemCount(mappings.size());
        for (int i = 0; i < mappings.size(); i++) {
            SourceToTargetMapping mapping = mappings.get(i);
            TableItem item = wFields.table.getItem(i);
            item.setText(1, prevFields.getValueMeta(mapping.getSourcePosition()).getName());
            item.setText(2, outputNames[mapping.getTargetPosition()]);
        }
        wFields.setRowNums();
        wFields.optWidth(true);
        wTabFolder.setSelection(0);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) RowMeta(org.pentaho.di.core.row.RowMeta) EnterMappingDialog(org.pentaho.di.ui.core.dialog.EnterMappingDialog) TableItem(org.eclipse.swt.widgets.TableItem) StepMetaInterface(org.pentaho.di.trans.step.StepMetaInterface) ArrayList(java.util.ArrayList) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) StepMeta(org.pentaho.di.trans.step.StepMeta) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface) SourceToTargetMapping(org.pentaho.di.core.SourceToTargetMapping)

Example 3 with EnterMappingDialog

use of org.pentaho.di.ui.core.dialog.EnterMappingDialog in project pentaho-kettle by pentaho.

the class SimpleMappingDialog method addMappingDefinitionTab.

private void addMappingDefinitionTab(final MappingIODefinition definition, int index, final String tabTitle, final String tabTooltip, String sourceColumnLabel, String targetColumnLabel, final boolean input) {
    final CTabItem wTab;
    if (index >= wTabFolder.getItemCount()) {
        wTab = new CTabItem(wTabFolder, SWT.CLOSE);
    } else {
        wTab = new CTabItem(wTabFolder, SWT.CLOSE, index);
    }
    setMappingDefinitionTabNameAndToolTip(wTab, tabTitle, tabTooltip, definition, input);
    Composite wInputComposite = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wInputComposite);
    FormLayout tabLayout = new FormLayout();
    tabLayout.marginWidth = 15;
    tabLayout.marginHeight = 15;
    wInputComposite.setLayout(tabLayout);
    // Now add a table view with the 2 columns to specify: input and output
    // fields for the source and target steps.
    // 
    final Button wbEnterMapping = new Button(wInputComposite, SWT.PUSH);
    props.setLook(wbEnterMapping);
    if (input) {
        wbEnterMapping.setText(BaseMessages.getString(PKG, "SimpleMappingDialog.button.EnterMapping"));
    } else {
        wbEnterMapping.setText(BaseMessages.getString(PKG, "SimpleMappingDialog.button.GetFields"));
    }
    FormData fdbEnterMapping = new FormData();
    fdbEnterMapping.bottom = new FormAttachment(100);
    fdbEnterMapping.right = new FormAttachment(100);
    wbEnterMapping.setLayoutData(fdbEnterMapping);
    ColumnInfo[] colinfo = new ColumnInfo[] { new ColumnInfo(sourceColumnLabel, ColumnInfo.COLUMN_TYPE_TEXT, false, false), new ColumnInfo(targetColumnLabel, ColumnInfo.COLUMN_TYPE_TEXT, false, false) };
    final TableView wFieldMappings = new TableView(transMeta, wInputComposite, SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER, colinfo, 1, false, lsMod, props, false);
    props.setLook(wFieldMappings);
    FormData fdMappings = new FormData();
    fdMappings.left = new FormAttachment(0);
    fdMappings.right = new FormAttachment(100);
    fdMappings.top = new FormAttachment(0);
    fdMappings.bottom = new FormAttachment(wbEnterMapping, -10);
    wFieldMappings.setLayoutData(fdMappings);
    wFieldMappings.getTable().addListener(SWT.Resize, new ColumnsResizer(0, 50, 50));
    for (MappingValueRename valueRename : definition.getValueRenames()) {
        TableItem tableItem = new TableItem(wFieldMappings.table, SWT.NONE);
        tableItem.setText(1, Const.NVL(valueRename.getSourceValueName(), ""));
        tableItem.setText(2, Const.NVL(valueRename.getTargetValueName(), ""));
    }
    wFieldMappings.removeEmptyRows();
    wFieldMappings.setRowNums();
    wFieldMappings.optWidth(true);
    wbEnterMapping.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent arg0) {
            try {
                if (input) {
                    // INPUT
                    // 
                    RowMetaInterface sourceRowMeta = getFieldsFromStep(true, input);
                    RowMetaInterface targetRowMeta = getFieldsFromStep(false, input);
                    String[] sourceFields = sourceRowMeta.getFieldNames();
                    String[] targetFields = targetRowMeta.getFieldNames();
                    EnterMappingDialog dialog = new EnterMappingDialog(shell, sourceFields, targetFields);
                    List<SourceToTargetMapping> mappings = dialog.open();
                    if (mappings != null) {
                        // first clear the dialog...
                        wFieldMappings.clearAll(false);
                        // 
                        definition.getValueRenames().clear();
                        // Now add the new values...
                        for (int i = 0; i < mappings.size(); i++) {
                            SourceToTargetMapping mapping = mappings.get(i);
                            TableItem item = new TableItem(wFieldMappings.table, SWT.NONE);
                            item.setText(1, mapping.getSourceString(sourceFields));
                            item.setText(2, mapping.getTargetString(targetFields));
                            String source = input ? item.getText(1) : item.getText(2);
                            String target = input ? item.getText(2) : item.getText(1);
                            definition.getValueRenames().add(new MappingValueRename(source, target));
                        }
                        wFieldMappings.removeEmptyRows();
                        wFieldMappings.setRowNums();
                        wFieldMappings.optWidth(true);
                    }
                } else {
                    // OUTPUT
                    // 
                    RowMetaInterface sourceRowMeta = getFieldsFromStep(true, input);
                    BaseStepDialog.getFieldsFromPrevious(sourceRowMeta, wFieldMappings, 1, new int[] { 1 }, new int[] {}, -1, -1, null);
                }
            } catch (KettleException e) {
                new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "SimpleMappingDialog.Exception.ErrorGettingMappingSourceAndTargetFields", e.toString()), e);
            }
        }
    });
    if (input) {
        Button wRenameOutput = new Button(wInputComposite, SWT.CHECK);
        props.setLook(wRenameOutput);
        wRenameOutput.setText(BaseMessages.getString(PKG, "SimpleMappingDialog.input.RenamingOnOutput"));
        FormData fdRenameOutput = new FormData();
        fdRenameOutput.top = new FormAttachment(wFieldMappings, 10);
        fdRenameOutput.left = new FormAttachment(0, 0);
        wRenameOutput.setLayoutData(fdRenameOutput);
        wRenameOutput.setSelection(definition.isRenamingOnOutput());
        wRenameOutput.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent event) {
                // flip the switch
                definition.setRenamingOnOutput(!definition.isRenamingOnOutput());
            }
        });
    }
    FormData fdParametersComposite = new FormData();
    fdParametersComposite.left = new FormAttachment(0, 0);
    fdParametersComposite.top = new FormAttachment(0, 0);
    fdParametersComposite.right = new FormAttachment(100, 0);
    fdParametersComposite.bottom = new FormAttachment(100, 0);
    wInputComposite.setLayoutData(fdParametersComposite);
    wInputComposite.layout();
    wTab.setControl(wInputComposite);
    final ApplyChanges applyChanges = new MappingDefinitionTab(definition, wFieldMappings);
    changeList.add(applyChanges);
    wTabFolder.setSelection(wTab);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) MappingValueRename(org.pentaho.di.trans.steps.mapping.MappingValueRename) KettleException(org.pentaho.di.core.exception.KettleException) Composite(org.eclipse.swt.widgets.Composite) ColumnsResizer(org.pentaho.di.ui.core.widget.ColumnsResizer) EnterMappingDialog(org.pentaho.di.ui.core.dialog.EnterMappingDialog) TableItem(org.eclipse.swt.widgets.TableItem) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ColumnInfo(org.pentaho.di.ui.core.widget.ColumnInfo) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) CTabItem(org.eclipse.swt.custom.CTabItem) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SourceToTargetMapping(org.pentaho.di.core.SourceToTargetMapping) List(java.util.List) ArrayList(java.util.ArrayList) FormAttachment(org.eclipse.swt.layout.FormAttachment) TableView(org.pentaho.di.ui.core.widget.TableView)

Example 4 with EnterMappingDialog

use of org.pentaho.di.ui.core.dialog.EnterMappingDialog in project pentaho-kettle by pentaho.

the class TableOutputDialog method generateMappings.

/**
 * Reads in the fields from the previous steps and from the ONE next step and opens an EnterMappingDialog with this
 * information. After the user did the mapping, those information is put into the Select/Rename table.
 */
private void generateMappings() {
    // Determine the source and target fields...
    // 
    RowMetaInterface sourceFields;
    RowMetaInterface targetFields;
    try {
        sourceFields = transMeta.getPrevStepFields(stepMeta);
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.UnableToFindSourceFields.Title"), BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.UnableToFindSourceFields.Message"), e);
        return;
    }
    // refresh data
    input.setDatabaseMeta(transMeta.findDatabase(wConnection.getText()));
    input.setTableName(transMeta.environmentSubstitute(wTable.getText()));
    StepMetaInterface stepMetaInterface = stepMeta.getStepMetaInterface();
    try {
        targetFields = stepMetaInterface.getRequiredFields(transMeta);
    } catch (KettleException e) {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.UnableToFindTargetFields.Title"), BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.UnableToFindTargetFields.Message"), e);
        return;
    }
    String[] inputNames = new String[sourceFields.size()];
    for (int i = 0; i < sourceFields.size(); i++) {
        ValueMetaInterface value = sourceFields.getValueMeta(i);
        inputNames[i] = value.getName() + EnterMappingDialog.STRING_ORIGIN_SEPARATOR + value.getOrigin() + ")";
    }
    // Create the existing mapping list...
    // 
    List<SourceToTargetMapping> mappings = new ArrayList<SourceToTargetMapping>();
    StringBuilder missingSourceFields = new StringBuilder();
    StringBuilder missingTargetFields = new StringBuilder();
    int nrFields = wFields.nrNonEmpty();
    for (int i = 0; i < nrFields; i++) {
        TableItem item = wFields.getNonEmpty(i);
        String source = item.getText(2);
        String target = item.getText(1);
        int sourceIndex = sourceFields.indexOfValue(source);
        if (sourceIndex < 0) {
            missingSourceFields.append(Const.CR).append("   ").append(source).append(" --> ").append(target);
        }
        int targetIndex = targetFields.indexOfValue(target);
        if (targetIndex < 0) {
            missingTargetFields.append(Const.CR).append("   ").append(source).append(" --> ").append(target);
        }
        if (sourceIndex < 0 || targetIndex < 0) {
            continue;
        }
        SourceToTargetMapping mapping = new SourceToTargetMapping(sourceIndex, targetIndex);
        mappings.add(mapping);
    }
    // 
    if (missingSourceFields.length() > 0 || missingTargetFields.length() > 0) {
        String message = "";
        if (missingSourceFields.length() > 0) {
            message += BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.SomeSourceFieldsNotFound", missingSourceFields.toString()) + Const.CR;
        }
        if (missingTargetFields.length() > 0) {
            message += BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.SomeTargetFieldsNotFound", missingSourceFields.toString()) + Const.CR;
        }
        message += Const.CR;
        message += BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.SomeFieldsNotFoundContinue") + Const.CR;
        MessageDialog.setDefaultImage(GUIResource.getInstance().getImageSpoon());
        boolean goOn = MessageDialog.openConfirm(shell, BaseMessages.getString(PKG, "TableOutputDialog.DoMapping.SomeFieldsNotFoundTitle"), message);
        if (!goOn) {
            return;
        }
    }
    EnterMappingDialog d = new EnterMappingDialog(TableOutputDialog.this.shell, sourceFields.getFieldNames(), targetFields.getFieldNames(), mappings);
    mappings = d.open();
    // 
    if (mappings != null) {
        // Clear and re-populate!
        // 
        wFields.table.removeAll();
        wFields.table.setItemCount(mappings.size());
        for (int i = 0; i < mappings.size(); i++) {
            SourceToTargetMapping mapping = mappings.get(i);
            TableItem item = wFields.table.getItem(i);
            item.setText(2, sourceFields.getValueMeta(mapping.getSourcePosition()).getName());
            item.setText(1, targetFields.getValueMeta(mapping.getTargetPosition()).getName());
        }
        wFields.setRowNums();
        wFields.optWidth(true);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) EnterMappingDialog(org.pentaho.di.ui.core.dialog.EnterMappingDialog) TableItem(org.eclipse.swt.widgets.TableItem) StepMetaInterface(org.pentaho.di.trans.step.StepMetaInterface) ArrayList(java.util.ArrayList) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface) SourceToTargetMapping(org.pentaho.di.core.SourceToTargetMapping)

Example 5 with EnterMappingDialog

use of org.pentaho.di.ui.core.dialog.EnterMappingDialog in project pentaho-kettle by pentaho.

the class TeraFastDialog method generateMappings.

/**
 * Reads in the fields from the previous steps and from the ONE next step and opens an EnterMappingDialog with this
 * information. After the user did the mapping, those information is put into the Select/Rename table.
 */
public void generateMappings() {
    // Determine the source and target fields...
    // 
    RowMetaInterface sourceFields;
    RowMetaInterface targetFields;
    try {
        sourceFields = this.transMeta.getPrevStepFields(this.stepMeta);
    } catch (KettleException e) {
        new ErrorDialog(this.shell, BaseMessages.getString(PKG, "TeraFastDialog.DoMapping.UnableToFindSourceFields.Title"), BaseMessages.getString(PKG, "TeraFastDialog.DoMapping.UnableToFindSourceFields.Message"), e);
        return;
    }
    // refresh fields
    this.meta.getTargetTable().setValue(this.wTable.getText());
    try {
        targetFields = this.meta.getRequiredFields(this.transMeta);
    } catch (KettleException e) {
        new ErrorDialog(this.shell, BaseMessages.getString(PKG, "TeraFastDialog.DoMapping.UnableToFindTargetFields.Title"), BaseMessages.getString(PKG, "TeraFastDialog.DoMapping.UnableToFindTargetFields.Message"), e);
        return;
    }
    String[] inputNames = new String[sourceFields.size()];
    for (int i = 0; i < sourceFields.size(); i++) {
        ValueMetaInterface value = sourceFields.getValueMeta(i);
        inputNames[i] = value.getName() + EnterMappingDialog.STRING_ORIGIN_SEPARATOR + value.getOrigin() + ")";
    }
    // Create the existing mapping list...
    // 
    List<SourceToTargetMapping> mappings = new ArrayList<SourceToTargetMapping>();
    StringBuilder missingSourceFields = new StringBuilder();
    StringBuilder missingTargetFields = new StringBuilder();
    int nrFields = this.wReturn.nrNonEmpty();
    for (int i = 0; i < nrFields; i++) {
        TableItem item = this.wReturn.getNonEmpty(i);
        String source = item.getText(2);
        String target = item.getText(1);
        int sourceIndex = sourceFields.indexOfValue(source);
        if (sourceIndex < 0) {
            missingSourceFields.append(Const.CR + "   " + source + " --> " + target);
        }
        int targetIndex = targetFields.indexOfValue(target);
        if (targetIndex < 0) {
            missingTargetFields.append(Const.CR + "   " + source + " --> " + target);
        }
        if (sourceIndex < 0 || targetIndex < 0) {
            continue;
        }
        SourceToTargetMapping mapping = new SourceToTargetMapping(sourceIndex, targetIndex);
        mappings.add(mapping);
    }
    EnterMappingDialog d = new EnterMappingDialog(TeraFastDialog.this.shell, sourceFields.getFieldNames(), targetFields.getFieldNames(), mappings);
    mappings = d.open();
    // 
    if (mappings != null) {
        // Clear and re-populate!
        // 
        this.wReturn.table.removeAll();
        this.wReturn.table.setItemCount(mappings.size());
        for (int i = 0; i < mappings.size(); i++) {
            SourceToTargetMapping mapping = mappings.get(i);
            TableItem item = this.wReturn.table.getItem(i);
            item.setText(2, sourceFields.getValueMeta(mapping.getSourcePosition()).getName());
            item.setText(1, targetFields.getValueMeta(mapping.getTargetPosition()).getName());
        }
        this.wReturn.setRowNums();
        this.wReturn.optWidth(true);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) EnterMappingDialog(org.pentaho.di.ui.core.dialog.EnterMappingDialog) TableItem(org.eclipse.swt.widgets.TableItem) ArrayList(java.util.ArrayList) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface) SourceToTargetMapping(org.pentaho.di.core.SourceToTargetMapping)

Aggregations

SourceToTargetMapping (org.pentaho.di.core.SourceToTargetMapping)24 EnterMappingDialog (org.pentaho.di.ui.core.dialog.EnterMappingDialog)24 ArrayList (java.util.ArrayList)21 TableItem (org.eclipse.swt.widgets.TableItem)21 KettleException (org.pentaho.di.core.exception.KettleException)21 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)21 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)21 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)20 StepMetaInterface (org.pentaho.di.trans.step.StepMetaInterface)14 RowMeta (org.pentaho.di.core.row.RowMeta)5 ValueMetaNone (org.pentaho.di.core.row.value.ValueMetaNone)3 TableView (org.pentaho.di.ui.core.widget.TableView)3 List (java.util.List)2 CTabItem (org.eclipse.swt.custom.CTabItem)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 FormAttachment (org.eclipse.swt.layout.FormAttachment)2 FormData (org.eclipse.swt.layout.FormData)2 FormLayout (org.eclipse.swt.layout.FormLayout)2 Button (org.eclipse.swt.widgets.Button)2