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);
}
Aggregations