Author: alexsmirnov
Date: 2009-11-11 20:28:45 -0500 (Wed, 11 Nov 2009)
New Revision: 15866
Modified:
root/cdk/trunk/plugins/generator/pom.xml
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
Log:
add tag and attributes to renderer model.
Modified: root/cdk/trunk/plugins/generator/pom.xml
===================================================================
--- root/cdk/trunk/plugins/generator/pom.xml 2009-11-11 23:44:55 UTC (rev 15865)
+++ root/cdk/trunk/plugins/generator/pom.xml 2009-11-12 01:28:45 UTC (rev 15866)
@@ -168,7 +168,7 @@
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
- <version>1.0-rc2</version>
+ <version>1.0-rc3</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-11-11
23:44:55 UTC (rev 15865)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-11-12
01:28:45 UTC (rev 15866)
@@ -42,7 +42,7 @@
* @author asmirnov(a)exadel.com
*
*/
-public abstract class ModelCollection<E extends ModelElement<E, K>, K extends
Key>
+public abstract class ModelCollection<E extends ModelElement<? super E, K>, K
extends Key>
implements SearchableCollection<E, K>, Visitable,
Mergeable<SearchableCollection<E, K>> {
private final BiMap<K, E> elementsMap = HashBiMap.create();
private final BiMap<E, K> reverseMap = elementsMap.inverse();
@@ -107,7 +107,7 @@
@Override
public boolean contains(Object o) {
if (o instanceof ModelElement<?, ?>) {
- K key = ((ModelElement<E, K>) o).getKey();
+ K key = ((ModelElement<?, K>) o).getKey();
return elementsMap.containsKey(key);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-11-11
23:44:55 UTC (rev 15865)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-11-12
01:28:45 UTC (rev 15866)
@@ -25,7 +25,6 @@
package org.richfaces.cdk.model;
-import org.richfaces.builder.model.JavaClass;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.templatecompiler.model.Template;
@@ -40,7 +39,24 @@
private ClassDescription rendererClass;
private Template template;
private Type type;
+
+ private boolean rendersChildren;
+
+ private Tag tag;
+ /**
+ * <p class="changed_added_4_0">
+ * Component attributes
+ * </p>
+ */
+ private final SearchableCollection<Attribute, Property.Name> attributes = new
ModelCollection<Attribute,
+
Property.Name>() {
+ @Override
+ public Attribute create(Property.Name key) {
+ return new Attribute(key);
+ }
+ };
+
public Renderer() {}
public Renderer(Type type) {
@@ -117,6 +133,46 @@
this.rendererClass = rendererClass;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the rendersChildren
+ */
+ public boolean isRendersChildren() {
+ return this.rendersChildren;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param rendersChildren the rendersChildren to set
+ */
+ public void setRendersChildren(boolean rendersChildren) {
+ this.rendersChildren = rendersChildren;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the attributes
+ */
+ public SearchableCollection<Attribute, Property.Name> getAttributes() {
+ return this.attributes;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the tag
+ */
+ public Tag getTag() {
+ return this.tag;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param tag the tag to set
+ */
+ public void setTag(Tag tag) {
+ this.tag = tag;
+ }
+
@Override
public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
return visitor.visit(this, param);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-11-11
23:44:55 UTC (rev 15865)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-11-12
01:28:45 UTC (rev 15866)
@@ -21,31 +21,43 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+package org.richfaces.cdk.xmlconfig.model;
+import java.util.List;
-package org.richfaces.cdk.xmlconfig.model;
-
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.richfaces.cdk.model.Attribute;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.ConfigExtension;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.Tag;
+import com.google.common.collect.Lists;
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
@XmlType(name = "faces-config-rendererType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
-public class RendererBean extends ExtensibleBean<RendererBean.RendererExtension> {
+public class RendererBean extends
+ ExtensibleBean<RendererBean.RendererExtension> {
+
+ private List<Attribute> attributes = Lists.newArrayList();
private String family;
private ClassDescription rendererClass;
private String type;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the type
*/
@XmlElement(name = "renderer-type", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -54,15 +66,20 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param type
+ * the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the family
*/
@XmlElement(name = "component-family", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -71,15 +88,20 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param family the family to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param family
+ * the family to set
*/
public void setFamily(String family) {
this.family = family;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the rendererClass
*/
@XmlElement(name = "renderer-class", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -89,15 +111,42 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param rendererClass the rendererClass to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param rendererClass
+ * the rendererClass to set
*/
public void setRendererClass(ClassDescription rendererClass) {
this.rendererClass = rendererClass;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the attributes
+ */
+ @XmlElement(name = "attribute", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE, type = AttributeBean.class)
+ public List<Attribute> getAttributes() {
+ return this.attributes;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param attributes
+ * the attributes to set
+ */
+ public void setAttributes(List<Attribute> attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the extension
*/
@XmlElement(name = "renderer-extension", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
@@ -111,9 +160,59 @@
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
- public static class RendererExtension extends ConfigExtension {}
+ public static class RendererExtension extends ConfigExtension {
+ private Tag tag;
+
+ private boolean rendersChildren;
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the tag
+ */
+ @XmlElement(name = "tag", namespace =
ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public Tag getTag() {
+ return this.tag;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param tag
+ * the tag to set
+ */
+ public void setTag(Tag tag) {
+ this.tag = tag;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the rendersChildren
+ */
+ @XmlElement(name = "renders-children", namespace =
ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public boolean isRendersChildren() {
+ return this.rendersChildren;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param rendersChildren
+ * the rendersChildren to set
+ */
+ public void setRendersChildren(boolean rendersChildren) {
+ this.rendersChildren = rendersChildren;
+ }
+ }
}