Author: vkorluzhenko
Date: 2007-11-15 09:37:00 -0500 (Thu, 15 Nov 2007)
New Revision: 4003
Added:
trunk/docs/userguide/en/src/main/resources/images/tree5.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
http://jira.jboss.com/jira/browse/RF-740 - Added example of usage of DnD attributes. Added
description for example and picture.
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-11-15 13:47:43 UTC
(rev 4002)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-11-15 14:37:00 UTC
(rev 4003)
@@ -175,8 +175,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[<h: outputText
value="#{varAttributeName}">
- ]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[<h: outputText
value="#{varAttributeName}">]]></programlisting>
<para>
<property>"varAttributeName"</property> is a value
for <emphasis>
@@ -290,7 +289,7 @@
<f:facet name="iconLeaf">
<h:graphicImage value="/images/tree/song.gif " />
</f:facet>
- ...
+ ...
</rich:tree>
...]]></programlisting>
@@ -373,6 +372,52 @@
</tbody>
</tgroup>
</table>
+
+ <para>An example of usage is placed below.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ <h:form>
+ <rich:tree dragIndicator=":treeDragIndicator"
dropListener="#{libraryAjaxTree.processDrop}" style="width:300px"
value="#{libraryAjaxTree.data}" var="item"
nodeFace="#{item.type}">
+ <rich:treeNode type="artist" acceptedTypes="album"
iconLeaf="/images/tree/group.gif" icon="/images/tree/group.gif">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" dragType="album"
acceptedTypes="song" iconLeaf="/images/tree/cd.gif"
icon="/images/tree/cd.gif">
+ <h:outputText value="#{item.title}" />
+ <rich:dndParam name="label" type="drag"
value="Album: #{item.title}" />
+ </rich:treeNode>
+ <rich:treeNode type="song" dragType="song"
iconLeaf="/images/tree/music.gif" icon="/images/tree/music.gif">
+ <h:outputText value="#{item.title}" />
+ <rich:dndParam name="label" type="drag"
value="Song: #{item.title}" />
+ </rich:treeNode>
+ </rich:tree>
+ </h:form>
+...]]></programlisting>
+
+ <para>In the example a song from one album can be dragged into other because
for the second
+ <property>treeNode</property> with <emphasis>
+ <property>"type"</property>
+ </emphasis>="album" was defined attribute <emphasis>
+ <property>"acceptedTypes"</property>
+ </emphasis>="song". Its value is equal to the value of
the<emphasis>
+ <property>"type"</property>
+ </emphasis>attribute defined for the third treeNode (see picture below).
+ Also an album can be dragged into <property>treeNode</property> with
<emphasis>
+ <property>"type"</property>
+ </emphasis>="artist".</para>
+
+ <figure>
+ <title>DnD operations</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tree5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
</section>
<section>
<title>Events handling</title>
@@ -412,44 +457,43 @@
handlers of <property>treeNode</property> capture events occured on
<property>treeNode</property> only, except for children events.
</para>
</section>
-
+
<section>
<title>Look-and-Feel Customization</title>
-
+
<para>For skinnability implementation, the components use a <emphasis>
- <property>style class redefinition method.</property>
- </emphasis> Default style classes are mapped on <emphasis>
- <property>skin parameters.</property>
- </emphasis></para>
-
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+
<para>There are two ways to redefine the appearance of all <emphasis
role="bold">
- <property><rich:tree></property>
- </emphasis> components at once:</para>
-
+ <property><rich:tree></property>
+ </emphasis> components at once:</para>
+
<itemizedlist>
<listitem>
<para>Redefine the corresponding skin parameters</para>
</listitem>
-
+
<listitem>
<para>Add to your style sheets <emphasis>
- <property>style classes</property>
- </emphasis> used by a <emphasis role="bold">
- <property><rich:tree></property>
- </emphasis> component</para>
+ <property>style classes</property>
+ </emphasis> used by a <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component</para>
</listitem>
</itemizedlist>
</section>
-
+
<section>
<title>Skin Parameters Redefinition:</title>
- <para>There is only one skin parameter for <emphasis
- role="bold">
- <property><rich:tree></property>
- </emphasis>. As it's a wrapper component for <emphasis
- role="bold">
- <property><rich:treeNode></property>
- </emphasis> components, look and feel customization is described in the
<link linkend="SPRofTN">corresponding section.</link></para>
+ <para>There is only one skin parameter for <emphasis
role="bold">
+ <property><rich:tree></property>
+ </emphasis>. As it's a wrapper component for <emphasis
role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components, look and feel customization is described in the
<link
+ linkend="SPRofTN">corresponding section.</link></para>
<table>
<title>Skin parameters for a wrapper element</title>
<tgroup cols="2">
Added: trunk/docs/userguide/en/src/main/resources/images/tree5.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/tree5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream