Author: SeanRogers
Date: 2011-02-01 01:40:03 -0500 (Tue, 01 Feb 2011)
New Revision: 21346
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.xml_sample
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
Log:
Added tree adaptors RFPL-976
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2011-01-31
23:13:58 UTC (rev 21345)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2011-02-01
06:40:03 UTC (rev 21346)
@@ -14,30 +14,6 @@
Read this chapter for details on components that use tree structures.
</para>
- <!-- TODO not in M5 -->
- <!--
- <section id="sect-Component_Reference-Trees-richchangeExpandListener">
- <title><sgmltag><rich:changeExpandListener></sgmltag></title>
- <para>
- Incomplete
- </para>
- </section>
-
- <section id="sect-Component_Reference-Trees-richnodeSelectListener">
- <title><sgmltag><rich:nodeSelectListener></sgmltag></title>
- <para>
- Incomplete
- </para>
- </section>
-
- <section
id="sect-Component_Reference-Trees-richrecursiveTreeNodesAdapter">
- <title><sgmltag><rich:recursiveTreeNodesAdapter></sgmltag></title>
- <para>
- Incomplete
- </para>
- </section>
- -->
-
<section id="sect-Component_Reference-Trees-richtree">
<title><sgmltag><rich:tree></sgmltag></title>
<para>
@@ -394,14 +370,120 @@
</section>
</section>
- <!--
- <section id="sect-Component_Reference-Trees-richtreeNodesAdapter">
- <title><sgmltag><rich:treeNodesAdapter></sgmltag></title>
+ <section id="sect-Component_Reference-Trees-Tree_adaptors">
+ <title>Tree adaptors</title>
<para>
- Incomplete
+ Use a tree adaptor to create a tree and populate it with data from a defined data
model.
</para>
+
+ <section
id="sect-Component_Reference-Tree_adaptors-richtreeModelAdaptor">
+ <title><sgmltag><rich:treeModelAdaptor></sgmltag></title>
+ <para>
+ The <sgmltag><rich:treeModelAdaptor></sgmltag> component
takes a defined data model and uses it to populate an associated
<sgmltag><rich:tree></sgmltag> component.
+ </para>
+
+ <section
id="sect-Component_Reference-richtreeModelAdaptor-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <sgmltag><rich:treeModelAdaptor></sgmltag> component
is added as a nested child component to the
<sgmltag><rich:tree></sgmltag> component it will populate.
+ </para>
+ <para>
+ The <sgmltag><rich:treeModelAdaptor></sgmltag> component
requires the <varname>nodes</varname> attribute for basic usage. The
<varname>nodes</varname> attribute defines a collection of elements to iterate
through for populating the tree.
+ </para>
+ </section>
+
+ <section
id="sect-Component_Reference-richtreeModelAdaptor-Multiple_levels">
+ <title>Multiple levels</title>
+ <para>
+ <sgmltag><rich:treeModelAdaptor></sgmltag> components can
further be nested in other
<sgmltag><rich:treeModelAdaptor></sgmltag> components to
subsequently populate lower levels of the tree.
+ </para>
+ <para>
+ Use the <varname>var</varname> attribute to access the current
collection element at each level. <xref
linkend="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components"
/> demonstrates a series of nested
<sgmltag><rich:treeModelAdaptor></sgmltag> components, each
using the parent's <varname>var</varname> attribute to reference the
current element.
+ </para>
+ <example
id="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components">
+ <title><sgmltag>Nested <rich:treeModelAdaptor>
components</sgmltag></title>
+ <programlisting language="XML" role="XML"><xi:include
parse="text"
href="extras/exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </example>
+ </section>
+
+ <section
id="sect-Component_Reference-richtreeModelAdaptor-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>:
<classname>org.richfaces.treeModelAdaptor</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>:
<classname>org.richfaces.component.html.HtmltreeModelAdaptor</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>:
<classname>org.richfaces.treeModelAdaptor</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>:
<classname>org.richfaces.taglib.treeModelAdaptorTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
+ <section
id="sect-Component_Reference-Tree_adaptors-richtreeModelRecursiveAdaptor">
+ <title><sgmltag><rich:treeModelRecursiveAdaptor></sgmltag></title>
+ <para>
+ The <sgmltag><rich:treeModelRecursiveAdaptor></sgmltag>
component recursively populates a tree with hierarchical nodes, such as for a file system
with multiple levels of directories and files.
+ </para>
+
+ <section
id="sect-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <sgmltag><rich:treeModelRecursiveAdaptor></sgmltag>
component is an extension of the
<sgmltag><rich:treeModelAdaptor></sgmltag> component. As such,
the <sgmltag><rich:treeModelRecursiveAdaptor></sgmltag>
component uses all of the same attributes. Refer to <xref
linkend="sect-Component_Reference-Tree_adaptors-richtreeModelAdaptor" /> for
details on the <sgmltag><rich:treeModelAdaptor></sgmltag>
component.
+ </para>
+ <para>
+ In addition, the
<sgmltag><rich:treeModelRecursiveAdaptor></sgmltag> component
requires the <varname>root</varname> attribute. The
<varname>root</varname> attribute defines the collection to use at the top of
the recursion.
+ </para>
+ <para>
+ <xref
linkend="exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage"
/> demonstrates how the
<sgmltag><rich:treeModelRecursiveAdaptor></sgmltag> component
can be used in conjunction with the
<sgmltag><rich:treeModelAdaptor></sgmltag> component to
recursively iterate through a file system and create a tree of directories and files.
+ </para>
+ <example
id="exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage">
+ <title>Basic usage</title>
+ <programlisting language="XML" role="XML"><xi:include
parse="text"
href="extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </example>
+ </section>
+
+ <section
id="sect-Component_Reference-richtreeModelRecursiveAdaptor-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>:
<classname>org.richfaces.treeModelRecursiveAdaptor</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>:
<classname>org.richfaces.component.html.HtmltreeModelRecursiveAdaptor</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>:
<classname>org.richfaces.treeModelRecursiveAdaptor</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>:
<classname>org.richfaces.taglib.treeModelRecursiveAdaptorTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
</section>
- -->
</chapter>
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components.xml_sample
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components.xml_sample
(rev 0)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components.xml_sample 2011-02-01
06:40:03 UTC (rev 21346)
@@ -0,0 +1,22 @@
+<rich:tree>
+ <rich:treeNodesAdaptor id="project"
nodes="#{loaderBean.projects}" var="project">
+ <rich:treeNode>
+ <h:commandLink action="#{project.click}" value="Project:
#{project.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor id="srcDir" var="srcDir"
nodes="#{project.srcDirs}">
+ <rich:treeNode>
+ <h:commandLink action="#{srcDir.click}" value="Source
directory: #{srcDir.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor id="pkg" var="pkg"
nodes="#{srcDir.packages}">
+ <rich:treeNode>
+ <h:commandLink action="#{pkg.click}" value="Package:
#{pkg.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor id="class" var="class"
nodes="#{pkg.classes}">
+ <rich:treeNode>
+ <h:commandLink action="#{class.click}" value="Class:
#{class.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+</rich:tree>
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.xml_sample
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.xml_sample
(rev 0)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.xml_sample 2011-02-01
06:40:03 UTC (rev 21346)
@@ -0,0 +1,10 @@
+<rich:tree var="item">
+ <rich:treeModelRecursiveAdaptor roots="#{fileSystemBean.sourceRoots}"
nodes="#{item.directories}" >
+ <rich:treeNode>
+ #{item.shortPath}
+ </rich:treeNode>
+ <rich:treeModelAdaptor nodes="#{item.files}">
+ <rich:treeNode>#{item}</rich:treeNode>
+ </rich:treeModelAdaptor>
+ </rich:treeModelRecursiveAdaptor>
+</rich:tree>