Search in sources :

Example 1 with IMPORTSType

use of org.talend.designer.core.model.utils.emf.component.IMPORTSType in project tdi-studio-se by Talend.

the class ImportModuleManager method getImportTypes.

public List<IMPORTType> getImportTypes(IMPORTSType importsType) {
    List<IMPORTType> types = new ArrayList<IMPORTType>();
    List<IMPORTType> importTypes = importsType.getIMPORT();
    for (IMPORTType importType : importTypes) {
        inheritParentProperties(importsType, importType);
        types.add(importType);
    }
    List<IMPORTSType> importsTypes = importsType.getIMPORTS();
    for (IMPORTSType imports : importsTypes) {
        inheritParentProperties(importsType, imports);
        types.addAll(getImportTypes(imports));
    }
    return types;
}
Also used : IMPORTSType(org.talend.designer.core.model.utils.emf.component.IMPORTSType) ArrayList(java.util.ArrayList) IMPORTType(org.talend.designer.core.model.utils.emf.component.IMPORTType)

Example 2 with IMPORTSType

use of org.talend.designer.core.model.utils.emf.component.IMPORTSType in project tdi-studio-se by Talend.

the class ImportModuleManagerTest method initTestImportsType.

private void initTestImportsType() {
    testImportsType = ComponentFactory.eINSTANCE.createIMPORTSType();
    IMPORTType importType1 = ComponentFactory.eINSTANCE.createIMPORTType();
    //$NON-NLS-1$
    importType1.setMODULE("test-jar1.jar");
    //$NON-NLS-1$
    importType1.setREQUIREDIF("x > 0");
    testImportsType.getIMPORT().add(importType1);
    IMPORTType importType2 = ComponentFactory.eINSTANCE.createIMPORTType();
    //$NON-NLS-1$
    importType2.setMODULE("test-jar2.jar");
    //$NON-NLS-1$
    importType2.setREQUIREDIF("y > 0");
    testImportsType.getIMPORT().add(importType2);
    IMPORTSType importsType = ComponentFactory.eINSTANCE.createIMPORTSType();
    //$NON-NLS-1$
    importsType.setREQUIREDIF("z > 0");
    IMPORTType importType3 = ComponentFactory.eINSTANCE.createIMPORTType();
    //$NON-NLS-1$
    importType3.setMODULE("test-jar3.jar");
    //$NON-NLS-1$
    importType3.setREQUIREDIF("(x > y)");
    importsType.getIMPORT().add(importType3);
    testImportsType.getIMPORTS().add(importsType);
}
Also used : IMPORTSType(org.talend.designer.core.model.utils.emf.component.IMPORTSType) IMPORTType(org.talend.designer.core.model.utils.emf.component.IMPORTType)

Aggregations

IMPORTSType (org.talend.designer.core.model.utils.emf.component.IMPORTSType)2 IMPORTType (org.talend.designer.core.model.utils.emf.component.IMPORTType)2 ArrayList (java.util.ArrayList)1