Author: nbelaevski
Date: 2007-07-30 09:32:06 -0400 (Mon, 30 Jul 2007)
New Revision: 1921
Added:
trunk/sandbox/samples/treeModelDemo/
trunk/sandbox/samples/treeModelDemo/pom.xml
trunk/sandbox/samples/treeModelDemo/src/
trunk/sandbox/samples/treeModelDemo/src/main/
trunk/sandbox/samples/treeModelDemo/src/main/java/
trunk/sandbox/samples/treeModelDemo/src/main/java/org/
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Class.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Directory.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Entry.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/File.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Package.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Project.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/SourceDirectory.java
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/service/
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/service/Loader.java
trunk/sandbox/samples/treeModelDemo/src/main/resources/
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/model/
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/model/tree-model-data.xml
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/digester-rules.dtd
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/tree-model-rules.xml
trunk/sandbox/samples/treeModelDemo/src/main/webapp/
trunk/sandbox/samples/treeModelDemo/src/main/webapp/META-INF/
trunk/sandbox/samples/treeModelDemo/src/main/webapp/META-INF/MANIFEST.MF
trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/
trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/treeModelDemo/src/main/webapp/index.jsp
trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/
trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/treeModelDemo/src/test/
trunk/sandbox/samples/treeModelDemo/src/test/java/
trunk/sandbox/samples/treeModelDemo/src/test/java/org/
trunk/sandbox/samples/treeModelDemo/src/test/java/org/richfaces/
trunk/sandbox/samples/treeModelDemo/src/test/java/org/richfaces/BeanTest.java
trunk/sandbox/ui/treeModel/
trunk/sandbox/ui/treeModel/pom.xml
trunk/sandbox/ui/treeModel/src/
trunk/sandbox/ui/treeModel/src/main/
trunk/sandbox/ui/treeModel/src/main/config/
trunk/sandbox/ui/treeModel/src/main/config/component/
trunk/sandbox/ui/treeModel/src/main/config/component/README
trunk/sandbox/ui/treeModel/src/main/config/component/recursiveTreeNodes.xml
trunk/sandbox/ui/treeModel/src/main/config/component/treeNodes.xml
trunk/sandbox/ui/treeModel/src/main/java/
trunk/sandbox/ui/treeModel/src/main/java/org/
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/README
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodes.java
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UITreeNodes.java
trunk/sandbox/ui/treeModel/src/main/resources/
trunk/sandbox/ui/treeModel/src/main/templates/
trunk/sandbox/ui/treeModel/src/main/templates/README
trunk/sandbox/ui/treeModel/src/main/templates/org/
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlRecursiveTreeNodes.jspx
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeNodes.jspx
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeRecursion.jspx
trunk/sandbox/ui/treeModel/src/test/
trunk/sandbox/ui/treeModel/src/test/java/
trunk/sandbox/ui/treeModel/src/test/java/org/
trunk/sandbox/ui/treeModel/src/test/java/org/richfaces/
trunk/sandbox/ui/treeModel/src/test/java/org/richfaces/component/
trunk/sandbox/ui/treeModel/src/test/java/org/richfaces/component/JSFComponentTest.java
Modified:
trunk/sandbox/samples/pom.xml
trunk/sandbox/ui/pom.xml
trunk/sandbox/ui/scrollable-grid/
Log:
TreeModel components initial import
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-07-30 13:21:11 UTC (rev 1920)
+++ trunk/sandbox/samples/pom.xml 2007-07-30 13:32:06 UTC (rev 1921)
@@ -18,5 +18,6 @@
<module>panel2-sample</module>
<module>simpleTogglePanel2-sample</module>
<module>rich-message-demo </module>
+ <module>treeModelDemo</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/samples/treeModelDemo
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/samples/treeModelDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/treeModelDemo/pom.xml (rev 0)
+++ trunk/sandbox/samples/treeModelDemo/pom.xml 2007-07-30 13:32:06 UTC (rev 1921)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>treeModelDemo</artifactId>
+ <packaging>war</packaging>
+ <name>Tree Model Maven Webapp</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>treeModel</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>tree</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>treeModelDemo</finalName>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/TreeModelBean.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,18 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import org.richfaces.component.UITree;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 25.07.2007
+ *
+ */
+public class TreeModelBean {
+ public Boolean adviseNodeOpened(UITree tree) {
+ return Boolean.TRUE;
+ }
+}
Added: trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Class.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Class.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Class.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,14 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 25.07.2007
+ *
+ */
+public class Class extends Entry {
+}
Added:
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Directory.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Directory.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Directory.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 24.07.2007
+ *
+ */
+public class Directory extends Entry {
+ private List directories = new ArrayList();
+ private List files = new ArrayList();;
+
+ public List getDirectories() {
+ return directories;
+ }
+
+ public void setDirectories(List directories) {
+ this.directories = directories;
+ }
+
+ public List getFiles() {
+ return files;
+ }
+
+ public void setFiles(List files) {
+ this.files = files;
+ }
+
+ public void addDir(Directory directory) {
+ this.directories.add(directory);
+ directory.setParent(this);
+ }
+
+ public void addFile(File file) {
+ this.files.add(file);
+ file.setParent(this);
+ }
+}
Added: trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Entry.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Entry.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Entry.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,54 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 29.07.2007
+ *
+ */
+public class Entry {
+ private String name;
+ private Entry parent;
+
+ public String getPath() {
+ StringBuffer result = new StringBuffer();
+
+ Entry parent = getParent();
+ if (parent != null) {
+ result.append(parent.getPath());
+ result.append(" -> ");
+ }
+
+ result.append(this.toString());
+
+ return result.toString();
+ }
+
+ public String toString() {
+ return this.getClass().getSimpleName() + "[" + name + "]";
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Entry getParent() {
+ return parent;
+ }
+
+ public void setParent(Entry parent) {
+ this.parent = parent;
+ }
+
+ public void click() {
+ System.out.println("Entry.click() " + getPath());
+ }
+}
Added: trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/File.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/File.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/File.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,13 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 25.07.2007
+ *
+ */
+public class File extends Entry {
+}
Added: trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Package.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Package.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Package.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,30 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 25.07.2007
+ *
+ */
+public class Package extends Entry {
+ private List classes = new ArrayList();
+
+ public List getClasses() {
+ return classes;
+ }
+
+ public void setClasses(List classes) {
+ this.classes = classes;
+ }
+
+ public void addClass(Class clazz) {
+ this.classes.add(clazz);
+ clazz.setParent(this);
+ }
+}
Added: trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Project.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Project.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/Project.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,45 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 24.07.2007
+ *
+ */
+public class Project extends Entry {
+ private List srcDirs = new ArrayList();
+
+ public List getSrcDirs() {
+ return srcDirs;
+ }
+
+ public void setSrcDirs(List srcDirs) {
+ this.srcDirs = srcDirs;
+ }
+
+ public void addSrcDir(SourceDirectory directory) {
+ this.srcDirs.add(directory);
+ directory.setParent(this);
+ }
+
+ public void addDir(Directory directory) {
+ this.dirs.add(directory);
+ directory.setParent(this);
+ }
+
+ private List dirs = new ArrayList();
+
+ public List getDirs() {
+ return dirs;
+ }
+
+ public void setDirs(List dirs) {
+ this.dirs = dirs;
+ }
+}
Added:
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/SourceDirectory.java
===================================================================
---
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/SourceDirectory.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/model/SourceDirectory.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,30 @@
+/**
+ *
+ */
+package org.richfaces.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 24.07.2007
+ *
+ */
+public class SourceDirectory extends Directory {
+ private List packages = new ArrayList();
+
+ public List getPackages() {
+ return packages;
+ }
+
+ public void setPackages(List packages) {
+ this.packages = packages;
+ }
+
+ public void addPackage(Package pkg) {
+ this.packages.add(pkg);
+ pkg.setParent(this);
+ }
+}
Added:
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/service/Loader.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/service/Loader.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/java/org/richfaces/service/Loader.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,53 @@
+/**
+ *
+ */
+package org.richfaces.service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.FacesException;
+
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.xmlrules.DigesterLoader;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Nick Belaevski mailto:nbelaevski@exadel.com created 25.07.2007
+ *
+ */
+public class Loader {
+ private List projects;
+
+ public synchronized List getProjects() {
+ if (projects == null) {
+ projects = Loader.load();
+ }
+ return projects;
+ }
+
+ private static List load() throws FacesException {
+ URL url = Loader.class.getResource("tree-model-rules.xml");
+ Digester digester = DigesterLoader.createDigester(url);
+ List list = new ArrayList();
+ digester.push(list);
+ InputStream stream =
Loader.class.getResourceAsStream("/org/richfaces/model/tree-model-data.xml");
+ try {
+ digester.parse(stream);
+ return list;
+ } catch (IOException e) {
+ throw new FacesException(e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new FacesException(e.getMessage(), e);
+ } finally {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+ }
+}
Added:
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/model/tree-model-data.xml
===================================================================
---
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/model/tree-model-data.xml
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/model/tree-model-data.xml 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root>
+ <project name="ajax4jsf">
+ <sourceDirectory name="src/main/java">
+ <package name="org.ajax4jsf">
+ <class name="FastFilter.java" />
+ <class name="Filter.java" />
+ </package>
+ <package name="org.ajax4jsf.component">
+ <class name="UIDataAdaptor.java" />
+ <class name="AjaxActionComponent.java" />
+ </package>
+ <package name="org.ajax4jsf.renderkit">
+ <class name="AjaxChildrenRenderer.java" />
+ <class name="AjaxComponentRendererBase.java" />
+ </package>
+ </sourceDirectory>
+ <sourceDirectory name="src/main/resources">
+ <package name="org.ajax4jsf">
+ </package>
+ <package name="org.ajax4jsf.javascript">
+ </package>
+ </sourceDirectory>
+ </project>
+
+ <project name="richfaces">
+ <sourceDirectory name="src/main/java">
+ <package name="org.richfaces">
+ </package>
+ <package name="org.richfaces.component">
+ </package>
+ <package name="org.richfaces.model">
+ </package>
+ </sourceDirectory>
+ <sourceDirectory name="src/main/resources">
+ <package name="org.richfaces">
+ </package>
+ <package name="org.richfaces.renderkit">
+ </package>
+ </sourceDirectory>
+ <sourceDirectory name="target/generated/java">
+ <package name="org.richfaces">
+ </package>
+ <package name="org.richfaces.component">
+ </package>
+ <package name="org.richfaces.renderkit">
+ </package>
+ </sourceDirectory>
+ <directory name="design">
+ <directory name="funcspec">
+ <file name="FunctionalSpecification-1.0.doc" />
+ <file name="Requirements-1.0.doc" />
+ </directory>
+ </directory>
+ <directory name="src">
+ <directory name="main">
+ <directory name="config">
+ <directory name="org">
+ <directory name="richfaces">
+ <directory name="component">
+ <file name="tree.config.xml" />
+ <file name="treeNode.config.xml" />
+ </directory>
+ </directory>
+ </directory>
+ </directory>
+ <directory name="templates"></directory>
+ </directory>
+ <directory name="test"></directory>
+ </directory>
+ <directory name="target">
+ <directory name="generated-component">
+ </directory>
+ <directory name="surefire-reports">
+ <file name="org.richfaces.JSFComponentTest.txt" />
+ <file name="TEST-ComponentTest.xml" />
+ </directory>
+ <file name="richfaces-3.1.0-snapshot" />
+ <file name="richfaces-3.1.0-sources" />
+ <file name="richfaces-3.1.0-javadoc" />
+ </directory>
+ </project>
+</root>
\ No newline at end of file
Added:
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/digester-rules.dtd
===================================================================
---
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/digester-rules.dtd
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/digester-rules.dtd 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+ "Digester" component of the Jakarta Commons Subproject
+ DTD for the definition of Digester rules in XML.
+ $Id: digester-rules.dtd,v 1.8 2003/03/27 18:54:45 rdonkin Exp $
+-->
+
+<!-- This document type defines an XML format for defining Digester rules.
+ Digester is a framework for pattern-matching-based parsing of XML into
+ Java objects. See
http://jakarta.apache.org/commons/digester.html. -->
+
+<!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule |
call-param-rule |
+ factory-create-rule | object-create-rule |
+ set-properties-rule | set-property-rule | set-top-rule |
+ set-next-rule" >
+
+<!-- digester-rules is the root element. -->
+<!ELEMENT digester-rules (pattern | include | bean-property-setter-rule |
call-method-rule | call-param-rule | factory-create-rule | object-create-rule |
set-properties-rule | set-property-rule | set-top-rule | set-next-rule )*>
+
+
+<!-- <pattern> defines a matching pattern, or part of a matching pattern. Any
+ rule nested in a pattern element prepends its parent's to its pattern.
+ Patterns may be recursively nested.
+ Example:
+ <pattern value="foo">
+ <pattern value="bar">
+ <object-create-rule pattern="baz" classname="Fubar"
/>
+ </pattern>
+ </pattern>
+
+ The above sample fragment defines an ObjectCreateRule associated
+ with the pattern "foo/bar/baz".
+
+ Note that the use of pattern elements is optional; an alternative is for
+ each rule element to contain a 'pattern' attribute. -->
+<!ELEMENT pattern (pattern | include | bean-property-setter-rule | call-method-rule |
call-param-rule |
+ factory-create-rule | object-create-rule |
+ set-properties-rule | set-property-rule | set-top-rule |
+ set-next-rule )*>
+<!ATTLIST pattern
+ value CDATA #REQUIRED>
+
+
+<!--
+ <include> allows one set of digester rules to be included inside
+ another. The 'path' attribute contains the URI of the document to
+ include. Inclusion behaves as if the included rules document is
+ 'macro-expanded' within the outer document.
+ Programmatically initialized rules can be included as well, via the
+ 'class' attribute. The 'class' attribute should contain the name
+ of a class that implements
+ org.apache.commons.digester.xmlrules.DigesterRulesSource.
+-->
+<!ELEMENT include EMPTY>
+<!ATTLIST include
+ path CDATA #IMPLIED
+ class CDATA #IMPLIED>
+
+
+<!-- Each 'rule' element below corresponds to a concrete subclass
+ of org.apache.framework.digester.Rule.
+ Each 'rule' element has an optional 'pattern' attribute, which
+ defines the pattern for that rule instance. If the rule element
+ is nested inside one or more <pattern> elements, those patterns
+ will be prepended to the pattern specified in the rule's 'pattern'
+ attribute. -->
+
+<!-- Bean Property Setter Rule -->
+<!ELEMENT bean-property-setter-rule EMPTY>
+<!ATTLIST bean-property-setter-rule
+ pattern CDATA #IMPLIED
+ propertyname CDATA #IMPLIED>
+
+<!-- CallMethodRule -->
+<!ELEMENT call-method-rule EMPTY>
+<!ATTLIST call-method-rule
+ pattern CDATA #IMPLIED
+ methodname CDATA #REQUIRED
+ paramcount CDATA #IMPLIED
+ paramtypes CDATA #IMPLIED>
+
+<!--
+ CallParamRule
+ attrname - set param from attribute value (cannot be combined with from-stack)
+ from-stack - set param from stack (cannot be combined with attrname)
+ -->
+<!ELEMENT call-param-rule EMPTY>
+<!ATTLIST call-param-rule
+ pattern CDATA #IMPLIED
+ paramnumber CDATA #REQUIRED
+ attrname CDATA #IMPLIED
+ from-stack CDATA #IMPLIED>
+
+<!--
+ FactoryCreateRule
+
+ ignore-exceptions - if this attribute is (ignore case) 'true' then any
exceptions
+ thrown by the object create rule will be ignore.
+ This will allow processing to continue.
+ -->
+<!ELEMENT factory-create-rule EMPTY>
+<!ATTLIST factory-create-rule
+ pattern CDATA #IMPLIED
+ classname CDATA #REQUIRED
+ attrname CDATA #IMPLIED
+ ignore-exceptions CDATA #IMPLIED>
+
+<!-- ObjectCreateRule -->
+<!ELEMENT object-create-rule EMPTY>
+<!ATTLIST object-create-rule
+ pattern CDATA #IMPLIED
+ classname CDATA #REQUIRED
+ attrname CDATA #IMPLIED>
+
+<!-- SetPropertiesRule -->
+<!ELEMENT set-properties-rule (alias)*>
+<!ATTLIST factory-create-rule
+ pattern CDATA #IMPLIED>
+
+<!-- An alias is a custom attribute->property name mapping -->
+<!ELEMENT alias EMPTY>
+<!ATTLIST alias
+ attr-name CDATA #REQUIRED
+ prop-name CDATA #IMPLIED>
+
+<!-- SetPropertyRule -->
+<!ELEMENT set-property-rule EMPTY>
+<!ATTLIST set-property-rule
+ pattern CDATA #IMPLIED
+ name CDATA #IMPLIED
+ value CDATA #IMPLIED>
+
+<!-- SetTopRule -->
+<!ELEMENT set-top-rule EMPTY>
+<!ATTLIST set-top-rule
+ pattern CDATA #IMPLIED
+ methodname CDATA #REQUIRED
+ paramtype CDATA #IMPLIED>
+
+<!-- SetNextRule -->
+<!ELEMENT set-next-rule EMPTY>
+<!ATTLIST set-next-rule
+ pattern CDATA #IMPLIED
+ methodname CDATA #REQUIRED
+ paramtype CDATA #IMPLIED>
Added:
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/tree-model-rules.xml
===================================================================
---
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/tree-model-rules.xml
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/resources/org/richfaces/service/tree-model-rules.xml 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+<!DOCTYPE digester-rules SYSTEM "digester-rules.dtd">
+ -->
+
+<digester-rules>
+ <pattern value="*/project">
+ <object-create-rule classname="org.richfaces.model.Project" />
+ <set-next-rule methodname="add" />
+ <set-properties-rule>
+ <alias attr-name="name" prop-name="name" />
+ </set-properties-rule>
+ </pattern>
+
+ <pattern value="*/sourceDirectory">
+ <object-create-rule classname="org.richfaces.model.SourceDirectory" />
+ <set-next-rule methodname="addSrcDir" />
+ <set-properties-rule>
+ <alias attr-name="name" prop-name="name" />
+ </set-properties-rule>
+ </pattern>
+
+ <pattern value="*/directory">
+ <object-create-rule classname="org.richfaces.model.Directory" />
+ <set-next-rule methodname="addDir" />
+ <set-properties-rule>
+ <alias attr-name="name" prop-name="name" />
+ </set-properties-rule>
+ </pattern>
+
+ <pattern value="*/file">
+ <object-create-rule classname="org.richfaces.model.File" />
+ <set-next-rule methodname="addFile" />
+ <set-properties-rule>
+ <alias attr-name="name" prop-name="name" />
+ </set-properties-rule>
+ </pattern>
+
+ <pattern value="*/package">
+ <object-create-rule classname="org.richfaces.model.Package" />
+ <set-next-rule methodname="addPackage" />
+ <set-properties-rule>
+ <alias attr-name="name" prop-name="name" />
+ </set-properties-rule>
+ </pattern>
+
+ <pattern value="*/class">
+ <object-create-rule classname="org.richfaces.model.Class" />
+ <set-next-rule methodname="addClass" />
+ <set-properties-rule>
+ <alias attr-name="name" prop-name="name" />
+ </set-properties-rule>
+ </pattern>
+</digester-rules>
\ No newline at end of file
Added: trunk/sandbox/samples/treeModelDemo/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/sandbox/samples/treeModelDemo/src/main/webapp/META-INF/MANIFEST.MF 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Added: trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
+
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+
+ <managed-bean>
+ <managed-bean-name>treeModelBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.TreeModelBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>loaderBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.service.Loader</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added: trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/sandbox/samples/treeModelDemo/src/main/webapp/WEB-INF/web.xml 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <!-- context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param-->
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/treeModelDemo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/webapp/index.jsp
(rev 0)
+++ trunk/sandbox/samples/treeModelDemo/src/main/webapp/index.jsp 2007-07-30 13:32:06 UTC
(rev 1921)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.jsp
(rev 0)
+++ trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.jsp 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,79 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/treeModel"
prefix="model" %>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/tree"
prefix="tree" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <tree:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}"
switchType="client">
+ <model:treeNodes id="project" nodes="#{loaderBean.projects}"
var="project">
+ <tree:treeNode>
+ <h:commandLink action="#{project.click}" value="Project:
#{project.name}" />
+ </tree:treeNode>
+
+ <model:treeNodes id="srcDir" var="srcDir"
nodes="#{project.srcDirs}">
+ <tree:treeNode>
+ <h:commandLink action="#{srcDir.click}" value="Source
directory: #{srcDir.name}" />
+ </tree:treeNode>
+
+ <model:treeNodes id="pkg" var="pkg"
nodes="#{srcDir.packages}">
+ <tree:treeNode>
+ <h:commandLink action="#{pkg.click}" value="Package:
#{pkg.name}" />
+ </tree:treeNode>
+
+ <model:treeNodes id="class" var="class"
nodes="#{pkg.classes}">
+ <tree:treeNode>
+ <h:commandLink action="#{class.click}" value="Class:
#{class.name}" />
+ </tree:treeNode>
+ </model:treeNodes>
+ </model:treeNodes>
+
+ <model:treeNodes id="pkg1" var="pkg"
nodes="#{srcDir.packages}">
+ <tree:treeNode>
+ <h:commandLink action="#{pkg.click}" value="Package1:
#{pkg.name}" />
+ </tree:treeNode>
+
+ <model:treeNodes id="class1" var="class"
nodes="#{pkg.classes}">
+ <tree:treeNode>
+ <h:commandLink action="#{class.click}" value="Class1:
#{class.name}" />
+ </tree:treeNode>
+ </model:treeNodes>
+ </model:treeNodes>
+ </model:treeNodes>
+
+ <model:recursiveTreeNodes id="dir" var="dir"
+ root="#{project.dirs}" nodes="#{dir.directories}">
+ <tree:treeNode>
+ <h:commandLink action="#{dir.click}" value="Directory:
#{dir.name}" />
+ </tree:treeNode>
+
+ <model:treeNodes id="file" var="file"
nodes="#{dir.files}">
+ <tree:treeNode>
+ <h:commandLink action="#{file.click}" value="File:
#{file.name}" />
+ </tree:treeNode>
+ </model:treeNodes>
+
+ <model:treeNodes id="file1" var="file"
nodes="#{dir.files}">
+ <tree:treeNode>
+ <h:commandLink action="#{file.click}" value="File1:
#{file.name}" />
+ </tree:treeNode>
+ </model:treeNodes>
+ </model:recursiveTreeNodes>
+
+ <%--model:treeNodes var="file"
nodes="#{proj.dir.files}">
+ <tree:treeNode>
+ <h:outputText value="File: #{file.name}" />
+ </tree:treeNode>
+ </model:treeNodes--%>
+ </model:treeNodes>
+ </tree:tree>
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.xhtml
(rev 0)
+++ trunk/sandbox/samples/treeModelDemo/src/main/webapp/pages/index.xhtml 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,12 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+ >
+ <f:view>
+
+ </f:view>
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/treeModelDemo/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/treeModelDemo/src/test/java/org/richfaces/BeanTest.java
(rev 0)
+++
trunk/sandbox/samples/treeModelDemo/src/test/java/org/richfaces/BeanTest.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-07-30 13:21:11 UTC (rev 1920)
+++ trunk/sandbox/ui/pom.xml 2007-07-30 13:32:06 UTC (rev 1921)
@@ -17,5 +17,6 @@
<module>scrollable-grid</module>
<module>simpleTogglePanel2</module>
<module>message</module>
+ <module>treeModel</module>
</modules>
</project>
\ No newline at end of file
Property changes on: trunk/sandbox/ui/scrollable-grid
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
bin
Property changes on: trunk/sandbox/ui/treeModel
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: trunk/sandbox/ui/treeModel/pom.xml
===================================================================
--- trunk/sandbox/ui/treeModel/pom.xml (rev 0)
+++ trunk/sandbox/ui/treeModel/pom.xml 2007-07-30 13:32:06 UTC (rev 1921)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>treeModel</artifactId>
+ <name>Tree Model</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>generate-tests</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>tree-model</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>tree</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
+
Added: trunk/sandbox/ui/treeModel/src/main/config/component/README
===================================================================
Added: trunk/sandbox/ui/treeModel/src/main/config/component/recursiveTreeNodes.xml
===================================================================
--- trunk/sandbox/ui/treeModel/src/main/config/component/recursiveTreeNodes.xml
(rev 0)
+++ trunk/sandbox/ui/treeModel/src/main/config/component/recursiveTreeNodes.xml 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.RecursiveTreeNodes</name>
+ <family>org.richfaces.RecursiveTreeNodes</family>
+ <classname>org.richfaces.component.html.HtmlRecursiveTreeNodes</classname>
+ <superclass>org.richfaces.component.UIRecursiveTreeNodes</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <!-- renderer generate="true" override="true">
+ <name>org.richfaces.RecursiveTreeNodesRenderer</name>
+ <template>org/richfaces/htmlRecursiveTreeNodes.jspx</template>
+ </renderer -->
+ <tag>
+ <name>recursiveTreeNodes</name>
+ <classname>org.richfaces.taglib.RecursiveTreeNodesTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+ <property>
+ <name>var</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ </property>
+ <property elonly="true">
+ <name>nodes</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ </description>
+ </property>
+ <property elonly="true">
+ <name>root</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ </description>
+ </property>
+ </component>
+</components>
Added: trunk/sandbox/ui/treeModel/src/main/config/component/treeNodes.xml
===================================================================
--- trunk/sandbox/ui/treeModel/src/main/config/component/treeNodes.xml
(rev 0)
+++ trunk/sandbox/ui/treeModel/src/main/config/component/treeNodes.xml 2007-07-30 13:32:06
UTC (rev 1921)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.TreeNodes</name>
+ <family>org.richfaces.TreeNodes</family>
+ <classname>org.richfaces.component.html.HtmlTreeNodes</classname>
+ <superclass>org.richfaces.component.UITreeNodes</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <!-- renderer generate="false" override="true">
+ <name>org.richfaces.TreeNodesRenderer</name>
+ <template>org/richfaces/htmlTreeNodes.jspx</template>
+ </renderer -->
+ <tag>
+ <name>treeNodes</name>
+ <classname>org.richfaces.taglib.TreeNodesTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <!--
+ <property>
+ <name>param</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"default"</defaultvalue>
+ </property>
+ -->
+ <property>
+ <name>var</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ </property>
+ <property elonly="true">
+ <name>nodes</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ </description>
+ </property>
+ </component>
+</components>
Added: trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/README
===================================================================
Added:
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodes.java
===================================================================
---
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodes.java
(rev 0)
+++
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodes.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,144 @@
+/**
+ *
+ */
+
+package org.richfaces.component;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.richfaces.model.LastAwareArrayDataModel;
+import org.richfaces.model.StackingTreeModel;
+import org.richfaces.model.StackingTreeModelProvider;
+
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIRecursiveTreeNodes extends StackingTreeModelProvider {
+
+ private static final String COMPONENT_TYPE =
"org.richfaces.RecursiveTreeNodes";
+
+ private static final String COMPONENT_FAMILY =
"org.richfaces.RecursiveTreeNodes";
+
+ public abstract Object getRoot();
+ public abstract void setRoot(Object root);
+
+ public Object[] getRoots() {
+ List nodes = (List) getRoot();
+ Object[] roots;
+ if (nodes != null) {
+ roots = nodes.toArray();
+ } else {
+ roots = new Object[0];
+ }
+ return roots;
+ }
+
+ protected StackingTreeModel createStackingTreeModel() {
+ StackingTreeModel treeModel = new StackingTreeModel(getId()) {
+
+ private Object varObject;
+
+ public void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last)
+ throws IOException {
+
+ Object var = getAttributes().get("var");
+ Map map = context.getExternalContext().getRequestMap();
+ Object varObject = map.get(var);
+
+ super.walk(context, dataVisitor, range, rowKey, argument, last);
+
+ map.put(var, varObject);
+ }
+
+ public void setupModel(Object object) {
+ super.setupModel(object);
+ Object var = getAttributes().get("var");
+
+ Map map = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+ varObject = map.get(var);
+ map.put(var, object);
+ componentSelected(UIRecursiveTreeNodes.this);
+ }
+
+ public void leaveModel() {
+ super.leaveModel();
+ Object var = getAttributes().get("var");
+
+ Map map = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+ map.put(var, varObject);
+ }
+
+ public ExtendedDataModel getDataModel() {
+ return new LastAwareArrayDataModel(getRoots());
+ }
+
+ public Map getModels() {
+ LinkedHashMap models = new LinkedHashMap();
+ models.putAll(super.getModels());
+ StackingTreeModel model = new StackingTreeModel(getId()) {
+
+ private Object varObject;
+
+ public void walk(FacesContext context, DataVisitor dataVisitor,
+ Range range, Object rowKey, Object argument, boolean last)
+ throws IOException {
+
+ Object var = getAttributes().get("var");
+ Map map = context.getExternalContext().getRequestMap();
+ Object varObject = map.get(var);
+
+ super.walk(context, dataVisitor, range, rowKey, argument, last);
+
+ map.put(var, varObject);
+ }
+
+ public void setupModel(Object object) {
+ super.setupModel(object);
+ Object var = getAttributes().get("var");
+
+ Map map = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+ varObject = map.get(var);
+ map.put(var, object);
+ componentSelected(UIRecursiveTreeNodes.this);
+ }
+
+ public void leaveModel() {
+ super.leaveModel();
+ Object var = getAttributes().get("var");
+
+ Map map = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+ map.put(var, varObject);
+ }
+
+ public ExtendedDataModel getDataModel() {
+ return new LastAwareArrayDataModel(getData());
+ }
+
+ public Map getModels() {
+ LinkedHashMap models = new LinkedHashMap();
+ models.putAll(this.parent.getModels());
+
+ return models;
+ }
+ };
+ model.setParent(this);
+ models.put(getId(), model);
+
+ return models;
+ }
+ };
+
+ return treeModel;
+ }
+}
Added: trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UITreeNodes.java
===================================================================
--- trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UITreeNodes.java
(rev 0)
+++
trunk/sandbox/ui/treeModel/src/main/java/org/richfaces/component/UITreeNodes.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+
+package org.richfaces.component;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.richfaces.model.LastAwareArrayDataModel;
+import org.richfaces.model.StackingTreeModel;
+import org.richfaces.model.StackingTreeModelProvider;
+
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UITreeNodes extends StackingTreeModelProvider {
+
+ private static final String COMPONENT_TYPE = "org.richfaces.TreeNodes";
+
+ private static final String COMPONENT_FAMILY = "org.richfaces.TreeNodes";
+
+ protected StackingTreeModel createStackingTreeModel() {
+ StackingTreeModel treeModel = new StackingTreeModel(getId()) {
+ public void setupModel(Object object) {
+ super.setupModel(object);
+ Map map = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+ map.put(getAttributes().get("var"), object);
+ componentSelected(UITreeNodes.this);
+ }
+
+ public ExtendedDataModel getDataModel() {
+ return new LastAwareArrayDataModel(getData());
+ }
+ };
+
+ return treeModel;
+ }
+}
Added: trunk/sandbox/ui/treeModel/src/main/templates/README
===================================================================
Added:
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlRecursiveTreeNodes.jspx
===================================================================
---
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlRecursiveTreeNodes.jspx
(rev 0)
+++
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlRecursiveTreeNodes.jspx 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+
xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c="
http://java.sun.com/jsf/core"
+ xmlns:ui="
http://ajax4jsf.org/cdk/ui"
+ xmlns:u="
http://ajax4jsf.org/cdk/u"
+ xmlns:x="
http://ajax4jsf.org/cdk/x"
+ class="org.richfaces.renderkit.html.RecursiveTreeNodesRenderer"
+ baseclass="org.ajax4jsf.framework.renderer.AjaxComponentRendererBase"
+ component="org.richfaces.component.UIRecursiveTreeNodes"
+ >
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}"
+ x:passThruWithExclusions="value,name,type,id"
+ >
+ </div>
+</f:root>
\ No newline at end of file
Added: trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeNodes.jspx
===================================================================
--- trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeNodes.jspx
(rev 0)
+++
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeNodes.jspx 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+
xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c="
http://java.sun.com/jsf/core"
+ xmlns:ui="
http://ajax4jsf.org/cdk/ui"
+ xmlns:u="
http://ajax4jsf.org/cdk/u"
+ xmlns:x="
http://ajax4jsf.org/cdk/x"
+ class="org.richfaces.renderkit.html.TreeNodesRenderer"
+ baseclass="org.ajax4jsf.framework.renderer.AjaxComponentRendererBase"
+ component="org.richfaces.component.UITreeNodes"
+ >
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}"
+ x:passThruWithExclusions="value,name,type,id"
+ >
+ </div>
+</f:root>
\ No newline at end of file
Added: trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeRecursion.jspx
===================================================================
--- trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeRecursion.jspx
(rev 0)
+++
trunk/sandbox/ui/treeModel/src/main/templates/org/richfaces/htmlTreeRecursion.jspx 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+
xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c="
http://java.sun.com/jsf/core"
+ xmlns:ui="
http://ajax4jsf.org/cdk/ui"
+ xmlns:u="
http://ajax4jsf.org/cdk/u"
+ xmlns:x="
http://ajax4jsf.org/cdk/x"
+ class="org.richfaces.renderkit.html.TreeRecursionRenderer"
+ baseclass="org.ajax4jsf.framework.renderer.AjaxComponentRendererBase"
+ component="org.richfaces.component.UITreeRecursion"
+ >
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}"
+ x:passThruWithExclusions="value,name,type,id"
+ >
+ </div>
+</f:root>
\ No newline at end of file
Added:
trunk/sandbox/ui/treeModel/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
---
trunk/sandbox/ui/treeModel/src/test/java/org/richfaces/component/JSFComponentTest.java
(rev 0)
+++
trunk/sandbox/ui/treeModel/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-07-30
13:32:06 UTC (rev 1921)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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.component;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import javax.faces.component.UIComponent;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}