Search in sources :

Example 1 with CONNECTORType

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;
}
Also used : CONNECTORType(org.talend.designer.core.model.utils.emf.component.CONNECTORType) EConnectionType(org.talend.core.model.process.EConnectionType)

Aggregations

EConnectionType (org.talend.core.model.process.EConnectionType)1 CONNECTORType (org.talend.designer.core.model.utils.emf.component.CONNECTORType)1