private void ok() { if (Const.isEmpty(wStepname.getText())) { return; } List<StreamInterface> infoStreams = input.getStepIOMeta().getInfoStreams(); infoStreams.get(0).setStepMeta(transMeta.findStep(wReference.getText())); infoStreams.get(1).setStepMeta(transMeta.findStep(wCompare.getText())); input.setFlagField(wFlagfield.getText()); int nrKeys = wKeys.nrNonEmpty(); int nrValues = wValues.nrNonEmpty(); input.allocate(nrKeys, nrValues); // CHECKSTYLE:Indentation:OFF for (int i = 0; i < nrKeys; i++) { TableItem item = wKeys.getNonEmpty(i); input.getKeyFields()[i] = item.getText(1); } // CHECKSTYLE:Indentation:OFF for (int i = 0; i < nrValues; i++) { TableItem item = wValues.getNonEmpty(i); input.getValueFields()[i] = item.getText(1); } stepname = wStepname.getText(); // return value dispose(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { List<StreamInterface> infoStreams = input.getStepIOMeta().getInfoStreams(); wReference.setText(Const.NVL(infoStreams.get(0).getStepname(), "")); wCompare.setText(Const.NVL(infoStreams.get(1).getStepname(), "")); if (input.getFlagField() != null) { wFlagfield.setText(input.getFlagField()); } for (int i = 0; i < input.getKeyFields().length; i++) { TableItem item = wKeys.table.getItem(i); if (input.getKeyFields()[i] != null) { item.setText(1, input.getKeyFields()[i]); } } for (int i = 0; i < input.getValueFields().length; i++) { TableItem item = wValues.table.getItem(i); if (input.getValueFields()[i] != null) { item.setText(1, input.getValueFields()[i]); } } wStepname.selectAll(); wStepname.setFocus(); }