Author: Alex.Kolonitsky
Date: 2010-03-01 08:14:42 -0500 (Mon, 01 Mar 2010)
New Revision: 16507
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java
Log:
https://jira.jboss.org/jira/browse/RF-8232
Tags support - generate Taglib and TagHandlers
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java 2010-03-01
11:27:09 UTC (rev 16506)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java 2010-03-01
13:14:42 UTC (rev 16507)
@@ -65,4 +65,8 @@
*/
public String value() default "";
+ public boolean generate() default true;
+
+ public Tag tag() default @Tag(name = "");
+
}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2010-03-01
11:27:09 UTC (rev 16506)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2010-03-01
13:14:42 UTC (rev 16507)
@@ -53,4 +53,6 @@
public String id() default "";
public String behaviorClass() default "";
+
+ public Tag tag() default @Tag(name = "");
}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-03-01
11:27:09 UTC (rev 16506)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-03-01
13:14:42 UTC (rev 16507)
@@ -47,4 +47,6 @@
public Class<?> forClass() default Object.class;
public String converterClass() default "";
+
+ public Tag tag() default @Tag(name = "");
}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2010-03-01
11:27:09 UTC (rev 16506)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2010-03-01
13:14:42 UTC (rev 16507)
@@ -20,4 +20,6 @@
public String id() default "";
public String validatorClass() default "";
+
+ public Tag tag() default @Tag(name = "");
}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java 2010-03-01
11:27:09 UTC (rev 16506)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Tag.java 2010-03-01
13:14:42 UTC (rev 16507)
@@ -24,11 +24,7 @@
package org.richfaces.cdk.annotations;
import java.io.IOException;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
import javax.faces.component.UIComponent;
import javax.faces.view.facelets.FaceletContext;
@@ -41,9 +37,7 @@
*
* @author asmirnov(a)exadel.com
*/
-(a)Retention(RetentionPolicy.CLASS)
-(a)Target(ElementType.TYPE)
-@Inherited
+(a)Retention(RetentionPolicy.SOURCE)
public @interface Tag {
public static final String NAME = "org.richfaces.cdk.annotations.Tag";
@@ -57,12 +51,15 @@
*/
public String name();
+ public TagType type() default TagType.All;
+
public Class<? extends TagHandler> handler() default DEFAULT.class;
+ public Class<? extends TagHandler> baseHandler() default DEFAULT.class;
+
/**
* Used in {@link Tag} to signal that tag uses the default handler.
*/
-
static final class DEFAULT extends TagHandler {
public DEFAULT(TagConfig config) {
@@ -73,7 +70,5 @@
public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
// do nothing
}
-
}
-
}
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java
(rev 0)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/TagType.java 2010-03-01
13:14:42 UTC (rev 16507)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.annotations;
+
+/**
+ * @author akolonitsky
+ * @since Feb 11, 2010
+ */
+public enum TagType {
+ None, Jsp, Facelets, All
+}