Author: nbelaevski
Date: 2010-12-27 10:50:27 -0500 (Mon, 27 Dec 2010)
New Revision: 20812
Added:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKey.java
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKeyConverter.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeAdaptorRowKeyConverterRule.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelAdaptorHandler.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelRecursiveAdaptorHandler.java
Removed:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java
Modified:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java
trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/iteration-demo/src/main/webapp/treeModel.xhtml
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/RowKeyConverterRule.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelAdaptor.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelRecursiveAdaptor.java
Log:
https://issues.jboss.org/browse/RF-10047
https://issues.jboss.org/browse/RF-10038
https://issues.jboss.org/browse/RF-9995
https://issues.jboss.org/browse/RF-10007
Added:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKey.java
===================================================================
---
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKey.java
(rev 0)
+++
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKey.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.demo.model.tree.adaptors;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PackageKey {
+
+ private String packageName;
+
+ public PackageKey(String packageName) {
+ super();
+ this.packageName = packageName;
+ }
+
+ public String getPackageName() {
+ return packageName;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ PackageKey other = (PackageKey) obj;
+ if (packageName == null) {
+ if (other.packageName != null) {
+ return false;
+ }
+ } else if (!packageName.equals(other.packageName)) {
+ return false;
+ }
+ return true;
+ }
+
+
+}
Added:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKeyConverter.java
===================================================================
---
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKeyConverter.java
(rev 0)
+++
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/PackageKeyConverter.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.demo.model.tree.adaptors;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import com.google.common.base.Strings;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PackageKeyConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component, String value)
{
+ if (Strings.isNullOrEmpty(value)) {
+ return null;
+ }
+
+ return new PackageKey(value);
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value)
{
+ if (value == null) {
+ return "";
+ }
+
+ return ((PackageKey) value).getPackageName();
+ }
+
+}
Deleted:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java
===================================================================
---
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SimpleRecursiveNode.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.demo.model.tree.adaptors;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-/**
- * @author Nick Belaevski
- * @since 3.2
- */
-
-public class SimpleRecursiveNode {
-
- private SimpleRecursiveNode parent;
-
- private List<SimpleRecursiveNode> children = Lists.newArrayList();
-
- private String text;
-
- public SimpleRecursiveNode(SimpleRecursiveNode parent, String text) {
- super();
- this.parent = parent;
- if (parent != null) {
- parent.addChild(this);
- }
- this.text = text;
- }
-
- public void addChild(SimpleRecursiveNode node) {
- children.add(node);
- }
-
- public void removeChild(SimpleRecursiveNode node) {
- children.remove(node);
- }
-
- public void remove() {
- if (parent != null) {
- parent.removeChild(this);
- }
- }
-
- public SimpleRecursiveNode getParent() {
- return parent;
- }
-
- public List<SimpleRecursiveNode> getChildren() {
- return children;
- }
-
- public String getText() {
- return text;
- }
-}
Modified:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java
===================================================================
---
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/model/tree/adaptors/SourceDirectory.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -23,9 +23,13 @@
package org.richfaces.demo.model.tree.adaptors;
import java.util.List;
+import java.util.Map;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import com.google.common.collect.Maps;
+
/**
* @author Nick Belaevski
* mailto:nbelaevski@exadel.com
@@ -37,8 +41,19 @@
@XmlElement(name = "package")
private List<Package> packages;
- public List<Package> getPackages() {
- return packages;
+ @XmlTransient
+ private Map<PackageKey, Package> packagesMap;
+
+ public Map<PackageKey, Package> getPackages() {
+ if (packagesMap == null && packages != null) {
+ packagesMap = Maps.newLinkedHashMap();
+
+ for (Package pkg: packages) {
+ packagesMap.put(new PackageKey(pkg.getName()), pkg);
+ }
+ }
+
+ return packagesMap;
}
}
Modified: trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-12-27
15:41:34 UTC (rev 20811)
+++ trunk/examples/iteration-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-12-27
15:50:27 UTC (rev 20812)
@@ -1,7 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+
+ <converter>
+ <converter-id>org.richfaces.demo.PackageKeyConverter</converter-id>
+
<converter-class>org.richfaces.demo.model.tree.adaptors.PackageKeyConverter</converter-class>
+ </converter>
</faces-config>
Modified: trunk/examples/iteration-demo/src/main/webapp/treeModel.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/treeModel.xhtml 2010-12-27 15:41:34 UTC
(rev 20811)
+++ trunk/examples/iteration-demo/src/main/webapp/treeModel.xhtml 2010-12-27 15:50:27 UTC
(rev 20812)
@@ -32,7 +32,7 @@
<a4j:commandLink value="#{node}"
action="#{node.processClick}" />
</it:treeNode>
- <it:treeModelAdaptor nodes="#{node.packages}">
+ <it:treeModelAdaptor nodes="#{node.packages}"
rowKeyConverter="org.richfaces.demo.PackageKeyConverter">
<it:treeModelAdaptor nodes="#{node.classes}" />
</it:treeModelAdaptor>
</it:treeModelAdaptor>
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/RowKeyConverterRule.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/RowKeyConverterRule.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/view/facelets/RowKeyConverterRule.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -21,8 +21,6 @@
package org.richfaces.view.facelets;
-import org.richfaces.component.UIDataAdaptor;
-
import javax.faces.convert.Converter;
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.MetaRule;
@@ -30,6 +28,8 @@
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
+import org.richfaces.component.UIDataAdaptor;
+
/**
* Apply rowKeyConverter to component
*
@@ -39,13 +39,6 @@
public class RowKeyConverterRule extends MetaRule {
public static final RowKeyConverterRule INSTANCE = new RowKeyConverterRule();
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
@Override
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta)
{
if (meta.isTargetInstanceOf(UIDataAdaptor.class)) {
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeModelAdaptor.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -60,9 +60,7 @@
public void setRowKeyConverter(Converter converter) {
StateHelper stateHelper = getStateHelper();
- if (initialStateMarked()) {
- stateHelper.put(PropertyKeys.rowKeyConverterSet, Boolean.TRUE);
- }
+ stateHelper.put(PropertyKeys.rowKeyConverterSet, Boolean.TRUE);
this.rowKeyConverter = converter;
}
@@ -80,10 +78,10 @@
}
private boolean isSetRowKeyConverter() {
- return isSetLocalRowKeyConverter() ||
getValueExpression(PropertyKeys.rowKeyConverter.toString()) != null;
+ return isLocalRowKeyConverterSet() ||
getValueExpression(PropertyKeys.rowKeyConverter.toString()) != null;
}
- private boolean isSetLocalRowKeyConverter() {
+ private boolean isLocalRowKeyConverterSet() {
Boolean value = (Boolean) getStateHelper().get(PropertyKeys.rowKeyConverterSet);
return Boolean.TRUE.equals(value);
}
@@ -132,7 +130,7 @@
boolean converterHasPartialState = false;
if (initialStateMarked()) {
- if (!isSetLocalRowKeyConverter() && rowKeyConverter != null
&& rowKeyConverter instanceof PartialStateHolder) {
+ if (!isLocalRowKeyConverterSet() && rowKeyConverter != null
&& rowKeyConverter instanceof PartialStateHolder) {
// Delta
StateHolder holder = (StateHolder) rowKeyConverter;
if (!holder.isTransient()) {
@@ -145,7 +143,7 @@
} else {
converterState = null;
}
- } else if (isSetLocalRowKeyConverter() || rowKeyConverter != null) {
+ } else if (isLocalRowKeyConverterSet() || rowKeyConverter != null) {
// Full
converterState = saveAttachedState(context, rowKeyConverter);
nullDelta = false;
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeModelAdaptor.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -37,4 +37,6 @@
@Attribute
public Converter getRowKeyConverter();
+ public void setRowKeyConverter(Converter converter);
+
}
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelAdaptor.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelAdaptor.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelAdaptor.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -30,7 +30,7 @@
*/
@JsfComponent(type = UITreeModelAdaptor.COMPONENT_TYPE,
family = UITreeModelAdaptor.COMPONENT_FAMILY,
- tag = @Tag(name = "treeModelAdaptor"))
+ tag = @Tag(name = "treeModelAdaptor", handler =
"org.richfaces.view.facelets.TreeModelAdaptorHandler"))
public class UITreeModelAdaptor extends AbstractTreeModelAdaptor implements
TreeModelAdaptor {
public static final String COMPONENT_TYPE =
"org.richfaces.TreeModelAdaptor";
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelRecursiveAdaptor.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelRecursiveAdaptor.java 2010-12-27
15:41:34 UTC (rev 20811)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UITreeModelRecursiveAdaptor.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -30,7 +30,7 @@
*/
@JsfComponent(type = UITreeModelRecursiveAdaptor.COMPONENT_TYPE,
family = UITreeModelRecursiveAdaptor.COMPONENT_FAMILY,
- tag = @Tag(name = "treeModelRecursiveAdaptor"))
+ tag = @Tag(name = "treeModelRecursiveAdaptor", handler =
"org.richfaces.view.facelets.TreeModelRecursiveAdaptorHandler"))
public class UITreeModelRecursiveAdaptor extends AbstractTreeModelAdaptor implements
TreeModelRecursiveAdaptor {
public static final String COMPONENT_TYPE =
"org.richfaces.TreeModelRecursiveAdaptor";
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeAdaptorRowKeyConverterRule.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeAdaptorRowKeyConverterRule.java
(rev 0)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeAdaptorRowKeyConverterRule.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.view.facelets;
+
+import javax.faces.component.UIComponent;
+import javax.faces.convert.Converter;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.richfaces.component.TreeModelAdaptor;
+
+/**
+ */
+public class TreeAdaptorRowKeyConverterRule extends MetaRule {
+
+ public static final TreeAdaptorRowKeyConverterRule INSTANCE = new
TreeAdaptorRowKeyConverterRule();
+
+ @Override
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta)
{
+ if (meta.isTargetInstanceOf(TreeModelAdaptor.class)) {
+ if ("rowKeyConverter".equals(name)) {
+ if (attribute.isLiteral()) {
+ return new StaticConverterMetadata(attribute.getValue());
+ } else {
+ return new DynamicConverterMetaData(attribute);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ static final class DynamicConverterMetaData extends Metadata {
+ private final TagAttribute attribute;
+
+ public DynamicConverterMetaData(TagAttribute attribute) {
+ super();
+ this.attribute = attribute;
+ }
+
+ @Override
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIComponent) instance).setValueExpression("rowKeyConverter",
+ attribute.getValueExpression(ctx, Converter.class));
+ }
+ }
+
+ static final class StaticConverterMetadata extends Metadata {
+ private final String converterId;
+
+ public StaticConverterMetadata(String converterId) {
+ super();
+ this.converterId = converterId;
+ }
+
+ @Override
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ Converter converter =
ctx.getFacesContext().getApplication().createConverter(converterId);
+
+ ((TreeModelAdaptor) instance).setRowKeyConverter(converter);
+ }
+ }
+}
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelAdaptorHandler.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelAdaptorHandler.java
(rev 0)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelAdaptorHandler.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.view.facelets;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.MetaRuleset;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TreeModelAdaptorHandler extends ComponentHandler {
+
+ public TreeModelAdaptorHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRuleset = super.createMetaRuleset(type);
+ metaRuleset.addRule(TreeAdaptorRowKeyConverterRule.INSTANCE);
+ return metaRuleset;
+ }
+}
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelRecursiveAdaptorHandler.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelRecursiveAdaptorHandler.java
(rev 0)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/view/facelets/TreeModelRecursiveAdaptorHandler.java 2010-12-27
15:50:27 UTC (rev 20812)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.view.facelets;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.MetaRuleset;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TreeModelRecursiveAdaptorHandler extends ComponentHandler {
+
+ public TreeModelRecursiveAdaptorHandler(ComponentConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRuleset = super.createMetaRuleset(type);
+ metaRuleset.addRule(TreeAdaptorRowKeyConverterRule.INSTANCE);
+ return metaRuleset;
+ }
+}