Search in sources :

Example 1 with JavaLanguage

use of org.talend.designer.mapper.language.java.JavaLanguage in project tdi-studio-se by Talend.

the class LanguageProvider method getCurrentLanguage.

public static ILanguage getCurrentLanguage() {
    ECodeLanguage codeLanguage = null;
    if (!MapperMain.isStandAloneMode()) {
        RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
        codeLanguage = repositoryContext.getProject().getLanguage();
    } else {
        codeLanguage = ECodeLanguage.PERL;
    }
    switch(codeLanguage) {
        case JAVA:
            if (!(language instanceof JavaLanguage) || LanguageProvider.language == null) {
                LanguageProvider.language = getJavaLanguage();
            }
            break;
        default:
            if (!(language instanceof PerlLanguage) || LanguageProvider.language == null) {
                LanguageProvider.language = getPerlLanguage();
            }
    }
    return LanguageProvider.language;
}
Also used : RepositoryContext(org.talend.core.context.RepositoryContext) PerlLanguage(org.talend.designer.mapper.language.perl.PerlLanguage) JavaLanguage(org.talend.designer.mapper.language.java.JavaLanguage) ECodeLanguage(org.talend.core.language.ECodeLanguage)

Aggregations

RepositoryContext (org.talend.core.context.RepositoryContext)1 ECodeLanguage (org.talend.core.language.ECodeLanguage)1 JavaLanguage (org.talend.designer.mapper.language.java.JavaLanguage)1 PerlLanguage (org.talend.designer.mapper.language.perl.PerlLanguage)1