use of org.talend.designer.core.model.utils.emf.component.CONNECTORType in project tdi-studio-se by Talend.
the class TalendEditorComponentCreationUtil method isTypeAllowed.
public static boolean isTypeAllowed(final EConnectionType connType, EList listConnType) {
if (listConnType == null) {
return false;
}
EConnectionType testedType;
if (connType.hasConnectionCategory(IConnectionCategory.FLOW)) {
testedType = EConnectionType.FLOW_MAIN;
} else {
testedType = connType;
}
CONNECTORType currentType;
for (int i = 0; i < listConnType.size(); i++) {
currentType = (CONNECTORType) listConnType.get(i);
EConnectionType tempType = EConnectionType.getTypeFromName(currentType.getCTYPE());
if (tempType == testedType) {
int maxInput = currentType.getMAXINPUT();
int minInput = currentType.getMININPUT();
if (maxInput > 0 || minInput > 0) {
return true;
}
}
}
return false;
}
Aggregations