Author: alexsmirnov
Date: 2010-04-06 20:19:36 -0400 (Tue, 06 Apr 2010)
New Revision: 16742
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
Log:
CODING IN PROGRESS - issue RF-8567: Cleanup Annotation processor code
https://jira.jboss.org/jira/browse/RF-8567
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java 2010-04-06
17:26:01 UTC (rev 16741)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java 2010-04-07
00:19:36 UTC (rev 16742)
@@ -28,6 +28,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import javax.faces.render.RenderKitFactory;
+
/**
* <p class="changed_added_4_0">
* The presence of this annotation in the JSF component class associated particular
renderer with component.
@@ -51,9 +53,17 @@
*/
public String type() default "";
+ /**
+ * <p class="changed_added_4_0">Renderer Family</p>
+ * @return
+ */
public String family() default "";
- public String renderKitId() default "";
+ /**
+ * <p class="changed_added_4_0">RenderKit for which this renderer is
belong to</p>
+ * @return
+ */
+ public String renderKitId() default RenderKitFactory.HTML_BASIC_RENDER_KIT;
public String template() default "";
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-04-06
17:26:01 UTC (rev 16741)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-04-07
00:19:36 UTC (rev 16742)
@@ -24,6 +24,7 @@
package org.richfaces.cdk.apt.processors;
import java.lang.annotation.Annotation;
+import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -114,8 +115,7 @@
if(null != componentElement){
attributesProcessor.processType(component,componentElement);
}
- // TODO - process interfaces() attribute.
- List<ClassName> interfaceNames = Lists.newArrayList();
+ Collection<ClassName> interfaceNames = component.getInterfaces();
try {
Class<?>[] interfaces = annotation.interfaces();
for (Class<?> clazz : interfaces) {
@@ -132,7 +132,6 @@
}
}
}
- // TODO - store interfaces in the model.
for (Tag tag : annotation.tag()) {
setTagInfo(tag, component);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-04-06
17:26:01 UTC (rev 16741)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-04-07
00:19:36 UTC (rev 16742)
@@ -1,5 +1,9 @@
package org.richfaces.cdk.model;
+import java.util.Collection;
+
+import com.google.common.collect.Sets;
+
/**
* <p class="changed_added_4_0">Base class for the most JSF components
taht have description
* attributes and support extensions in faces-config.</p>
@@ -15,6 +19,8 @@
private ClassName baseClass;
private final ModelCollection<TagModel> tags =
ModelCollection.<TagModel>create();
+
+ private final Collection<ClassName> interfaces = Sets.newHashSet();
/**
@@ -25,6 +31,14 @@
return this.tags;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the interfaces
+ */
+ public Collection<ClassName> getInterfaces() {
+ return this.interfaces;
+ }
+
public FacesId getId() {
return id;
}
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-04-06
17:26:01 UTC (rev 16741)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-04-07
00:19:36 UTC (rev 16742)
@@ -26,29 +26,49 @@
import java.util.List;
import javax.faces.component.UIComponentBase;
+import javax.faces.component.ValueHolder;
import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.Family;
-import org.richfaces.cdk.annotations.Fires;
-import org.richfaces.cdk.annotations.Generate;
import org.richfaces.cdk.annotations.Description;
+import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.SubComponent;
import org.richfaces.cdk.annotations.Tag;
-import org.richfaces.cdk.test.event.TestEvent;
/**
* <p class="changed_added_4_0">
+ * Test component that generates a set of the output components.
* </p>
*
* @author asmirnov(a)exadel.com
*
*/
-@JsfComponent(type = "org.richfaces.cdk.test.TestComponent")
+@JsfComponent(type = "org.richfaces.cdk.test.TestComponent",
+ family="org.richfaces.Test",
+ description=@Description(displayName="Test
Component",largeIcon="large.gif",smallIcon="spall.png"),
+ generate="org.richfaces.cdk.test.component.UITestComponent",
+ facets=@Facet(name="caption"),
+ interfaces=ValueHolder.class,
+ components={
+ @SubComponent(type = "org.richfaces.cdk.test.TestHtmlAbbr",
+ description=@Description(displayName="Test HTML5
abbreviation",largeIcon="large.gif",smallIcon="spall.png"),
+ tag=@Tag(name="abbr"),
+ generate="org.richfaces.cdk.test.component.html.HtmlTestAbbr",
+ interfaces=Html5Attributes.class),
+ @SubComponent(type = "org.richfaces.cdk.test.TestHtmlDfn",
+ tag=@Tag(name="dfn"),
+ generate="org.richfaces.cdk.test.component.html.HtmlTestDfn",
+ attributes="html5.xml")
+ }
+)
public abstract class AbstractTestComponent extends UIComponentBase /*implements
ValueHolder */{
@Attribute
- private int foo;
+ private int length;
+ @Attribute
+ public abstract String getTitle();
+
/**
* Test Attribute
*/
Added:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java
(rev 0)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java 2010-04-07
00:19:36 UTC (rev 16742)
@@ -0,0 +1,68 @@
+/*
+ * $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.test.component;
+
+import org.richfaces.cdk.annotations.Attribute;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface Html5Attributes {
+
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ public enum DraggableState {
+ TRUE,
+ FALSE,
+ AUTO
+ }
+
+ /**
+ * @return
+ */
+ @Attribute
+ public abstract DraggableState getDraggable();
+
+ /**
+ * @param newValue
+ */
+ public abstract void setDraggable(DraggableState newValue);
+
+ /**
+ * @return
+ */
+ @Attribute
+ public abstract boolean isHidden();
+
+ /**
+ * @param newValue
+ */
+ public abstract void setHidden(boolean newValue);
+}
Property changes on:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/Html5Attributes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain