Author: nbelaevski
Date: 2010-07-11 18:58:06 -0400 (Sun, 11 Jul 2010)
New Revision: 17932
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
Log:
CDK: fixed @JsfRenderer not processed correctly for defined (non-generated) classes
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-07-11
21:43:10 UTC (rev 17931)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-07-11
22:58:06 UTC (rev 17932)
@@ -30,6 +30,8 @@
import javax.lang.model.element.Element;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
import org.richfaces.cdk.FileManager;
import org.richfaces.cdk.Source;
@@ -109,11 +111,18 @@
if (componentElement.getModifiers().contains(Modifier.ABSTRACT) ||
!Strings.isEmpty(generatedClass)) {
modelElement.setGenerate(true);
modelElement.setRendererClass(ClassName.parseName(generatedClass));
+
modelElement.setBaseClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
} else {
modelElement.setGenerate(false);
+
modelElement.setRendererClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
+
+ TypeMirror superclass = componentElement.getSuperclass();
+ if (superclass.getKind() == TypeKind.DECLARED) {
+ TypeElement typeElement = getSourceUtils().asTypeElement(superclass);
+
modelElement.setBaseClass(ClassName.parseName(typeElement.getQualifiedName().toString()));
+ }
}
-
modelElement.setBaseClass(ClassName.parseName(componentElement.getQualifiedName().toString()));
}
private void setComponentType(RendererModel rendererModel) {