Author: alexsmirnov
Date: 2010-03-15 19:02:23 -0400 (Mon, 15 Mar 2010)
New Revision: 16581
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehaviorRenderer.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
Removed:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Renderer.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/RepeatRenderer.java
Log:
CODING IN PROGRESS - issue RF-8523: Refactor CDK annotations
https://jira.jboss.org/jira/browse/RF-8523
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehaviorRenderer.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehaviorRenderer.java
(rev 0)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehaviorRenderer.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -0,0 +1,40 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)Retention(RetentionPolicy.SOURCE)
+(a)Target(ElementType.TYPE)
+public @interface JsfBehaviorRenderer {
+
+}
Property changes on:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehaviorRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -111,12 +111,12 @@
/**
* <p class="changed_added_4_0">
- * Renderer associated with this component.
+ * JsfRenderer associated with this component.
* </p>
*
* @return
*/
- public Renderer renderer() default @Renderer();
+ public JsfRenderer renderer() default @JsfRenderer();
/**
* <p class="changed_added_4_0">
Copied:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
(from rev 16579,
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Renderer.java)
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
(rev 0)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -0,0 +1,54 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.cdk.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p class="changed_added_4_0">
+ * The presence of this annotation in the JSF component class associated particular
renderer with component.
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ */
+(a)Retention(RetentionPolicy.SOURCE)
+(a)Target(ElementType.TYPE)
+public @interface JsfRenderer {
+
+ public static final String NAME =
"org.richfaces.cdk.annotations.JsfRenderer";
+
+ /**
+ * <p class="changed_added_4_0">
+ * The value of this annotation attribute is taken to be JSF
<em>renderer-type</em>. If this value was empty,
+ * component type will be inferred from by the CDK.
+ * </p>
+ *
+ * @return JSF <em>renderer-type</em>.
+ */
+ public String value() default "";
+
+}
Property changes on:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Renderer.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Renderer.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Renderer.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -1,54 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.cdk.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * <p class="changed_added_4_0">
- * The presence of this annotation in the JSF component class associated particular
renderer with component.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.SOURCE)
-(a)Target(ElementType.TYPE)
-public @interface Renderer {
-
- public static final String NAME =
"org.richfaces.cdk.annotations.Renderer";
-
- /**
- * <p class="changed_added_4_0">
- * The value of this annotation attribute is taken to be JSF
<em>renderer-type</em>. If this value was empty,
- * component type will be inferred from by the CDK.
- * </p>
- *
- * @return JSF <em>renderer-type</em>.
- */
- public String value() default "";
-
-}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -8,7 +8,7 @@
* <li>@{@link Family}("component.Family") defines component
family used in the generated class.<br /></li>
* <li>@{@link Generate}("component.UIClass") tells CDK to
generate concrete component class ( base UI... or renderer-specific ).</li>
* <li>@{@link
Test}(testClass="component.Test",testMethod="testFoo",testType={@link
TestType}.DECODE) tells CDK to generate unit test for that component.</li>
- * <li>@{@link Renderer}("retnderer.Type") , @{@link
RendererTemplate}("/renderer/template.xml") associate renderer with that
component. The first one defines independently created renderer, while @{@link
RendererTemplate tells CDK to generate renderer class from that template. It is possible
to define more than one template with component class using @{@link
RendererTemplates}({@{@link
RendererTemplate}("one.xml"),@{@link
RendererTemplate}("two.xml").<br /></li>
+ * <li>@{@link JsfRenderer}("retnderer.Type") , @{@link
RendererTemplate}("/renderer/template.xml") associate renderer with that
component. The first one defines independently created renderer, while @{@link
RendererTemplate tells CDK to generate renderer class from that template. It is possible
to define more than one template with component class using @{@link
RendererTemplates}({@{@link
RendererTemplate}("one.xml"),@{@link
RendererTemplate}("two.xml").<br /></li>
* <li>@{@link Attributes}({"base.xml","command.xml"})
defines fragments of faces-config.xml which contain standart attributes definitions. CDK
also tries to read META-INF/cdk/attributes/[classname].xml file for all component
superclasses and interfaces, therefore it is not necessary to explicit include definitions
for UIComponent and any other standard JSF classes. CDK defines couple of its own
"urn" namespaces: "urn:resource:" for classpath resources,
"urn:config:" for for project configuration folder and
"urn:attributes:" for META-INF/cdk/attributes/ in the annotations library.<br
/></li>
* <li>@{@link Fires}({MyEvent.class}) defines event classes that this
component could fire.</li>
* <li>@{@link Icon} , @{@link DisplayName} - optional
IDE-related parameters.<br /></li>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -100,7 +100,7 @@
// process Events.
setEvents(componentElement, component);
- // TODO - process renderers ( @Renderer and @RendererTemplate attribute.
+ // TODO - process renderers ( @JsfRenderer and @RendererTemplate attribute.
// TODO - process @Test annotations.
// Process attributes.
processAttributes(componentElement, component);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -25,7 +25,7 @@
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.Family;
import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.Renderer;
+import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.model.RendererModel;
@@ -38,7 +38,7 @@
* @author akolonitsky
* @since Dec 30, 2009
*/
-(a)SupportedAnnotationTypes({"javax.faces.component.FacesComponent",
Renderer.NAME})
+(a)SupportedAnnotationTypes({"javax.faces.component.FacesComponent",
JsfRenderer.NAME})
public class RendererProcessor extends ProcessorBase implements CdkAnnotationProcessor {
@@ -81,7 +81,7 @@
// process Events.
// setEvents(componentElement, renderer);
- // TODO - process renderers ( @Renderer and @RendererTemplate attribute.
+ // TODO - process renderers ( @JsfRenderer and @RendererTemplate attribute.
// TODO - process @Test annotations.
// Process attributes.
// processAttributes(componentElement, component);
@@ -156,7 +156,7 @@
@Override
public Class<? extends Annotation> getProcessedAnnotation() {
- return Renderer.class;
+ return JsfRenderer.class;
}
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/taglib/TaglibGeneratorVisitor.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -61,7 +61,7 @@
Element tag = createTag(getComponentTagName(model)); // TODO change to tag name!
Element component = tag.addElement(COMPONENT);
component.addElement(COMPONENT_TYPE).addText(model.getType().getType());
- component.addElement("renderer-type").addText(model.getType().getType()
+ "Renderer");
+ component.addElement("renderer-type").addText(model.getType().getType()
+ "JsfRenderer");
addTagHandler(component, model.getTag());
appendAttributs(tag, model);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -30,7 +30,7 @@
/**
* <p class="changed_added_4_0">
- * Renderer for the final component. This is bidirectional many to many
+ * JsfRenderer for the final component. This is bidirectional many to many
* relation.
* </p>
*/
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ComponentProcessorTest.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -37,7 +37,7 @@
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.Icon;
import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.Renderer;
+import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
@@ -139,7 +139,7 @@
}
@Override
- public Renderer renderer() {
+ public JsfRenderer renderer() {
return null;
}
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -156,7 +156,7 @@
protected String[] sourceIncludes;
/**
- * The list of Renderer template files that will be processed by CDK.
+ * The list of JsfRenderer template files that will be processed by CDK.
* By default, CDK looks for all files in the
<code>src/main/templates</code> folder
* with "xml" extension.
*
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/AjaxPushRenderer.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -32,7 +32,7 @@
import org.richfaces.component.AbstractPush;
import org.richfaces.component.html.HtmlPush;
import org.richfaces.resource.PushResource;
-import org.richfaces.cdk.annotations.Renderer;
+import org.richfaces.cdk.annotations.JsfRenderer;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -52,7 +52,7 @@
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "richfaces.js")
})
-@Renderer
+@JsfRenderer
public class AjaxPushRenderer extends RendererBase {
public static final String PUSH_INTERVAL_PARAMETER =
"A4J.AJAX.Push.INTERVAL";
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -34,7 +34,7 @@
* @author Nick Belaevski
*
*/
-(a)org.richfaces.cdk.annotations.Renderer
+(a)org.richfaces.cdk.annotations.JsfRenderer
@ResourceDependencies( { @ResourceDependency(library = "javax.faces", name =
"jsf.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name =
"richfaces.js"),
@ResourceDependency(name = "richfaces-queue.js")
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/RepeatRenderer.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/RepeatRenderer.java 2010-03-15
18:03:04 UTC (rev 16580)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/RepeatRenderer.java 2010-03-15
23:02:23 UTC (rev 16581)
@@ -35,7 +35,7 @@
* @author Nick Belaevski
*
*/
-(a)org.richfaces.cdk.annotations.Renderer("org.richfaces.RepeatRenderer")
+(a)org.richfaces.cdk.annotations.JsfRenderer("org.richfaces.RepeatRenderer")
public class RepeatRenderer extends Renderer {
@Override