/** Copy information from the meta-data input to the dialog fields. */ public void getData() { logDebug(BaseMessages.getString(PKG, "SapInputDialog.Log.GettingKeyInfo")); // The database connection name... // if (input.getDatabaseMeta() != null) { wConnection.setText(input.getDatabaseMeta().getName()); } else if (transMeta.nrDatabases() == 1) { wConnection.setText(transMeta.getDatabase(0).getName()); } // The name of the function to use // function = input.getFunction(); if (input.getFunction() != null) { wFunction.setText(Const.NVL(input.getFunction().getName(), "")); } // The parameters... // for (int i = 0; i < input.getParameters().size(); i++) { SapParameter parameter = input.getParameters().get(i); TableItem item = wInput.table.getItem(i); int colnr = 1; item.setText(colnr++, Const.NVL(parameter.getFieldName(), "")); item.setText(colnr++, parameter.getSapType().getDescription()); item.setText(colnr++, Const.NVL(parameter.getTableName(), "")); item.setText(colnr++, Const.NVL(parameter.getParameterName(), "")); item.setText(colnr++, ValueMeta.getTypeDesc(parameter.getTargetType())); } wInput.setRowNums(); wInput.optWidth(true); // The parameters... // for (int i = 0; i < input.getOutputFields().size(); i++) { SapOutputField outputField = input.getOutputFields().get(i); TableItem item = wOutput.table.getItem(i); int colnr = 1; item.setText(colnr++, Const.NVL(outputField.getSapFieldName(), "")); item.setText(colnr++, outputField.getSapType().getDescription()); item.setText(colnr++, Const.NVL(outputField.getTableName(), "")); item.setText(colnr++, Const.NVL(outputField.getNewName(), "")); item.setText(colnr++, ValueMeta.getTypeDesc(outputField.getTargetType())); } wOutput.setRowNums(); wOutput.optWidth(true); }
private void fillStoredData() { if (stepname != null) textStepName.setText(stepname); int index = addConnectionLine.indexOf( meta.getDatabaseMeta() != null ? meta.getDatabaseMeta().getName() : ""); if (index >= 0) addConnectionLine.select(index); if (meta.getDimension() != null) { comboDimension.add(meta.getDimension()); comboDimension.select(0); } buttonBaseElementsOnly.setSelection(meta.getBaseElementsOnly()); tableViewFields.table.removeAll(); if (meta.getLevels().size() > 0) { for (PaloDimensionLevel level : meta.getLevels()) { tableViewFields.add( level.getLevelName(), String.valueOf(level.getLevelNumber()), level.getFieldName(), level.getFieldType()); } tableViewFields.setRowNums(); tableViewFields.optWidth(true); } }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { int i; logDebug( BaseMessages.getString(PKG, "LucidDBBulkLoaderDialog.Log.GettingKeyInfo")); // $NON-NLS-1$ wMaxErrors.setText("" + input.getMaxErrors()); // $NON-NLS-1$ if (input.getFieldTable() != null) { for (i = 0; i < input.getFieldTable().length; i++) { TableItem item = wReturn.table.getItem(i); if (input.getFieldTable()[i] != null) item.setText(1, input.getFieldTable()[i]); if (input.getFieldStream()[i] != null) item.setText(2, input.getFieldStream()[i]); item.setText(3, input.getFieldFormatOk()[i] ? "Y" : "N"); } } if (input.getDatabaseMeta() != null) wConnection.setText(input.getDatabaseMeta().getName()); else { if (transMeta.nrDatabases() == 1) { wConnection.setText(transMeta.getDatabase(0).getName()); } } if (input.getSchemaName() != null) wSchema.setText(input.getSchemaName()); if (input.getTableName() != null) wTable.setText(input.getTableName()); if (input.getFifoDirectory() != null) wFifoPath.setText(input.getFifoDirectory()); if (input.getFifoServerName() != null) wFifoServer.setText(input.getFifoServerName()); wStepname.selectAll(); wReturn.setRowNums(); wReturn.optWidth(true); }
public void getInfo(SasInputMeta meta) throws KettleStepException { // copy info to Meta class (input) meta.setAcceptingField(wAccField.getText()); int nrNonEmptyFields = wFields.nrNonEmpty(); meta.getOutputFields().clear(); for (int i = 0; i < nrNonEmptyFields; i++) { TableItem item = wFields.getNonEmpty(i); int colnr = 1; SasInputField field = new SasInputField(); field.setName(item.getText(colnr++)); field.setRename(item.getText(colnr++)); if (Const.isEmpty(field.getRename())) { field.setRename(field.getName()); } field.setType(ValueMeta.getType(item.getText(colnr++))); field.setConversionMask(item.getText(colnr++)); field.setLength(Const.toInt(item.getText(colnr++), -1)); field.setPrecision(Const.toInt(item.getText(colnr++), -1)); field.setDecimalSymbol(item.getText(colnr++)); field.setGroupingSymbol(item.getText(colnr++)); field.setTrimType(ValueMeta.getTrimTypeByDesc(item.getText(colnr++))); meta.getOutputFields().add(field); } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { super.getData(); hasOneTemporalField = ((LoadSatMeta) inputMeta).getFromDateColumn() != null; enableFields(); if (inputMeta.getFields() != null) { for (int i = 0; i < inputMeta.getFields().length; i++) { TableItem item = wKey.table.getItem(i); if (inputMeta.getCols()[i] != null) { item.setText(1, inputMeta.getCols()[i]); } if (inputMeta.getFields()[i] != null) { item.setText(2, inputMeta.getFields()[i]); } if (inputMeta.getTypes()[i] != null) { item.setText(3, inputMeta.getTypes()[i]); } } } if (((LoadSatMeta) inputMeta).getToDateColumn() != null) { wcbToDateCol.setText(((LoadSatMeta) inputMeta).getToDateColumn()); } if (((LoadSatMeta) inputMeta).getToDateMaxFlag() != null) { wToDateMax.setText(((LoadSatMeta) inputMeta).getToDateMaxFlag()); } wbIsIdempotentSat.setSelection(((LoadSatMeta) inputMeta).isIdempotent()); wKey.setRowNums(); wKey.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
private void populateTableWithTupleTemplate() { Table table = m_fieldsView.table; Set<String> existingRowAliases = new HashSet<String>(); for (int i = 0; i < table.getItemCount(); i++) { TableItem tableItem = table.getItem(i); String alias = tableItem.getText(1); if (!Const.isEmpty(alias)) { existingRowAliases.add(alias); } } int choice = 0; if (existingRowAliases.size() > 0) { // Ask what we should do with existing mapping data MessageDialog md = new MessageDialog( m_shell, Messages.getString("MappingDialog.GetFieldsChoice.Title"), null, Messages.getString( "MappingDialog.GetFieldsChoice.Message", "" + existingRowAliases.size(), "" + 5), MessageDialog.WARNING, new String[] { Messages.getString("MappingOutputDialog.ClearAndAdd"), Messages.getString("MappingOutputDialog.Cancel"), }, 0); MessageDialog.setDefaultImage(GUIResource.getInstance().getImageSpoon()); int idx = md.open(); choice = idx & 0xFF; } if (choice == 1 || choice == 255 /* 255 = escape pressed */) { return; // Cancel } m_fieldsView.clearAll(); TableItem item = new TableItem(table, SWT.NONE); item.setText(1, "KEY"); item.setText(2, "Y"); item = new TableItem(table, SWT.NONE); item.setText(1, "Family"); item.setText(2, "N"); item.setText(5, "String"); item = new TableItem(table, SWT.NONE); item.setText(1, "Column"); item.setText(2, "N"); item = new TableItem(table, SWT.NONE); item.setText(1, "Value"); item.setText(2, "N"); item = new TableItem(table, SWT.NONE); item.setText(1, "Timestamp"); item.setText(2, "N"); item.setText(5, "Long"); m_fieldsView.removeEmptyRows(); m_fieldsView.setRowNums(); m_fieldsView.optWidth(true); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { int i; logDebug(BaseMessages.getString(PKG, "DBProcDialog.Log.GettingKeyInfo")); // $NON-NLS-1$ if (input.getArgument() != null) for (i = 0; i < input.getArgument().length; i++) { TableItem item = wFields.table.getItem(i); if (input.getArgument()[i] != null) item.setText(1, input.getArgument()[i]); if (input.getArgumentDirection()[i] != null) item.setText(2, input.getArgumentDirection()[i]); item.setText(3, ValueMeta.getTypeDesc(input.getArgumentType()[i])); } if (input.getDatabase() != null) wConnection.setText(input.getDatabase().getName()); else if (transMeta.nrDatabases() == 1) { wConnection.setText(transMeta.getDatabase(0).getName()); } if (input.getProcedure() != null) wProcName.setText(input.getProcedure()); if (input.getResultName() != null) wResult.setText(input.getResultName()); wResultType.setText(ValueMeta.getTypeDesc(input.getResultType())); wAutoCommit.setSelection(input.isAutoCommit()); wFields.setRowNums(); wFields.optWidth(true); wStepname.selectAll(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { wAccField.setText(Const.NVL(input.getAcceptingField(), "")); for (int i = 0; i < input.getOutputFields().size(); i++) { SasInputField field = input.getOutputFields().get(i); TableItem item = new TableItem(wFields.table, SWT.NONE); int colnr = 1; item.setText(colnr++, Const.NVL(field.getName(), "")); item.setText(colnr++, Const.NVL(field.getRename(), "")); item.setText(colnr++, ValueMeta.getTypeDesc(field.getType())); item.setText(colnr++, Const.NVL(field.getConversionMask(), "")); item.setText(colnr++, field.getLength() >= 0 ? Integer.toString(field.getLength()) : ""); item.setText( colnr++, field.getPrecision() >= 0 ? Integer.toString(field.getPrecision()) : ""); item.setText(colnr++, Const.NVL(field.getDecimalSymbol(), "")); item.setText(colnr++, Const.NVL(field.getGroupingSymbol(), "")); item.setText(colnr++, Const.NVL(field.getTrimTypeDesc(), "")); } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
protected void getParamsData() { wParams.clearAll(false); ArrayList<String> paramNames = new ArrayList<String>(configuration.getParams().keySet()); Collections.sort(paramNames); for (int i = 0; i < paramNames.size(); i++) { String paramName = paramNames.get(i); String paramValue = configuration.getParams().get(paramName); String defaultValue; try { defaultValue = abstractMeta.getParameterDefault(paramName); } catch (UnknownParamException e) { defaultValue = ""; } String description; try { description = abstractMeta.getParameterDescription(paramName); } catch (UnknownParamException e) { description = ""; } TableItem tableItem = new TableItem(wParams.table, SWT.NONE); tableItem.setText(1, paramName); tableItem.setText(2, Const.NVL(defaultValue, "")); tableItem.setText(3, Const.NVL(paramValue, "")); tableItem.setText(4, Const.NVL(description, "")); } wParams.removeEmptyRows(); wParams.setRowNums(); wParams.optWidth(true); }
/** * This helper method puts the step configuration stored in the meta object and puts it into the * dialog controls. */ private void populateDialog() { wRemoveBlanks.setSelection(meta.isConsecutiveDelimsAsOne()); if (meta.getSourceFields() != null) { for (int i = 0; i < meta.getSourceFields().length; i++) { TableItem item = wGroup.table.getItem(i); if (meta.getSourceFields()[i] != null) { item.setText(1, meta.getSourceFields()[i]); } if (meta.getSourceDelims()[i] != null) { item.setText(2, meta.getSourceDelims()[i]); } if (meta.getOutputFields()[i] != null) { item.setText(3, meta.getOutputFields()[i]); } if (meta.getOutputDelims()[i] != null) { item.setText(4, meta.getOutputDelims()[i]); } } } wGroup.setRowNums(); wGroup.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { wStepname.setText(stepname); for (int i = 0; i < input.getFieldCCType().length; i++) { TableItem item = wFields.table.getItem(i); String type = input.getFieldCCType()[i]; String len = input.getFieldCCLength()[i]; String size = input.getFieldCCSize()[i]; if (type != null) item.setText(1, type); if (len != null) item.setText(2, len); if (size != null) item.setText(3, size); } wFields.setRowNums(); wFields.optWidth(true); if (input.getCardNumberFieldName() != null) wCCNumberField.setText(input.getCardNumberFieldName()); if (input.getCardTypeFieldName() != null) wCCTypeField.setText(input.getCardTypeFieldName()); if (input.getCardLengthFieldName() != null) wCCLengthField.setText(input.getCardLengthFieldName()); wStepname.selectAll(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { if (isDebug()) { logDebug(BaseMessages.getString(PKG, "FuzzyMatchDialog.Log.GettingKeyInfo")); } wAlgorithm.setText(FuzzyMatchMeta.getAlgorithmTypeDesc(input.getAlgorithmType())); if (input.getMainStreamField() != null) { wMainStreamField.setText(input.getMainStreamField()); } if (input.getLookupField() != null) { wLookupField.setText(input.getLookupField()); } wcaseSensitive.setSelection(input.isCaseSensitive()); wgetCloserValue.setSelection(input.isGetCloserValue()); if (input.getMinimalValue() != null) { wminValue.setText(input.getMinimalValue()); } if (input.getMaximalValue() != null) { wmaxValue.setText(input.getMaximalValue()); } if (input.getOutputMatchField() != null) { wmatchField.setText(input.getOutputMatchField()); } if (input.getOutputValueField() != null) { wvalueField.setText(input.getOutputValueField()); } if (input.getSeparator() != null) { wseparator.setText(input.getSeparator()); } if (input.getValue() != null) { for (int i = 0; i < input.getValue().length; i++) { TableItem item = wReturn.table.getItem(i); if (input.getValue()[i] != null) { item.setText(1, input.getValue()[i]); } if (input.getValueName()[i] != null && !input.getValueName()[i].equals(input.getValue()[i])) { item.setText(2, input.getValueName()[i]); } } } StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get(0); wStep.setText(Const.NVL(infoStream.getStepname(), "")); wReturn.setRowNums(); wReturn.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
public void getDatabases() { wFields.removeAll(); for (int i = 0; i < jobMeta.nrDatabases(); i++) { DatabaseMeta ci = jobMeta.getDatabase(i); if (ci != null) { wFields.add(new String[] {ci.getName(), "0", JobEntryCheckDbConnections.unitTimeDesc[0]}); } } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { wStoreValues.setSelection(input.getStoreValues()); for (int i = 0; i < input.getCompareFields().length; i++) { TableItem item = wFields.table.getItem(i); if (input.getCompareFields()[i] != null) item.setText(1, input.getCompareFields()[i]); } wFields.setRowNums(); wFields.optWidth(true); wStepname.selectAll(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { logDebug(BaseMessages.getString(PKG, "MemoryGroupByDialog.Log.GettingKeyInfo")); wAlwaysAddResult.setSelection(input.isAlwaysGivingBackOneRow()); if (input.getGroupField() != null) { for (int i = 0; i < input.getGroupField().length; i++) { TableItem item = wGroup.table.getItem(i); if (input.getGroupField()[i] != null) { item.setText(1, input.getGroupField()[i]); } } } if (input.getAggregateField() != null) { for (int i = 0; i < input.getAggregateField().length; i++) { TableItem item = wAgg.table.getItem(i); if (input.getAggregateField()[i] != null) { item.setText(1, input.getAggregateField()[i]); } if (input.getSubjectField()[i] != null) { item.setText(2, input.getSubjectField()[i]); } item.setText( 3, Const.NVL(MemoryGroupByMeta.getTypeDescLong(input.getAggregateType()[i]), "")); if (input.getValueField()[i] != null) { item.setText(4, input.getValueField()[i]); } } } wGroup.setRowNums(); wGroup.optWidth(true); wAgg.setRowNums(); wAgg.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
public void setMapping(Mapping mapping) { if (mapping == null) { return; } m_fieldsView.clearAll(); // do the key first TableItem keyItem = new TableItem(m_fieldsView.table, SWT.NONE); keyItem.setText(1, mapping.getKeyName()); keyItem.setText(2, "Y"); keyItem.setText(5, mapping.getKeyType().toString()); if (mapping.isTupleMapping() && !Const.isEmpty(mapping.getTupleFamilies())) { keyItem.setText(3, mapping.getTupleFamilies()); } // the rest of the fields in the mapping Map<String, HBaseValueMeta> mappedFields = mapping.getMappedColumns(); for (String alias : mappedFields.keySet()) { HBaseValueMeta vm = mappedFields.get(alias); TableItem item = new TableItem(m_fieldsView.table, SWT.NONE); item.setText(1, alias); item.setText(2, "N"); item.setText(3, vm.getColumnFamily()); item.setText(4, vm.getColumnName()); if (vm.isInteger()) { if (vm.getIsLongOrDouble()) { item.setText(5, "Long"); } else { item.setText(5, "Integer"); } } else if (vm.isNumber()) { if (vm.getIsLongOrDouble()) { item.setText(5, "Double"); } else { item.setText(5, "Float"); } } else { item.setText(5, vm.getTypeDesc()); } if (vm.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED) { item.setText(6, HBaseValueMeta.objectIndexValuesToString(vm.getIndex())); } } m_fieldsView.removeEmptyRows(); m_fieldsView.setRowNums(); m_fieldsView.optWidth(true); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { Table table = wFields.table; if (input.getStepName().length > 0) { table.removeAll(); } for (int i = 0; i < input.getStepName().length; i++) { TableItem ti = new TableItem(table, SWT.NONE); ti.setText(0, "" + (i + 1)); if (input.getStepName()[i] != null) { ti.setText(1, input.getStepName()[i]); ti.setText(2, String.valueOf(Const.toInt(input.getStepCopyNr()[i], 0))); ti.setText(3, input.getRequiredStepsDesc(input.getStepRequired()[i])); } } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); if (input.getStepNameFieldName() != null) { wStepnameField.setText(input.getStepNameFieldName()); } if (input.getStepIdFieldName() != null) { wStepidField.setText(input.getStepIdFieldName()); } if (input.getStepLinesInputFieldName() != null) { wLinesinputField.setText(input.getStepLinesInputFieldName()); } if (input.getStepLinesOutputFieldName() != null) { wLinesoutputField.setText(input.getStepLinesOutputFieldName()); } if (input.getStepLinesReadFieldName() != null) { wLinesreadField.setText(input.getStepLinesReadFieldName()); } if (input.getStepLinesWrittenFieldName() != null) { wLineswrittenField.setText(input.getStepLinesWrittenFieldName()); } if (input.getStepLinesUpdatedFieldName() != null) { wLinesupdatedField.setText(input.getStepLinesUpdatedFieldName()); } if (input.getStepLinesErrorsFieldName() != null) { wLineserrorsField.setText(input.getStepLinesErrorsFieldName()); } if (input.getStepSecondsFieldName() != null) { wSecondsField.setText(input.getStepSecondsFieldName()); } wStepname.selectAll(); wStepname.setFocus(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { if (input.getReplaceAllByValue() != null) wReplaceByValue.setText(input.getReplaceAllByValue()); if (input.getReplaceAllMask() != null) wMask.setText(input.getReplaceAllMask()); wSelectFields.setSelection(input.isSelectFields()); wSelectValuesType.setSelection(input.isSelectValuesType()); Table table = wValueTypes.table; if (input.getTypeName().length > 0) table.removeAll(); for (int i = 0; i < input.getTypeName().length; i++) { TableItem ti = new TableItem(table, SWT.NONE); ti.setText(0, "" + (i + 1)); if (input.getTypeName()[i] != null) ti.setText(1, input.getTypeName()[i]); if (input.getTypeReplaceValue()[i] != null) ti.setText(2, input.getTypeReplaceValue()[i]); if (input.getTypeReplaceMask()[i] != null) ti.setText(3, input.getTypeReplaceMask()[i]); } wValueTypes.setRowNums(); wValueTypes.removeEmptyRows(); wValueTypes.optWidth(true); table = wFields.table; if (input.getFieldName().length > 0) table.removeAll(); for (int i = 0; i < input.getFieldName().length; i++) { TableItem ti = new TableItem(table, SWT.NONE); ti.setText(0, "" + (i + 1)); if (input.getFieldName()[i] != null) ti.setText(1, input.getFieldName()[i]); if (input.getReplaceValue()[i] != null) ti.setText(2, input.getReplaceValue()[i]); if (input.getReplaceMask()[i] != null) ti.setText(3, input.getReplaceMask()[i]); } wFields.setRowNums(); wValueTypes.removeEmptyRows(); wFields.optWidth(true); wStepname.selectAll(); }
private void doGetFields() { try { List<String> cubeDimensions = null; if (comboCube.getText() != null && comboCube.getText() != "") { if (addConnectionLine.getText() != null) { DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText()); if (dbMeta != null) { PaloCellOutputData data = new PaloCellOutputData(dbMeta); data.helper.connect(); cubeDimensions = data.helper.getCubeDimensions(comboCube.getText()); data.helper.disconnect(); } } tableViewFields.table.removeAll(); for (int i = 0; i < cubeDimensions.size(); i++) { final TableItem item = new TableItem(tableViewFields.table, SWT.NONE); item.setText(1, cubeDimensions.get(i)); // item.setText(3, "String"); } final TableItem item = new TableItem(tableViewFields.table, SWT.NONE); item.setText(1, "Cube Measure"); item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); tableViewFields.removeEmptyRows(); tableViewFields.setRowNums(); tableViewFields.optWidth(true); tableViewFields.setReadonly(true); } else { new ErrorDialog( shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), new Exception( BaseMessages.getString(PKG, "PaloCellOutputDialog.SelectCubeFirstError"))); } this.fillPreviousFieldTableViewColumn(); } catch (KettleException ke) { new ErrorDialog( shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke); } }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { int i; if (isDebug()) logDebug(BaseMessages.getString(PKG, "RestDialog.Log.GettingKeyInfo")); // $NON-NLS-1$ if (input.getHeaderName() != null) { for (i = 0; i < input.getHeaderName().length; i++) { TableItem item = wFields.table.getItem(i); if (input.getHeaderField()[i] != null) item.setText(1, input.getHeaderField()[i]); if (input.getHeaderName()[i] != null) item.setText(2, input.getHeaderName()[i]); } } if (input.getParameterField() != null) { for (i = 0; i < input.getParameterField().length; i++) { TableItem item = wParameters.table.getItem(i); if (input.getParameterField()[i] != null) item.setText(1, input.getParameterField()[i]); if (input.getParameterName()[i] != null) item.setText(2, input.getParameterName()[i]); } } wMethod.setText(Const.NVL(input.getMethod(), RestMeta.HTTP_METHOD_GET)); wMethodInField.setSelection(input.isDynamicMethod()); if (input.getBodyField() != null) wBody.setText(input.getBodyField()); if (input.getMethodFieldName() != null) wMethodField.setText(input.getMethodFieldName()); if (input.getUrl() != null) wUrl.setText(input.getUrl()); wUrlInField.setSelection(input.isUrlInField()); if (input.getUrlField() != null) wUrlField.setText(input.getUrlField()); if (input.getFieldName() != null) wResult.setText(input.getFieldName()); if (input.getResultCodeFieldName() != null) wResultCode.setText(input.getResultCodeFieldName()); if (input.getResponseTimeFieldName() != null) wResponseTime.setText(input.getResponseTimeFieldName()); if (input.getHttpLogin() != null) wHttpLogin.setText(input.getHttpLogin()); if (input.getHttpPassword() != null) wHttpPassword.setText(input.getHttpPassword()); if (input.getProxyHost() != null) wProxyHost.setText(input.getProxyHost()); if (input.getProxyPort() != null) wProxyPort.setText(input.getProxyPort()); wPreemptive.setSelection(input.isPreemptive()); if (input.getTrustStoreFile() != null) wTrustStoreFile.setText(input.getTrustStoreFile()); if (input.getTrustStorePassword() != null) wTrustStorePassword.setText(input.getTrustStorePassword()); wApplicationType.setText(Const.NVL(input.getApplicationType(), "")); wFields.setRowNums(); wFields.optWidth(true); wStepname.selectAll(); }
private void get() { wFields.removeAll(); Table table = wFields.table; for (int i = 0; i < previousSteps.length; i++) { TableItem ti = new TableItem(table, SWT.NONE); ti.setText(0, "" + (i + 1)); ti.setText(1, previousSteps[i]); ti.setText(2, "0"); ti.setText(3, BaseMessages.getString(PKG, "System.Combo.No")); } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); }
public void getData() { if (input.getTypeField() != null) wTypefield.setText(input.getTypeField()); for (int i = 0; i < input.getFieldName().length; i++) { TableItem item = wFields.table.getItem(i); if (input.getFieldName()[i] != null) item.setText(1, input.getFieldName()[i]); if (input.getFieldValue()[i] != null) item.setText(2, input.getFieldValue()[i]); if (input.getFieldNorm()[i] != null) item.setText(3, input.getFieldNorm()[i]); } wFields.setRowNums(); wFields.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
private void doGetLevels() { if (buttonBaseElementsOnly.getSelection()) { tableViewFields.table.removeAll(); tableViewFields.add( BaseMessages.getString(PKG, "PaloDimInputDialog.BaseElementName"), "0", comboDimension.getText(), "String"); } else if (comboDimension.getText() != null && comboDimension.getText() != "") { try { if (addConnectionLine.getText() != null) { DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText()); if (dbMeta != null) { PaloDimInputData data = new PaloDimInputData(dbMeta); tableViewFields.table.removeAll(); data.helper.connect(); List<PaloDimensionLevel> levels = data.helper.getDimensionLevels(comboDimension.getText()); for (int i = 0; i < levels.size(); i++) { PaloDimensionLevel level = levels.get(i); tableViewFields.add( level.getLevelName(), String.valueOf(level.getLevelNumber()), level.getFieldName()); } tableViewFields.setRowNums(); tableViewFields.optWidth(true); data.helper.disconnect(); } } } catch (Exception ex) { new ErrorDialog( shell, BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"), ex); } } else { new ErrorDialog( shell, BaseMessages.getString("System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString("System.Dialog.GetFieldsFailed.Message"), new Exception( BaseMessages.getString(PKG, "PaloDimInputDialog.SelectDimensionFirstError"))); } }
private void getArgumentsData() { wArguments.clearAll(false); List<String> argumentNames = new ArrayList<String>(configuration.getArguments().keySet()); Collections.sort(argumentNames); for (int i = 0; i < argumentNames.size(); i++) { String argumentName = argumentNames.get(i); String argumentValue = configuration.getArguments().get(argumentName); TableItem tableItem = new TableItem(wArguments.table, SWT.NONE); tableItem.setText(1, Const.NVL(argumentName, "")); tableItem.setText(2, Const.NVL(argumentValue, "")); } wArguments.removeEmptyRows(); wArguments.setRowNums(); wArguments.optWidth(true); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { if (jobEntry.getName() != null) wName.setText(jobEntry.getName()); if (jobEntry.connections != null) { for (int i = 0; i < jobEntry.connections.length; i++) { TableItem ti = wFields.table.getItem(i); if (jobEntry.connections[i] != null) { ti.setText(1, jobEntry.connections[i].getName()); ti.setText(2, "" + Const.toInt(jobEntry.waitfors[i], 0)); ti.setText(3, JobEntryCheckDbConnections.getWaitTimeDesc(jobEntry.waittimes[i])); } } wFields.setRowNums(); wFields.optWidth(true); } wName.selectAll(); wName.setFocus(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { wStepname.setText(stepname); for (int i = 0; i < input.getFieldName().length; i++) { TableItem item = wFields.table.getItem(i); String name = input.getFieldName()[i]; String type = input.getFieldValue()[i]; if (name != null) item.setText(1, name); if (type != null) item.setText(2, type); } wFields.setRowNums(); wFields.optWidth(true); wStepname.selectAll(); wStepname.setFocus(); }
private void getInfo(FixedInputMeta fixedInputMeta) { fixedInputMeta.setFilename(wFilename.getText()); fixedInputMeta.setLineWidth(wLineWidth.getText()); fixedInputMeta.setBufferSize(wBufferSize.getText()); fixedInputMeta.setLazyConversionActive(wLazyConversion.getSelection()); fixedInputMeta.setHeaderPresent(wHeaderPresent.getSelection()); fixedInputMeta.setLineFeedPresent(wLineFeedPresent.getSelection()); fixedInputMeta.setRunningInParallel(wRunningInParallel.getSelection()); fixedInputMeta.setFileType(FixedInputMeta.getFileType(wFileType.getText())); fixedInputMeta.setEncoding(wEncoding.getText()); fixedInputMeta.setAddResultFile(wAddResult.getSelection()); int nrNonEmptyFields = wFields.nrNonEmpty(); fixedInputMeta.allocate(nrNonEmptyFields); for (int i = 0; i < nrNonEmptyFields; i++) { TableItem item = wFields.getNonEmpty(i); int colnr = 1; FixedFileInputField field = new FixedFileInputField(); field.setName(item.getText(colnr++)); field.setType(ValueMetaFactory.getIdForValueMeta(item.getText(colnr++))); field.setFormat(item.getText(colnr++)); field.setWidth(Const.toInt(item.getText(colnr++), -1)); field.setLength(Const.toInt(item.getText(colnr++), -1)); field.setPrecision(Const.toInt(item.getText(colnr++), -1)); field.setCurrency(item.getText(colnr++)); field.setDecimal(item.getText(colnr++)); field.setGrouping(item.getText(colnr++)); field.setTrimType(ValueMetaString.getTrimTypeByDesc(item.getText(colnr++))); // CHECKSTYLE:Indentation:OFF fixedInputMeta.getFieldDefinition()[i] = field; } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); fixedInputMeta.setChanged(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { wStepname.setText(stepname); wFilename.setText(Const.NVL(inputMeta.getFilename(), "")); wLineWidth.setText(Const.NVL(inputMeta.getLineWidth(), "")); wLineFeedPresent.setSelection(inputMeta.isLineFeedPresent()); wBufferSize.setText(Const.NVL(inputMeta.getBufferSize(), "")); wLazyConversion.setSelection(inputMeta.isLazyConversionActive()); wHeaderPresent.setSelection(inputMeta.isHeaderPresent()); wRunningInParallel.setSelection(inputMeta.isRunningInParallel()); wFileType.setText(inputMeta.getFileTypeDesc()); wEncoding.setText(Const.NVL(inputMeta.getEncoding(), "")); wAddResult.setSelection(inputMeta.isAddResultFile()); for (int i = 0; i < inputMeta.getFieldDefinition().length; i++) { TableItem item = new TableItem(wFields.table, SWT.NONE); int colnr = 1; FixedFileInputField field = inputMeta.getFieldDefinition()[i]; item.setText(colnr++, Const.NVL(field.getName(), "")); item.setText(colnr++, ValueMetaFactory.getValueMetaName(field.getType())); item.setText(colnr++, Const.NVL(field.getFormat(), "")); item.setText(colnr++, field.getWidth() >= 0 ? Integer.toString(field.getWidth()) : ""); item.setText(colnr++, field.getLength() >= 0 ? Integer.toString(field.getLength()) : ""); item.setText( colnr++, field.getPrecision() >= 0 ? Integer.toString(field.getPrecision()) : ""); item.setText(colnr++, Const.NVL(field.getCurrency(), "")); item.setText(colnr++, Const.NVL(field.getDecimal(), "")); item.setText(colnr++, Const.NVL(field.getGrouping(), "")); item.setText(colnr++, ValueMetaString.getTrimTypeCode(field.getTrimType())); } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth(true); enableFields(); wStepname.selectAll(); wStepname.setFocus(); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { if (jobEntry.getName() != null) wName.setText(jobEntry.getName()); wName.selectAll(); if (jobEntry.source_filefolder != null) { for (int i = 0; i < jobEntry.source_filefolder.length; i++) { TableItem ti = wFields.table.getItem(i); if (jobEntry.source_filefolder[i] != null) ti.setText(1, jobEntry.source_filefolder[i]); if (jobEntry.wildcard[i] != null) ti.setText(3, jobEntry.wildcard[i]); } wFields.setRowNums(); wFields.optWidth(true); } wPrevious.setSelection(jobEntry.arg_from_previous); wIncludeSubfolders.setSelection(jobEntry.include_subfolders); if (jobEntry.getNrErrorsLessThan() != null) wNrErrorsLessThan.setText(jobEntry.getNrErrorsLessThan()); else wNrErrorsLessThan.setText("10"); if (jobEntry.getSuccessCondition() != null) { if (jobEntry.getSuccessCondition().equals(jobEntry.SUCCESS_IF_AT_LEAST_X_FILES_WELL_FORMED)) wSuccessCondition.select(1); else if (jobEntry.getSuccessCondition().equals(jobEntry.SUCCESS_IF_BAD_FORMED_FILES_LESS)) wSuccessCondition.select(2); else wSuccessCondition.select(0); } else wSuccessCondition.select(0); if (jobEntry.getResultFilenames() != null) { if (jobEntry.getResultFilenames().equals(jobEntry.ADD_WELL_FORMED_FILES_ONLY)) wAddFilenameToResult.select(1); else if (jobEntry.getResultFilenames().equals(jobEntry.ADD_BAD_FORMED_FILES_ONLY)) wAddFilenameToResult.select(2); else wAddFilenameToResult.select(0); } else wAddFilenameToResult.select(0); }
/** Copy information from the meta-data input to the dialog fields. */ public void getData() { int i; for (i = 0; i < input.size(); i++) { TableItem item = wFields.table.getItem(i); ValueMetaInterface v = input.getValueMeta(i); int idx = 1; if (v.getName() != null) { item.setText(idx++, v.getName()); } item.setText(idx++, v.getTypeDesc()); item.setText(idx++, v.getLength() < 0 ? "-" : "" + v.getLength()); item.setText(idx++, v.getPrecision() < 0 ? "-" : "" + v.getPrecision()); item.setText(idx++, Const.NVL(v.getOrigin(), "")); item.setText(idx++, ValueMeta.getStorageTypeCode(v.getStorageType())); item.setText(idx++, Const.NVL(v.getConversionMask(), "")); item.setText(idx++, Const.NVL(v.getCurrencySymbol(), "")); item.setText(idx++, Const.NVL(v.getDecimalSymbol(), "")); item.setText(idx++, Const.NVL(v.getGroupingSymbol(), "")); item.setText(idx++, ValueMeta.getTrimTypeDesc(v.getTrimType())); item.setText(idx++, Const.NVL(v.getComments(), "")); } wFields.optWidth(true); }