Author: alexsmirnov
Date: 2010-03-30 19:44:36 -0400 (Tue, 30 Mar 2010)
New Revision: 16686
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Description.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SubComponent.java
Removed:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attributes.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DefaultValue.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DisplayName.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/EventNames.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facets.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Fires.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Generate.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplate.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplates.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SuggestedValue.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Alias.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.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/JsfBehaviorRenderer.java
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/JsfConverter.java
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/JsfValidator.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/processors/AttributeProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.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/apt/processors/ConverterProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
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/ValidatorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/AnnotationProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java
Log:
https://jira.jboss.org/jira/browse/RF-8523 - process renderer-specific components from
annotations.
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Alias.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Alias.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Alias.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -37,18 +37,17 @@
* @author asmirnov(a)exadel.com
*/
@Retention(RetentionPolicy.CLASS)
-@Target( { ElementType.METHOD, ElementType.FIELD })
public @interface Alias {
public static final String NAME = "org.richfaces.cdk.annotations.Alias";
/**
* <p class="changed_added_4_0">
- * Attribute aliases. This is mandatory parameter
+ * Attribute alias. This is mandatory parameter
* </p>
*
* @return attribute aliases.
*/
- public String[] value();
+ public String value();
}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -79,15 +79,15 @@
boolean generate() default true;
- String displayName() default "";
-
String defaultValue() default "";
String suggestedValue() default "";
- Icon icon() default @Icon();
+ Description description() default @Description();
Signature signature() default @Signature();
EventName[] events() default {};
+
+ Alias[] aliases() default {};
}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attributes.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attributes.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attributes.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,55 +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.Inherited;
-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.CLASS)
-(a)Target(ElementType.TYPE)
-@Inherited
-public @interface Attributes {
-
- public static final String NAME =
"org.richfaces.cdk.annotations.Attributes";
-
- /**
- * <p class="changed_added_4_0">
- * To avoid copy/paste routine for standard or other useful attributes, their
definitions could be stored in
- * faces-config.xml extensions and reused from different components.
- * </p>
- *
- * @return URL's of the XML files that contain attribute definitions.
- */
- public String[] value();
-
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DefaultValue.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DefaultValue.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DefaultValue.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,44 +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.Inherited;
-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.CLASS)
-@Target( { ElementType.METHOD, ElementType.FIELD })
-@Inherited
-public @interface DefaultValue {
- String value();
-}
Copied:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Description.java
(from rev 16685,
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java)
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Description.java
(rev 0)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Description.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -0,0 +1,66 @@
+/*
+ * $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;
+
+/**
+ * <p class="changed_added_4_0">
+ * Description used that would be used in IDE to display.
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ */
+public @interface Description {
+
+ public static final String NAME =
"org.richfaces.cdk.annotations.Description";
+
+ /**
+ * <p class="changed_added_4_0">Long description of the
object.</p>
+ * @return
+ */
+ public String value() default "";
+ /**
+ * <p class="changed_added_4_0">
+ * Display name for development tools.
+ * </p>
+ *
+ * @return
+ */
+ public String displayName() default "";
+
+ /**
+ * <p class="changed_added_4_0">
+ * URL that defines IDE icon.
+ * </p>
+ *
+ * @return Description url.
+ */
+ public String smallIcon() default "";
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
+ public String largeIcon() default "";
+
+}
Property changes on:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Description.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/DisplayName.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DisplayName.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/DisplayName.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,55 +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.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * <p class="changed_added_4_0">
- * Defines name that would be used in IDE to display.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.CLASS)
-@Target( { ElementType.TYPE, ElementType.METHOD })
-@Inherited
-public @interface DisplayName {
-
- public static final String NAME =
"org.richfaces.cdk.annotations.DisplayName";
-
- /**
- * <p class="changed_added_4_0">
- * IDE display name.
- * </p>
- *
- * @return Icon url.
- */
- public String value();
-
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/EventNames.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/EventNames.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/EventNames.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,51 +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.Inherited;
-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.CLASS)
-@Target( { ElementType.METHOD, ElementType.FIELD })
-@Inherited
-public @interface EventNames {
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return
- */
- public EventName[] value();
-}
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -49,12 +49,23 @@
*
* @return
*/
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
String name() default "";
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
boolean generate() default true;
- Icon icon() default @Icon;
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
+ Description description() default @Description;
- String displayName() default "";
}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facets.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facets.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facets.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,55 +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.Inherited;
-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.CLASS)
-(a)Target(ElementType.TYPE)
-@Inherited
-public @interface Facets {
-
- public static final String NAME = "org.richfaces.cdk.annotations.Facets";
-
- /**
- * <p class="changed_added_4_0">
- * To avoid copy/paste routine for standard or other useful attributes, their
definitions could be stored in
- * faces-config.xml extensions and reused from different components.
- * </p>
- *
- * @return references to XML files that contain attributes definitions.
- */
- public Facet[] value();
-
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,62 +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.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * <p class="changed_added_4_0">
- * Defines family of the JSF component or renderer.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.CLASS)
-(a)Target(ElementType.TYPE)
-@Inherited
-public @interface Family {
-
- /**
- * <p class="changed_added_4_0">
- * Annotation class name to use as key for annotation processor class.
- * </p>
- */
- public static final String NAME = "org.richfaces.cdk.annotations.Family";
-
- /**
- * <p class="changed_added_4_0">
- * The value of this annotation attribute is taken to be
<em>component-family</em> for annotated JSF component or
- * renderer class. If this value an empty, it will be inferred from component type or
<code>COMPONENT_FAMILY</code>
- * constant.
- * </p>
- *
- * @return component family.
- */
- public String value() default "";
-
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Fires.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Fires.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Fires.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -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.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.faces.event.FacesEvent;
-
-/**
- * <p class="changed_added_4_0">
- * This annotation defines events that are fired by component.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.CLASS)
-(a)Target(ElementType.TYPE)
-@Inherited
-public @interface Fires {
-
- /**
- * <p class="changed_added_4_0">
- * Array of all {@link FacesEvent} inherited classes that could be fired by
component.
- * </p>
- *
- * @return
- */
- public Class<? extends FacesEvent>[] value();
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Generate.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Generate.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Generate.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,58 +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.Inherited;
-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 tells CDK to generate class or method implementation
even though target does not have
- * the {@code abstract} modifier.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.CLASS)
-@Target( { ElementType.TYPE, ElementType.METHOD })
-@Inherited
-public @interface Generate {
-
- public static final String NAME =
"org.richfaces.cdk.annotations.Generate";
-
- public static final String DEFAULT = NAME + ".DEFAULT";
-
- /**
- * <p class="changed_added_4_0">
- * Name of the generated class. If this value was an empty, name will be inferred by
CDK.
- * </p>
- *
- * @return generated object type.
- */
- public String value() default "";
-
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Icon.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,52 +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;
-
-/**
- * <p class="changed_added_4_0">
- * Icon used that would be used in IDE to display.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-public @interface Icon {
-
- public static final String NAME = "org.richfaces.cdk.annotations.Icon";
-
- /**
- * <p class="changed_added_4_0">
- * URL that defines IDE icon.
- * </p>
- *
- * @return Icon url.
- */
- public String small() default "";
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return
- */
- public String large() default "";
-
-}
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-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -54,26 +54,17 @@
public Tag tag() default @Tag;
-
+ public JsfBehaviorRenderer renderer() default @JsfBehaviorRenderer();
/**
* <p class="changed_added_4_0">
- * Icon used by IDE.
+ * Description used by IDE.
* </p>
*
* @return
*/
- public Icon icon() default @Icon();
+ public Description description() default @Description();
- /**
- * <p class="changed_added_4_0">
- * Display name for development tools.
- * </p>
- *
- * @return
- */
- public String displayName() default "";
-
/**
* <p class="changed_added_4_0">
* defines fragments of faces-config.xml that contain standard attribute definitions.
CDK also tries to read
Modified:
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 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehaviorRenderer.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -37,4 +37,10 @@
@Target(ElementType.TYPE)
public @interface JsfBehaviorRenderer {
+ public String type() default "";
+
+ public String renderKitId() default "";
+
+ public Description description() default @Description();
+
}
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-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -51,9 +51,12 @@
public static final String NAME =
"org.richfaces.cdk.annotations.JsfComponent";
/**
- * <p class="changed_added_4_0">Excplicitly disable component
generation</p>
- */
+ * <p class="changed_added_4_0">
+ * Excplicitly disable component generation
+ * </p>
+ */
public static final String DISABLED = "##DISABLED";
+
/**
* <p class="changed_added_4_0">
* Type of the component. This is mandatory parameter because CDK uses
<em>component-type</em> as primary key for
@@ -88,24 +91,15 @@
/**
* <p class="changed_added_4_0">
- * Icon used by IDE.
+ * Description used by IDE.
* </p>
*
* @return
*/
- public Icon icon() default @Icon();
+ public Description description() default @Description();
/**
* <p class="changed_added_4_0">
- * Display name for development tools.
- * </p>
- *
- * @return
- */
- public String displayName() default "";
-
- /**
- * <p class="changed_added_4_0">
* Cenerated Junit test.
* </p>
*
@@ -129,7 +123,7 @@
*
* @return
*/
- public Tag[] tag() default {@Tag};
+ public Tag[] tag() default { @Tag };
/**
* <p class="changed_added_4_0">
@@ -162,4 +156,20 @@
*/
public String[] attributes() default {};
+ /**
+ * <p class="changed_added_4_0">
+ * Interfaces that should be implemented in the generated component class. CDK
processes all {@link Attribute} and
+ * {@link Facet} annotations in these interfaces
+ * </p>
+ *
+ * @return
+ */
+ public Class<?>[] interfaces() default {};
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
+ public SubComponent[] components() default {};
+
}
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-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -49,22 +49,13 @@
/**
* <p class="changed_added_4_0">
- * Icon used by IDE.
+ * Description used by IDE.
* </p>
*
* @return
*/
- public Icon icon() default @Icon();
+ public Description description() default @Description();
- /**
- * <p class="changed_added_4_0">
- * Display name for development tools.
- * </p>
- *
- * @return
- */
- public String displayName() default "";
-
public Tag tag() default @Tag;
public static final class NONE {}
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-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfRenderer.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -57,7 +57,6 @@
public String template() default "";
- public Icon icon() default @Icon();
+ public Description description() default @Description();
- public String displayName() default "";
}
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-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -22,25 +22,15 @@
public Tag tag() default @Tag;
/**
* <p class="changed_added_4_0">
- * Icon used by IDE.
+ * Description used by IDE.
* </p>
*
* @return
*/
- public Icon icon() default @Icon();
+ public Description description() default @Description();
/**
* <p class="changed_added_4_0">
- * Display name for development tools.
- * </p>
- *
- * @return
- */
- public String displayName() default "";
-
-
- /**
- * <p class="changed_added_4_0">
* defines fragments of faces-config.xml that contain standard attribute 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
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplate.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplate.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplate.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,49 +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.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.SOURCE)
-public @interface RendererTemplate {
-
- public static final String NAME =
"org.richfaces.cdk.annotations.RendererTemplate";
-
- /**
- * <p class="changed_added_4_0">
- * Reference to renderer template used with that component.
- * </p>
- *
- * @return template url.
- */
- public String value();
-
-}
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplates.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplates.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/RendererTemplates.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,50 +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.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @author asmirnov(a)exadel.com
- */
-(a)Retention(RetentionPolicy.SOURCE)
-public @interface RendererTemplates {
-
- public static final String NAME =
"org.richfaces.cdk.annotations.RendererTemplates";
-
- /**
- * <p class="changed_added_4_0">
- * To avoid copy/paste routine for standard or other useful attributes, their
definitions could be stored in
- * faces-config.xml extensions and reused from different components.
- * </p>
- *
- * @return references to XML files that contain attributes definitions.
- */
- public RendererTemplate[] value();
-
-}
Added:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SubComponent.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SubComponent.java
(rev 0)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SubComponent.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -0,0 +1,133 @@
+/*
+ * $Id: JsfComponent.java 16684 2010-03-30 12:16:40Z Alex.Kolonitsky $
+ *
+ * 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.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * <p class="changed_added_4_0">
+ * That annotation defines class that is generated from the concrete class defined in
the {@link JsfComponent}
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ */
+(a)Retention(RetentionPolicy.SOURCE)
+public @interface SubComponent {
+
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * Type of the component. This is mandatory parameter because CDK uses
<em>component-type</em> as primary key for
+ * components library model.
+ * </p>
+ * <p class="todo">
+ * TODO if this value is an empty, component type will be inferred from class name.
+ * </p>
+ *
+ * @return component type.
+ */
+ public String type() default "";
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * Name of the generated component implementation class.
+ * </p>
+ *
+ * @return
+ */
+ public String generate() default "";
+
+ /**
+ * <p class="changed_added_4_0">
+ * Description used by IDE.
+ * </p>
+ *
+ * @return
+ */
+ public Description description() default @Description();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Cenerated Junit test.
+ * </p>
+ *
+ * @return
+ */
+ public Test test() default @Test(testClass = "");
+
+ /**
+ * <p class="changed_added_4_0">
+ * JsfRenderer associated with this component.
+ * </p>
+ *
+ * @return
+ */
+ public JsfRenderer renderer() default @JsfRenderer();
+
+ /**
+ * <p class="changed_added_4_0">
+ * View Description Language, JSP or Facelets, tags.
+ * </p>
+ *
+ * @return
+ */
+ public Tag[] tag() default { @Tag };
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * Component facets.
+ * </p>
+ *
+ * @return
+ */
+ public Facet[] facets() default {};
+
+ /**
+ * <p class="changed_added_4_0">
+ * defines fragments of faces-config.xml that contain standard attribute 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.
+ * </p>
+ *
+ * @return
+ */
+ public String[] attributes() default {};
+
+ /**
+ * <p class="changed_added_4_0">
+ * Interfaces that should be implemented in the generated component class. CDK
processes all {@link Attribute} and
+ * {@link Facet} annotations in these interfaces
+ * </p>
+ *
+ * @return
+ */
+ public Class<?>[] interfaces() default {};
+
+}
Property changes on:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SubComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SuggestedValue.java
===================================================================
---
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SuggestedValue.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/SuggestedValue.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -1,42 +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">
- * </p>
- *
- * @author asmirnov(a)exadel.com
- *
- */
-(a)Retention(RetentionPolicy.SOURCE)
-@Target( { ElementType.METHOD, ElementType.FIELD })
-public @interface SuggestedValue {
- String value();
-}
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-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -11,7 +11,7 @@
* <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>
+ * <li>@{@link Description} , @{@link DisplayName} - optional
IDE-related parameters.<br /></li>
* </ul>
* <p> </p>
* <h2>Attribute level annotations ( for getter or setter level ):</h2>
@@ -22,7 +22,7 @@
* <li>@{@link Alias}({"foo","bar"})</li>
* <li>@{@link EventName}(value="click",defaultEvent=true)
defines behavior event name for that attribute. To define more than one event name they
could be grouped as @{@link EventNames}({@{@link
EventName}("foo),@{@link EventName}("bar")})</li>
* <li>@{@link DefaultValue}("12"), @{@link
SuggestedValue}("12") ...</li>
- * <li>@{@link Icon} , @{@link DisplayName} - optional
IDE-related parameters.</li>
+ * <li>@{@link Description} , @{@link DisplayName} - optional
IDE-related parameters.</li>
* </ul>
* <p> </p>
* <h3>Facet annotations.</h3>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributeProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributeProcessor.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/AttributeProcessor.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -53,7 +53,7 @@
Attribute attributeAnnotarion = beanProperty.getAnnotation(Attribute.class);
if (attributeAnnotarion == null) {
attribute.setGenerate(!beanProperty.isExists());
- setDescription(attribute, null, beanProperty.getDocComment(), null);
+ setDescription(attribute, null, beanProperty.getDocComment());
} else {
attribute.setHidden(attributeAnnotarion.hidden());
@@ -63,7 +63,7 @@
attribute.setReadOnly(attributeAnnotarion.readOnly());
attribute.setGenerate(attributeAnnotarion.generate() ||
!beanProperty.isExists());
- setDescription(attribute, attributeAnnotarion.icon(),
beanProperty.getDocComment(), attributeAnnotarion.displayName());
+ setDescription(attribute, attributeAnnotarion.description(),
beanProperty.getDocComment());
String defaultValue = attributeAnnotarion.defaultValue();
if (!Strings.isEmpty(defaultValue)) {
@@ -135,8 +135,4 @@
}
}
- @Override
- protected String[] getAnnotationAttributes(TypeElement componentElement) {
- throw new UnsupportedOperationException();
- }
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/BehaviorProcessor.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -49,8 +49,8 @@
setClassNames(element, behaviorModel, behavior.generate());
setTagInfo(behavior.tag(), behaviorModel);
- processAttributes(element, behaviorModel);
- setDescription(behaviorModel, behavior.icon(), getDocComment(element),
behavior.displayName());
+ processAttributes(element, behaviorModel,behavior.attributes());
+ setDescription(behaviorModel, behavior.description(), getDocComment(element));
library.getBehaviors().add(behaviorModel);
}
@@ -60,12 +60,4 @@
return JsfBehavior.class;
}
-
-
- @Override
- protected String[] getAnnotationAttributes(TypeElement element) {
- JsfBehavior behavior = element.getAnnotation(JsfBehavior.class);
- return behavior.attributes();
- }
-
}
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-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ComponentProcessor.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -21,17 +21,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
package org.richfaces.cdk.apt.processors;
import com.google.inject.Inject;
import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.Event;
import org.richfaces.cdk.annotations.Facet;
import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.SubComponent;
import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.Test;
import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
+import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.FacesId;
@@ -46,12 +50,13 @@
import java.util.Set;
/**
- * <p class="changed_added_4_0">That class process component-related
annotations such as {@link org.richfaces.cdk.annotations.JsfComponent} or
+ * <p class="changed_added_4_0">
+ * That class process component-related annotations such as {@link
org.richfaces.cdk.annotations.JsfComponent} or
* {@link javax.faces.component.FacesComponent} and stores information in model.
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class ComponentProcessor extends ProcessorBase implements CdkAnnotationProcessor
{
@@ -63,7 +68,7 @@
private RendererProcessor rendererProcessor;
public void process(TypeElement componentElement, ComponentLibrary library) {
- JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
+ final JsfComponent annotation =
componentElement.getAnnotation(JsfComponent.class);
if (annotation == null) {
return;
}
@@ -73,67 +78,141 @@
// Should that component be generated ?
setClassNames(componentElement, component, annotation.generate());
setComponentProperties(componentElement, component, annotation, library);
- for (Tag tag : annotation.tag()) {
- setTagInfo(tag, component);
+ for (final SubComponent subcomponent : annotation.components()) {
+ JsfComponent subAnnotation = new JsfComponent() {
+
+ @Override
+ public Class<? extends Annotation> annotationType() {
+ return JsfComponent.class;
+ }
+
+ @Override
+ public String type() {
+ return subcomponent.type();
+ }
+
+ @Override
+ public Test test() {
+ return subcomponent.test();
+ }
+
+ @Override
+ public Tag[] tag() {
+ return subcomponent.tag();
+ }
+
+ @Override
+ public JsfRenderer renderer() {
+ return subcomponent.renderer();
+ }
+
+ @Override
+ public Class<?>[] interfaces() {
+ return subcomponent.interfaces();
+ }
+
+ @Override
+ public String generate() {
+ return subcomponent.generate();
+ }
+
+ @Override
+ public Event[] fires() {
+ return new Event[0];
+ }
+
+ @Override
+ public String family() {
+ return annotation.family();
+ }
+
+ @Override
+ public Facet[] facets() {
+ return subcomponent.facets();
+ }
+
+ @Override
+ public Description description() {
+ return subcomponent.description();
+ }
+
+ @Override
+ public SubComponent[] components() {
+ return new SubComponent[0];
+ }
+
+ @Override
+ public String[] attributes() {
+ return subcomponent.attributes();
+ }
+ };
+ ComponentModel subcomponentModel = new ComponentModel();
+ subcomponentModel.setBaseClass(component.getTargetClass());
+
subcomponentModel.setTargetClass(ClassName.parseName(subcomponent.generate()));
+ setComponentProperties(null, subcomponentModel, subAnnotation, library);
}
library.getComponents().add(component);
}
- private void setComponentProperties(TypeElement componentElement, ComponentModel
component, JsfComponent annotation, ComponentLibrary library)
- throws CdkException {
+ void setComponentProperties(TypeElement componentElement, ComponentModel component,
+ JsfComponent annotation, ComponentLibrary library) throws CdkException {
setComponentType(componentElement, component, annotation.type());
setComponeneFamily(componentElement, component, annotation.family());
- setDescription(component, annotation.icon(), getDocComment(componentElement),
annotation.displayName());
+ setDescription(component, annotation.description(),
getDocComment(componentElement));
processFacets(componentElement, component, annotation);
processEvents(componentElement, component, annotation);
- processAttributes(componentElement, component);
+ // TODO - process interfaces() attribute.
+ processAttributes(componentElement, component,annotation.attributes());
+ for (Tag tag : annotation.tag()) {
+ setTagInfo(tag, component);
+ }
+
rendererProcessor.process(componentElement, annotation.renderer(), library);
// TODO - process @Test annotations.
}
- private void setComponentType(TypeElement componentElement, ComponentModel component,
String type) {
+ void setComponentType(TypeElement componentElement, ComponentModel component, String
type) {
if (!Strings.isEmpty(type)) {
component.setType(FacesId.parseId(type));
- return;
+ } else if (null != componentElement) {
+ // static final String COMPONENT_FAMILY = "...";
+ Object value =
getSourceUtils().getConstant(asClassDesctiption(componentElement), COMPONENT_TYPE);
+ if (value != null) {
+ component.setType(FacesId.parseId(value.toString()));
+ }
}
-
- // static final String COMPONENT_FAMILY = "...";
- Object value = getSourceUtils().getConstant(asClassDesctiption(componentElement),
COMPONENT_TYPE);
- if (value != null) {
- component.setType(FacesId.parseId(value.toString()));
- return;
- }
-
-
component.setType(this.getNamingConventions().inferComponentType(asClassDesctiption(componentElement)));
}
final void processFacets(TypeElement componentElement, ComponentModel component,
JsfComponent annotation) {
- SourceUtils sourceUtils = getSourceUtils();
- Set<BeanProperty> properties =
sourceUtils.getBeanPropertiesAnnotatedWith(Facet.class,
asClassDesctiption(componentElement));
+ if (null != componentElement) {
+ SourceUtils sourceUtils = getSourceUtils();
+ Set<BeanProperty> properties =
+ sourceUtils.getBeanPropertiesAnnotatedWith(Facet.class,
asClassDesctiption(componentElement));
- // TODO - encapsulate attribute builder into utility class.
- for (BeanProperty beanProperty : properties) {
- Facet facet = beanProperty.getAnnotation(Facet.class);
- FacetModel facetModel = component.getOrCreateFacet(beanProperty.getName());
+ // TODO - encapsulate attribute builder into utility class.
+ for (BeanProperty beanProperty : properties) {
+ Facet facet = beanProperty.getAnnotation(Facet.class);
+ FacetModel facetModel =
component.getOrCreateFacet(beanProperty.getName());
- facetModel.setDescription(beanProperty.getDocComment());
+ facetModel.setDescription(beanProperty.getDocComment());
- processFacet(facet, facetModel);
- if (!beanProperty.isExists()) {
- facetModel.setGenerate(true);
+ processFacet(facet, facetModel, beanProperty.getDocComment());
+ if (!beanProperty.isExists()) {
+ facetModel.setGenerate(true);
+ }
}
+
}
-
for (Facet facet : annotation.facets()) {
String name = facet.name();
if (!Strings.isEmpty(name)) {
FacetModel facetModel = component.getOrCreateFacet(name);
- processFacet(facet, facetModel);
+ processFacet(facet, facetModel, null);
} else {
// TODO - record error.
throw new CdkException("Facet name should be set");
@@ -141,29 +220,23 @@
}
}
- final void processFacet(Facet facet, FacetModel facetModel) {
- setIcon(facetModel, facet.icon());
- facetModel.setDisplayname(facet.displayName());
+ final void processFacet(Facet facet, FacetModel facetModel, String docComment) {
+ setDescription(facetModel, facet.description(), docComment);
facetModel.setGenerate(facet.generate());
}
final void setComponeneFamily(TypeElement componentElement, ComponentModel component,
String family) {
if (!Strings.isEmpty(family)) {
component.setFamily(family);
- return;
+ } else if (null != componentElement) {
+ // static final String COMPONENT_FAMILY = "...";
+ Object value =
getSourceUtils().getConstant(asClassDesctiption(componentElement), COMPONENT_FAMILY);
+ if (null != value) {
+ component.setFamily(value.toString());
+ }
}
-
- // static final String COMPONENT_FAMILY = "...";
- Object value = getSourceUtils().getConstant(asClassDesctiption(componentElement),
COMPONENT_FAMILY);
- if (null != value) {
- component.setFamily(value.toString());
- return;
- }
-
-
component.setFamily(getNamingConventions().inferUIComponentFamily(component.getType()));
}
-
final void processEvents(TypeElement componentElement, ComponentModel component,
JsfComponent annotation) {
Event[] fires = annotation.fires();
@@ -183,11 +256,6 @@
}
@Override
- protected final String[] getAnnotationAttributes(TypeElement componentElement) {
- return componentElement.getAnnotation(JsfComponent.class).attributes();
- }
-
- @Override
public final Class<? extends Annotation> getProcessedAnnotation() {
return JsfComponent.class;
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ConverterProcessor.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -59,9 +59,9 @@
}
}
- setDescription(converterModel, converter.icon(), getDocComment(element),
converter.displayName());
+ setDescription(converterModel, converter.description(), getDocComment(element));
- processAttributes(element, converterModel);
+ processAttributes(element, converterModel,converter.attributes());
setClassNames(element, converterModel, converter.generate());
setTagInfo(converter.tag(), converterModel);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ProcessorBase.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -6,7 +6,7 @@
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.NamingConventions;
import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.Icon;
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
@@ -65,32 +65,36 @@
model.getTags().add(tagModel);
}
- protected void setIcon(DescriptionGroup component, Icon icon) {
- if (null != icon && (!Strings.isEmpty(icon.small()) ||
!Strings.isEmpty(icon.large()))) {
+ protected void setIcon(DescriptionGroup component, Description icon) {
+ if (null != icon && (!Strings.isEmpty(icon.smallIcon()) ||
!Strings.isEmpty(icon.largeIcon()))) {
DescriptionGroup.Icon iconValue = new DescriptionGroup.Icon();
- if (!Strings.isEmpty(icon.small())) {
- iconValue.setSmallIcon(icon.small());
+ if (!Strings.isEmpty(icon.smallIcon())) {
+ iconValue.setSmallIcon(icon.smallIcon());
}
- if (!Strings.isEmpty(icon.large())) {
- iconValue.setLargeIcon(icon.large());
+ if (!Strings.isEmpty(icon.largeIcon())) {
+ iconValue.setLargeIcon(icon.largeIcon());
}
component.setIcon(iconValue);
}
}
- protected void setDescription(DescriptionGroup component, Icon icon, String
description, String displayName) {
- component.setDescription(description);
-
- if (icon != null) {
- setIcon(component, icon);
+ protected void setDescription(DescriptionGroup component, Description description,
String docComment) {
+ if(!Strings.isEmpty(docComment)){
+ component.setDescription(docComment);
}
+ if (description != null) {
+ setIcon(component, description);
+ if (!Strings.isEmpty(description.displayName())) {
+ component.setDisplayname(description.displayName());
+ }
+ if (!Strings.isEmpty(description.value())) {
+ component.setDescription(description.value());
+ }
+ }
- if (!Strings.isEmpty(displayName)) {
- component.setDisplayname(displayName);
- }
}
protected void setClassNames(TypeElement componentElement, ModelElementBase
modelElement,
@@ -114,14 +118,11 @@
}
protected String getDocComment(TypeElement componentElement) {
- return getSourceUtils().getDocComment(asClassDesctiption(componentElement));
+ return null !=
componentElement?getSourceUtils().getDocComment(asClassDesctiption(componentElement)):null;
}
- protected abstract String[] getAnnotationAttributes(TypeElement componentElement);
+ protected void processAttributes(TypeElement componentElement, final BeanModelBase
component, String[] annotationAttributes) throws CdkException {
-
- protected void processAttributes(TypeElement componentElement, final BeanModelBase
component) throws CdkException {
-
// Process XML files with standard attributes definitions.
SourceUtils sourceUtils = getSourceUtils();
ClassName componentClassName = asClassDesctiption(componentElement);
@@ -139,10 +140,10 @@
});
// Process all files from @Jsf.. attributes property.
- for(String annotationAttributes : getAnnotationAttributes(componentElement)){
+ for(String attributes : annotationAttributes){
try {
component.getAttributes().addAll(parseProperties(
- CdkEntityResolver.URN_ATTRIBUTES + annotationAttributes));
+ CdkEntityResolver.URN_ATTRIBUTES + attributes));
} catch (CdkException e) {
// TODO - log errors ?
}
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-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/RendererProcessor.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -83,7 +83,7 @@
setRendererType(rendererElement, rendererModel, annotation);
setComponentType(rendererModel);
setComponentFamily(rendererElement, rendererModel, annotation);
- setDescription(rendererModel, annotation.icon(), getDocComment(rendererElement),
annotation.displayName());
+ setDescription(rendererModel, annotation.description(),
getDocComment(rendererElement));
setTemplate(rendererModel, annotation);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/processors/ValidatorProcessor.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -44,7 +44,7 @@
ValidatorModel validatorModel = new
ValidatorModel(FacesId.parseId(validator.id()));
setClassNames(element, validatorModel, validator.generate());
- setDescription(validatorModel, validator.icon(), getDocComment(element),
validator.displayName());
+ setDescription(validatorModel, validator.description(), getDocComment(element));
setTagInfo(validator.tag(), validatorModel);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroupBase.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -48,7 +48,7 @@
private String displayname;
/**
* <p class="changed_added_4_0">
- * Icon name for IDE tools
+ * Description name for IDE tools
* </p>
*/
private Icon icon;
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/AnnotationProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/AnnotationProcessorTest.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/AnnotationProcessorTest.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -21,10 +21,14 @@
package org.richfaces.cdk.apt.processors;
-import com.google.common.collect.ImmutableList;
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.el.ELContext;
+import javax.faces.component.UIComponent;
+import javax.lang.model.element.Name;
+
import org.richfaces.cdk.CdkClassLoader;
import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.FileManager;
@@ -36,18 +40,14 @@
import org.richfaces.cdk.SourceFileManager;
import org.richfaces.cdk.SourceImpl;
import org.richfaces.cdk.Sources;
-import org.richfaces.cdk.apt.processors.ComponentProcessor;
-import org.richfaces.cdk.annotations.Family;
+import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.model.ComponentModel;
-import javax.el.ELContext;
-import javax.faces.component.UIComponent;
-import javax.lang.model.element.Name;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Binder;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* @author akolonitsky
* @since Jan 14, 2010
@@ -136,7 +136,7 @@
protected CdkClassLoader createClassLoader() {
try {
return new
CdkClassLoader(ImmutableList.of(getLibraryFile("test.source.properties"),
- getLibraryFile(ComponentModel.class), getLibraryFile(ELContext.class),
getLibraryFile(Family.class),
+ getLibraryFile(ComponentModel.class), getLibraryFile(ELContext.class),
getLibraryFile(JsfComponent.class),
getLibraryFile(UIComponent.class)), this.getClass().getClassLoader());
} catch (Exception e) {
throw new RuntimeException(e);
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/BehaviorProcessorTest.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -38,6 +38,7 @@
import org.richfaces.cdk.NamingConventions;
import org.richfaces.cdk.Stub;
import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.JsfBehavior;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
@@ -89,6 +90,9 @@
private JsfBehavior behaviorAnnotation;
@Mock
+ private Description description;
+
+ @Mock
private JAXB jaxb;
@Mock
@@ -107,8 +111,7 @@
expect(behaviorAnnotation.generate()).andReturn("foo.Bar");
expect(behaviorAnnotation.tag()).andReturn(tag);
expect(behaviorAnnotation.attributes()).andReturn(new String[]{});
- expect(behaviorAnnotation.icon()).andReturn(null);
- expect(behaviorAnnotation.displayName()).andReturn(null);
+ expect(behaviorAnnotation.description()).andReturn(this.description);
expect(tag.handler()).andStubReturn("");
utils.visitSupertypes((ClassName)anyObject(),
(SuperTypeVisitor)anyObject());expectLastCall();
expect(utils.getBeanPropertiesAnnotatedWith(eq(Attribute.class),
(ClassName)anyObject())).andReturn(Collections.<BeanProperty>emptySet());
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java 2010-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/processors/ComponentProcessorTest.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -50,7 +50,7 @@
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.Facet;
-import org.richfaces.cdk.annotations.Icon;
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.apt.SourceUtils;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
@@ -98,6 +98,9 @@
@Mock
private JsfComponent annotation;
+
+ @Mock
+ private Description description;
@Mock
private JAXB jaxb;
@@ -197,9 +200,9 @@
@Test
public void testSetIcon() throws Exception {
- Icon icon = createMock(Icon.class);
- expect(icon.large()).andReturn(LARGE_GIF).atLeastOnce();
- expect(icon.small()).andReturn(SMALL_JPG).atLeastOnce();
+ Description icon = createMock(Description.class);
+ expect(icon.largeIcon()).andReturn(LARGE_GIF).atLeastOnce();
+ expect(icon.smallIcon()).andReturn(SMALL_JPG).atLeastOnce();
replay(log, utils, componentElement, jaxb, annotation,icon);
processor.setIcon(model, icon);
verify(log, utils, componentElement, jaxb,annotation,icon );
@@ -210,9 +213,9 @@
@Test
public void testSetIcon1() throws Exception {
- Icon icon = createMock(Icon.class);
- expect(icon.large()).andReturn("").atLeastOnce();
- expect(icon.small()).andReturn("").atLeastOnce();
+ Description icon = createMock(Description.class);
+ expect(icon.largeIcon()).andReturn("").atLeastOnce();
+ expect(icon.smallIcon()).andReturn("").atLeastOnce();
replay(log, utils, componentElement, jaxb, annotation,icon);
processor.setIcon(model, icon);
verify(log, utils, componentElement, jaxb,annotation,icon );
@@ -227,14 +230,17 @@
expect(annotation.facets()).andReturn(new Facet[0]);
expect(property.getAnnotation(Facet.class)).andReturn(facet);
expect(property.getName()).andReturn("foo");
- expect(property.getDocComment()).andReturn("my comment");
+ expect(property.getDocComment()).andReturn("my comment").times(2);
expect(property.isExists()).andReturn(true);
- expect(facet.icon()).andReturn(null);
- expect(facet.displayName()).andReturn("fooFacet");
+ expect(facet.description()).andReturn(description);
expect(facet.generate()).andReturn(true);
- replay(log, utils, componentElement, jaxb, annotation,property,facet);
+ expect(this.description.smallIcon()).andReturn("");
+ expect(this.description.largeIcon()).andReturn("");
+ expect(this.description.displayName()).andReturn("fooFacet").times(2);
+ expect(this.description.value()).andReturn("");
+ replay(log, utils, componentElement, jaxb,
annotation,property,facet,description);
processor.processFacets(componentElement, model, annotation);
- verify(log, utils, componentElement, jaxb,annotation,property,facet);
+ verify(log, utils, componentElement,
jaxb,annotation,property,facet,description);
assertEquals(1, model.getFacets().size());
FacetModel facetModel = Iterables.getOnlyElement(model.getFacets());
assertTrue(facetModel.isGenerate());
@@ -250,12 +256,15 @@
expect(utils.getBeanPropertiesAnnotatedWith(eq(Facet.class),eq(ClassName.parseName(FOO_BAR)))).andReturn(Collections.<BeanProperty>emptySet());
expect(annotation.facets()).andReturn(new Facet[]{facet});
expect(facet.name()).andReturn("foo");
- expect(facet.icon()).andReturn(null);
- expect(facet.displayName()).andReturn("fooFacet");
+ expect(facet.description()).andReturn(this.description);
expect(facet.generate()).andReturn(true);
- replay(log, utils, componentElement, jaxb, annotation,property,facet);
+ expect(this.description.smallIcon()).andReturn("");
+ expect(this.description.largeIcon()).andReturn("");
+ expect(this.description.displayName()).andReturn("fooFacet").times(2);
+ expect(this.description.value()).andReturn("");
+ replay(log, utils, componentElement, jaxb,
annotation,property,facet,description);
processor.processFacets(componentElement, model, annotation);
- verify(log, utils, componentElement, jaxb,annotation,property,facet);
+ verify(log, utils, componentElement,
jaxb,annotation,property,facet,description);
assertEquals(1, model.getFacets().size());
FacetModel facetModel = Iterables.getOnlyElement(model.getFacets());
assertTrue(facetModel.isGenerate());
@@ -269,8 +278,6 @@
public void testProcessAttributesFromProperty() throws Exception {
Attribute attribute = createNiceMock(Attribute.class);
expect(componentElement.getQualifiedName()).andStubReturn(new
TestName(FOO_BAR));
-
expect(componentElement.getAnnotation(JsfComponent.class)).andReturn(annotation);
- expect(annotation.attributes()).andReturn(new String[0]);
utils.visitSupertypes(eq(ClassName.parseName(FOO_BAR)), (SuperTypeVisitor)
anyObject());expectLastCall();
expect(utils.getBeanPropertiesAnnotatedWith(eq(Attribute.class),eq(ClassName.parseName(FOO_BAR)))).andReturn(Collections.singleton(property));
expect(utils.getAbstractBeanProperties(eq(ClassName.parseName(FOO_BAR)))).andReturn(Collections.<BeanProperty>emptySet());
@@ -279,13 +286,16 @@
expect(property.getAnnotation(Attribute.class)).andReturn(attribute);
expect(property.getDocComment()).andReturn("my comment");
// expect(property.isExists()).andReturn(true);
- expect(attribute.icon()).andReturn(null);
- expect(attribute.displayName()).andReturn("fooFacet");
+ expect(attribute.description()).andReturn(this.description);
expect(attribute.generate()).andReturn(true);
expect(attribute.events()).andReturn(new EventName[]{});
- replay(log, utils, componentElement, jaxb, annotation,property,attribute);
- processor.processAttributes(componentElement, model);
- verify(log, utils, componentElement, jaxb,annotation,property,attribute);
+ expect(this.description.smallIcon()).andReturn("");
+ expect(this.description.largeIcon()).andReturn("");
+ expect(this.description.displayName()).andReturn("fooFacet").times(2);
+ expect(this.description.value()).andReturn("");
+ replay(log, utils, componentElement, jaxb,
annotation,property,attribute,description);
+ processor.processAttributes(componentElement, model,new String[0]);
+ verify(log, utils, componentElement,
jaxb,annotation,property,attribute,description);
assertEquals(1, model.getAttributes().size());
PropertyBase propertyModel = Iterables.getOnlyElement(model.getAttributes());
assertTrue(propertyModel.isGenerate());
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-03-30
12:31:35 UTC (rev 16685)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/java/org/richfaces/cdk/test/component/AbstractTestComponent.java 2010-03-30
23:44:36 UTC (rev 16686)
@@ -31,7 +31,7 @@
import org.richfaces.cdk.annotations.Family;
import org.richfaces.cdk.annotations.Fires;
import org.richfaces.cdk.annotations.Generate;
-import org.richfaces.cdk.annotations.Icon;
+import org.richfaces.cdk.annotations.Description;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.test.event.TestEvent;