use of org.talend.designer.core.generic.model.GenericNodeConnector in project tdi-studio-se by Talend.
the class SchemaUtils method updateComponentSchema.
public static void updateComponentSchema(INode node, IMetadataTable metadataTable, Boolean askPropagate) {
if (node == null || metadataTable == null || node.getComponentProperties() == null) {
return;
}
Schema schema = convertTalendSchemaIntoComponentSchema(ConvertionHelper.convert(metadataTable));
INodeConnector connector = node.getConnectorFromName(metadataTable.getAttachedConnector());
if (connector != null) {
if (connector instanceof GenericNodeConnector) {
node.getComponentProperties().setConnectedSchema(((GenericNodeConnector) connector).getComponentConnector(), schema, true);
}
for (IElementParameter param : new ArrayList<IElementParameter>(node.getElementParameters())) {
if (EParameterFieldType.SCHEMA_REFERENCE.equals(param.getFieldType()) && connector.getName().equals(param.getContext())) {
if (param instanceof GenericElementParameter) {
((GenericElementParameter) param).setAskPropagate(askPropagate);
}
param.setValue(schema);
}
}
}
}
Aggregations