Search in sources :

Example 1 with ClassProvider

use of org.whole.lang.workflows.model.ClassProvider in project whole by wholeplatform.

the class WorkflowsIDEInterpreterVisitor method getJavaTemplateFactory.

@Override
protected ITemplateFactory<CompilationUnit> getJavaTemplateFactory(LoadJavaModel entity) {
    ClassProvider classProvider = entity.getClassProvider();
    EntityDescriptor<?> ed = classProvider.wGetEntityDescriptor();
    IJavaProject javaProject;
    switch(ed.getOrdinal()) {
        case ClassPath_ord:
            return super.getJavaTemplateFactory(entity);
        case CurrentJavaProject_ord:
            javaProject = (IJavaProject) getBindings().wGetValue("javaProject");
            break;
        case JavaProject_ord:
            javaProject = JDTUtils.getJavaProject(classProvider.wStringValue());
            break;
        default:
            throw new IllegalArgumentException("invalid ClassProvider");
    }
    entity.getClassName().accept(this);
    String className = getResultString();
    return new JavaSourceTemplateFactory(className, javaProject);
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) ClassProvider(org.whole.lang.workflows.model.ClassProvider) JavaSourceTemplateFactory(org.whole.lang.java.codebase.JavaSourceTemplateFactory)

Aggregations

IJavaProject (org.eclipse.jdt.core.IJavaProject)1 JavaSourceTemplateFactory (org.whole.lang.java.codebase.JavaSourceTemplateFactory)1 ClassProvider (org.whole.lang.workflows.model.ClassProvider)1