protected void calcuAddedColumns( FOXTreeNode node, MetadataColumn targetColumn, EList columnList) { if (targetColumn == null) { addColumn(node.getLabel(), node, columnList); } else { node.setColumn(ConvertionHelper.convertToIMetaDataColumn(targetColumn)); } }
private void addColumn(String label, FOXTreeNode node, EList columnList) { if (StringUtils.isEmpty(label)) { return; } MetadataEmfTableEditor editor = new MetadataEmfTableEditor(); String columnName = label; if (columnName.contains(":")) { // $NON-NLS-1$ columnName = columnName.split(":")[1]; // $NON-NLS-1$ } columnName = columnName.replaceAll("[^a-zA-Z0-9]", "_"); // $NON-NLS-1$ String dataType = node.getDataType(); MetadataColumn metadataColumn = ConnectionFactory.eINSTANCE.createMetadataColumn(); metadataColumn.setLabel(editor.getNextGeneratedColumnName(columnName, columnList)); metadataColumn.setOriginalField(label); metadataColumn.setTalendType(dataType); columnList.add(metadataColumn); node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metadataColumn)); }