JBoss Rich Faces SVN: r2835 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-09-10 09:53:36 -0400 (Mon, 10 Sep 2007)
New Revision: 2835
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarIcon.java
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
Log:
http://jira.jboss.com/jira/browse/RF-870
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarIcon.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarIcon.java 2007-09-10 13:39:11 UTC (rev 2834)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarIcon.java 2007-09-10 13:53:36 UTC (rev 2835)
@@ -90,8 +90,6 @@
return null;
}
- byte[] ret = new byte[6];
- Zipper2 zipper2 = new Zipper2(ret).addColor(HtmlColor.decode(headerTextColor).getRGB());
skinParameter = "selectControlColor";
String headerBackgroundColor = (String) skin.getParameter(context, skinParameter);
@@ -102,6 +100,8 @@
return null;
}
+ byte[] ret = new byte[6];
+ Zipper2 zipper2 = new Zipper2(ret).addColor(HtmlColor.decode(headerTextColor).getRGB());
zipper2.addColor(HtmlColor.decode(headerBackgroundColor).getRGB());
return ret;
@@ -121,83 +121,11 @@
}
public void paint(ResourceContext context, Graphics2D graphics) {
+
Object[] stored = (Object[]) restoreData(context);
-
if (stored != null) {
-
Dimension dim = getDimensions(context);
- BufferedImage image = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
-
- Graphics2D g2d = image.createGraphics();
-
- Color borderColor = (Color) stored[0];//new Color(((Integer) stored[0]).intValue());
- Color activeColor = (Color) stored[1];//new Color(((Integer) stored[1]).intValue());
-
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-
- g2d.setStroke(new BasicStroke(1));
-
- int w = 16;
- int h = 16;
-
-
- //Draw Border
- g2d.setColor(borderColor);
- Rectangle2D border = new Rectangle2D.Double(1, 1, w - 3, h - 3);
- RoundRectangle2D round = new RoundRectangle2D.Double(1, 1, w- 3, h - 3, 2, 2);
- g2d.draw(round);
-
- Color lightBlue = new Color(216, 226, 240);
- Paint gradient1 = new GradientPaint(w-4, h-4, lightBlue, 2, 2, Color.white);
- g2d.setPaint(gradient1);
- border = new Rectangle2D.Double(2, 2, w - 4, h - 4);
- g2d.fill(border);
-
- border = new Rectangle2D.Double(3, 3, w - 6, h - 6);
- gradient1 = new GradientPaint(3, 3, lightBlue , w - 6, h - 6, borderColor);
- g2d.setPaint(gradient1);
- g2d.fill(border);
-
- g2d.setColor(Color.white);
- g2d.drawLine(3, 6, 3, 11);
- g2d.drawLine(5, 6, 5, 11);
- g2d.drawLine(7, 6, 7, 11);
- g2d.drawLine(9, 6, 9, 11);
- g2d.drawLine(11, 6, 11, 11);
-
-
-
-
-
- //Draw orange rectangle
- border = new Rectangle2D.Double(3, 3, 10, 3);
- g2d.setColor(Color.white);
- g2d.fill(border);
-
- Color c = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 100);
- Color c2 = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 200);
-
- gradient1 = new GradientPaint(12, 4, activeColor, 4, 7, c2);
- g2d.setPaint(gradient1);
- g2d.fill(border);
- //g2d.setColor(activeColor);
-
- c = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 150);
- c2 = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 200);
- border = new Rectangle2D.Double(4, 4, 8, 1);
-
- g2d.setColor(Color.white);
- g2d.fill(border);
-
- gradient1 = new GradientPaint(4, 4, c, 10, 4, c2);
- //g2d.setPaint(gradient1);
- g2d.setColor(c);
- g2d.fill(border);
-
- g2d.dispose();
-
+ BufferedImage image = paintImage(stored);
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
graphics.drawImage(image, 0, 0, dim.width, dim.height, null);
@@ -206,4 +134,80 @@
}
+ protected BufferedImage paintImage(Object [] colors) {
+
+ BufferedImage image = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
+
+ Graphics2D g2d = image.createGraphics();
+
+ Color borderColor = (Color) colors[0];//new Color(((Integer) stored[0]).intValue());
+ Color activeColor = (Color) colors[1];//new Color(((Integer) stored[1]).intValue());
+
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+
+ g2d.setStroke(new BasicStroke(1));
+
+ int w = 16;
+ int h = 16;
+
+
+ //Draw Border
+ g2d.setColor(borderColor);
+ Rectangle2D border = new Rectangle2D.Double(1, 1, w - 3, h - 3);
+ RoundRectangle2D round = new RoundRectangle2D.Double(1, 1, w- 3, h - 3, 2, 2);
+ g2d.draw(round);
+
+ Color lightBlue = new Color(216, 226, 240);
+ Paint gradient1 = new GradientPaint(w-4, h-4, lightBlue, 2, 2, Color.white);
+ g2d.setPaint(gradient1);
+ border = new Rectangle2D.Double(2, 2, w - 4, h - 4);
+ g2d.fill(border);
+
+ border = new Rectangle2D.Double(3, 3, w - 6, h - 6);
+ gradient1 = new GradientPaint(3, 3, lightBlue , w - 6, h - 6, borderColor);
+ g2d.setPaint(gradient1);
+ g2d.fill(border);
+
+ g2d.setColor(Color.white);
+ g2d.drawLine(3, 6, 3, 11);
+ g2d.drawLine(5, 6, 5, 11);
+ g2d.drawLine(7, 6, 7, 11);
+ g2d.drawLine(9, 6, 9, 11);
+ g2d.drawLine(11, 6, 11, 11);
+
+
+
+
+
+ //Draw orange rectangle
+ border = new Rectangle2D.Double(3, 3, 10, 3);
+ g2d.setColor(Color.white);
+ g2d.fill(border);
+
+ Color c = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 100);
+ Color c2 = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 200);
+
+ gradient1 = new GradientPaint(12, 4, activeColor, 4, 7, c2);
+ g2d.setPaint(gradient1);
+ g2d.fill(border);
+ //g2d.setColor(activeColor);
+
+ c = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 150);
+ c2 = new Color(activeColor.getRed(), activeColor.getGreen(), activeColor.getBlue(), 200);
+ border = new Rectangle2D.Double(4, 4, 8, 1);
+
+ g2d.setColor(Color.white);
+ g2d.fill(border);
+
+ gradient1 = new GradientPaint(4, 4, c, 10, 4, c2);
+ //g2d.setPaint(gradient1);
+ g2d.setColor(c);
+ g2d.fill(border);
+
+ g2d.dispose();
+
+ return image;
+ }
}
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java 2007-09-10 13:39:11 UTC (rev 2834)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java 2007-09-10 13:53:36 UTC (rev 2835)
@@ -21,13 +21,10 @@
package org.richfaces.renderkit.html.iconimages;
-import javax.faces.context.FacesContext;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorConvertOp;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.Zipper2;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
/**
* @author Maksim Kaszynski
*
@@ -35,36 +32,14 @@
public class DisabledCalendarIcon extends CalendarIcon {
/* (non-Javadoc)
- * @see org.richfaces.renderkit.html.iconimages.CalendarIcon#getDataToStore(javax.faces.context.FacesContext, java.lang.Object)
+ * @see org.richfaces.renderkit.html.iconimages.CalendarIcon#paintImage(java.lang.Object[])
*/
- protected Object getDataToStore(FacesContext context, Object data) {
+ protected BufferedImage paintImage(Object[] colors) {
- Skin skin = SkinFactory.getInstance().getSkin(context);
- Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+ BufferedImage image = super.paintImage(colors);
- String skinParameter = "headerBackgroundColor";
- String headerTextColor = (String) skin.getParameter(context, skinParameter);
- if (null == headerTextColor || "".equals(headerTextColor))
- headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
+ image = new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null).filter(image, null);
- if (headerTextColor == null) {
- return null;
- }
-
-
- skinParameter = "tabDisabledTextColor";
- String headerBackgroundColor = (String) skin.getParameter(context, skinParameter);
- if (null == headerBackgroundColor || "".equals(headerBackgroundColor))
- headerBackgroundColor = (String) defaultSkin.getParameter(context, skinParameter);
-
- if(headerBackgroundColor == null){
- return null;
- }
-
- byte[] ret = new byte[6];
- Zipper2 zipper2 = new Zipper2(ret).addColor(HtmlColor.decode(headerTextColor).getRGB());
- zipper2.addColor(HtmlColor.decode(headerBackgroundColor).getRGB());
-
- return ret;
+ return image;
}
}
18 years, 8 months
JBoss Rich Faces SVN: r2833 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-09-10 09:11:04 -0400 (Mon, 10 Sep 2007)
New Revision: 2833
Added:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
Log:
http://jira.jboss.com/jira/browse/RF-870
Added: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java (rev 0)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java 2007-09-10 13:11:04 UTC (rev 2833)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * 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.renderkit.html.iconimages;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class DisabledCalendarIcon extends CalendarIcon {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.renderkit.html.iconimages.CalendarIcon#getDataToStore(javax.faces.context.FacesContext, java.lang.Object)
+ */
+ protected Object getDataToStore(FacesContext context, Object data) {
+
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+
+ String skinParameter = "headerBackgroundColor";
+ String headerTextColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerTextColor || "".equals(headerTextColor))
+ headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
+
+ if (headerTextColor == null) {
+ return null;
+ }
+
+
+ skinParameter = "tabDisabledTextColor";
+ String headerBackgroundColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerBackgroundColor || "".equals(headerBackgroundColor))
+ headerBackgroundColor = (String) defaultSkin.getParameter(context, skinParameter);
+
+ if(headerBackgroundColor == null){
+ return null;
+ }
+
+ byte[] ret = new byte[6];
+ Zipper2 zipper2 = new Zipper2(ret).addColor(HtmlColor.decode(headerTextColor).getRGB());
+ zipper2.addColor(HtmlColor.decode(headerBackgroundColor).getRGB());
+
+ return ret;
+ }
+}
18 years, 8 months
JBoss Rich Faces SVN: r2832 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-09-10 08:59:23 -0400 (Mon, 10 Sep 2007)
New Revision: 2832
Modified:
trunk/docs/userguide/en/src/main/docbook/included/status.xml
Log:
http://jira.jboss.com/jira/browse/RF-860
Modified: trunk/docs/userguide/en/src/main/docbook/included/status.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/status.xml 2007-09-10 11:08:00 UTC (rev 2831)
+++ trunk/docs/userguide/en/src/main/docbook/included/status.xml 2007-09-10 12:59:23 UTC (rev 2832)
@@ -95,10 +95,12 @@
</emphasis> component shows the status for the request fired from this action component.
</listitem>
</itemizedlist></para>
- <para>The component creates two <emphasis role="bold"><property><span></property></emphasis> elements with content defined for each status, one of the elements (start) is initially hidden. At the beginning of an Ajax request, elements state is inversed, hence the second element is shown and the first is hidden. At the end of a response processing, elements display states return to its initial values.</para>
+ <para>The component creates two <emphasis role="bold"><property><span></property></emphasis> or <emphasis role="bold"><property><div></property></emphasis>
+ elements depending on attribute "layout"
+ with content defined for each status, one of the elements (start) is initially hidden. At the beginning of an Ajax request, elements state is inversed, hence the second element is shown and the first is hidden. At the end of a response processing, elements display states return to its initial values.</para>
<para><emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="XML"><![CDATA[<a4j:status startText="Started" stopText="stopped" layout="block"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<a4j:status startText="Started" stopText="stopped" />]]></programlisting>
<para>is decoded on a page as:</para><programlisting role="XML"><![CDATA[<span id="j_id20:status.start" style="display: none">
Started
</span>
@@ -115,7 +117,7 @@
<para>There is a possibility to group a <emphasis role="bold"><property><a4j:status></property></emphasis> elements content into <emphasis role="bold"><property><div></property></emphasis> elements, instead of <emphasis role="bold"><property><span></property></emphasis>. To use it, just redefine the <emphasis >
<property>"layout"</property>
</emphasis>
-attribute from "incline"(default) to "block".</para>
+attribute from "inline"(default) to "block".</para>
</section>
<section>
<title>Relevant resources links</title>
18 years, 8 months
JBoss Rich Faces SVN: r2831 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-09-10 07:08:00 -0400 (Mon, 10 Sep 2007)
New Revision: 2831
Added:
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml
trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml
Removed:
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.xml
trunk/docs/userguide/en/src/main/docbook/included/treeNodes.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/treeNodes.xml
Log:
http://jira.jboss.com/jira/browse/RF-866
Deleted: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.desc.xml 2007-09-10 08:43:42 UTC (rev 2830)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.desc.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<section>
- <sectioninfo>
- <keywordset>
- <keyword>recursiveTreeNodes</keyword>
- </keywordset>
- </sectioninfo>
- <section>
- <title>Description</title>
- <para>
- The <property>rich:recursiveTreeNodes</property> provides possibility to define data models and process nodes recursively.
- </para>
-
- <figure>
- <title>Expanded tree with recursiveTreeNodes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/recursiveTreeNodes1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
- <listitem>Allows to define combined data models</listitem>
- <listitem>Possibility to define nodes for processing via attributes</listitem>
- <listitem>Allows to process nodes recursively</listitem>
- </itemizedlist>
- </section>
-</section>
Deleted: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.xml 2007-09-10 08:43:42 UTC (rev 2830)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -1,233 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<section>
- <sectioninfo>
- <keywordset>
- <keyword>recursiveTreeNodes</keyword>
- <keyword>rich:recursiveTreeNodes</keyword>
- <keyword>HtmlRecursiveTreeNodes</keyword>
- </keywordset>
- </sectioninfo>
-
- <table>
- <title>Component identification parameters </title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.RecursiveTreeNodes</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlRecursiveTreeNodes</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.RecursiveTreeNodes</entry>
- </row>
- <!--
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.EffectRenderer</entry>
- </row>
- -->
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.RecursiveTreeNodesTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <section>
- <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant of <property>rich:recursiveTreeNodes</property> on a page, use the
- following syntax:</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
- <rich:recursiveTreeNodes var="issue" root="#{project.root}" nodes="#{model.issues}">
- ...
- <rich:treeNode>
- <!-- node content -->
- </rich:treeNode>
-
- <!-- Others nodes -->
- ...
- </rich:recursiveTreeNodes>
-...
-]]></programlisting>
- </section>
-
- <section>
- <title>Creating the Component Dynamically Using Java</title>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlRecursiveTreeNodes;
-...
-HtmlRecursiveTreeNodes myRecursiveTreeNodes = new HtmlRecursiveTreeNodes();
-...
-]]></programlisting>
- </section>
-
- <section>
- <title>Details of Usage</title>
- <para>
- <emphasis role="bold">The typical variant of using:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
- <rich:treeNodes id="project" nodes="#{loaderBean.projects}" var="project">
-
- <rich:treeNode>
- <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
- </rich:treeNode>
-
- <rich:recursiveTreeNodes id="dir" var="dir" root="#{project.dirs}" nodes="#{dir.directories}">
-
- <rich:treeNode>
- <h:commandLink action="#{dir.click}" value="Directory: #{dir.name}" />
- </rich:treeNode>
-
- <rich:treeNodes id="file" var="file" nodes="#{dir.files}">
- <rich:treeNode>
- <h:commandLink action="#{file.click}" value="File: #{file.name}" />
- </rich:treeNode>
- </rich:treeNodes>
-
- <rich:treeNodes id="file1" var="file" nodes="#{dir.files}">
- <rich:treeNode>
- <h:commandLink action="#{file.click}" value="File1: #{file.name}" />
- </rich:treeNode>
- </rich:treeNodes>
-
- <rich:recursiveTreeNodes id="archiveEntry" var="archiveEntry"
- roots="#{dir.files}" nodes="#{archiveEntry.archiveEntries}"
- includedRoot="#{archiveEntry.class.simpleName == 'ArchiveFile'}"
- includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
-
- <rich:treeNode id="archiveEntryNode">
- <h:commandLink action="#{archiveEntry.click}" value="Archive entry: #{archiveEntry.name}" />
- </rich:treeNode>
-
- </rich:recursiveTreeNodes>
-
- </rich:recursiveTreeNodes>
- </rich:treeNodes>
-</rich:tree>
-...
-]]></programlisting>
-
- </section>
-<!--
- <section>
- <title>Details of Usage</title>
-<para>
- It is possible to use <property><rich:effect></property> in two modes:
-<itemizedlist>
- <listitem>attached to the JSF components or html tags and triggered by particular event.
- Wiring effect with JSF components might be occurs on the server or client.
- Wiring with html tag is possible only on the client side </listitem>
- <listitem>invoking from the javascript code by effect name.
- During the rendering, <property>rich:effect</property> generates the javascript function with defined name. When the function is called,
- the effect is applied </listitem>
-</itemizedlist>
-</para>
- <para>
- <emphasis role="bold">Those a the typical variants of using:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-
-<rich:panel>
- <rich:effect event="onmouseout" type="Opacity" params="duration:0.8,from:1.0,to:0.3" />
- .... panel content ....
-</rich:panel>
-...
-
-
-<div id="contentDiv">
- ..... div content ......
-</div>
-
-<input type="button" onclick="hideDiv({duration:0.7})" value="Hide" />
-<input type="button" onclick="showDiv()" value="Show" />
-
-<rich:effect name="hideDiv" for="contentDiv" type="Fade" />
-<rich:effect name="showDiv" for="contentDiv" type="Appear" />
-
-
-<rich:effect for="window" event="onload" type="Appear" params="id:'contentDiv',duration:0.8,from:0.3,to:1.0" />
-...
-]]></programlisting>
-
- <figure>
- <title>Initial:</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/effect1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <figure>
- <title>When the mouse cursor is over:</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/effect0.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-<para>
-<emphasis><property>"name"</property></emphasis> attribute defines the name of the javascript function will
-be generated on a page when the component is rendered. You can invoke this function to activate the effect. The function access one parameter.
-It is a set of effect options in JSON format.
-</para>
-
-<para>
-<emphasis><property>"type"</property></emphasis> attribute defines the type of effect. For example, "Fade", "Blind", "Opacity". Take a look at scriptaculous documentation
-for set of available effect.
-</para>
-
-<para>
-<emphasis><property>"for"</property></emphasis> attribute defines the id of the component or html tag, the effect will be attached to.
-Richfaces converts the <emphasis><property>"for"</property></emphasis> attribute value to the client id of the component if such component is found. If not, the value is left as is for possible
-wiring with on the DOM element's id on the client side.
-By default, the target of the effect is the same element that effect pointed to. However, the target element
-is might be overridden with <emphasis><property>"effectId"</property></emphasis> option passed with <emphasis><property>"params"</property></emphasis>
-attribute of with function paramenter.
-</para>
-
-<para>
-<emphasis><property>"params"</property></emphasis> attribute allows to define the set of options possible for particurar effect.
-For example, 'duration', 'delay', 'from', 'to'. Additionally to the options used by the effect itself, there are two option that might override
-the <property>rich:effect</property> attribute. Those are:
-<itemizedlist>
- <listitem><emphasis><property>"effectId"</property></emphasis> allows to re-define the target of effect.
- The option is overrire the value of <emphasis><property>"for"</property></emphasis> attribute</listitem>
- <listitem><emphasis><property>"effectType"</property></emphasis> defines the effect type.
- The option is overrire the value of <emphasis><property>"type"</property></emphasis> attribute</listitem>
-</itemizedlist>
-</para>
-
- </section>
- <section>
- <title>Relevant resources links</title>
- <para>
- <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/effect.jsf?c=effect">Here</ulink>
- you can see the example of <emphasis role="bold"><rich:effect></emphasis> usage. </para>
- </section>
-
- -->
-</section>
Copied: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml (from rev 2830, trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.desc.xml)
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.desc.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>recursiveTreeNodes</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>
+ The <property>rich:recursiveTreeNodes</property> provides possibility to define data models and process nodes recursively.
+ </para>
+
+ <figure>
+ <title>Expanded tree with recursiveTreeNodes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/recursiveTreeNodes1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Allows to define combined data models</listitem>
+ <listitem>Possibility to define nodes for processing via attributes</listitem>
+ <listitem>Allows to process nodes recursively</listitem>
+ </itemizedlist>
+ </section>
+</section>
Copied: trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml (from rev 2830, trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodes.xml)
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/recursiveTreeNodesAdaptor.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -0,0 +1,233 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>recursiveTreeNodes</keyword>
+ <keyword>rich:recursiveTreeNodes</keyword>
+ <keyword>HtmlRecursiveTreeNodes</keyword>
+ </keywordset>
+ </sectioninfo>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.RecursiveTreeNodes</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlRecursiveTreeNodes</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.RecursiveTreeNodes</entry>
+ </row>
+ <!--
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.EffectRenderer</entry>
+ </row>
+ -->
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.RecursiveTreeNodesTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>To create the simplest variant of <property>rich:recursiveTreeNodes</property> on a page, use the
+ following syntax:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:recursiveTreeNodes var="issue" root="#{project.root}" nodes="#{model.issues}">
+ ...
+ <rich:treeNode>
+ <!-- node content -->
+ </rich:treeNode>
+
+ <!-- Others nodes -->
+ ...
+ </rich:recursiveTreeNodes>
+...
+]]></programlisting>
+ </section>
+
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlRecursiveTreeNodes;
+...
+HtmlRecursiveTreeNodes myRecursiveTreeNodes = new HtmlRecursiveTreeNodes();
+...
+]]></programlisting>
+ </section>
+
+ <section>
+ <title>Details of Usage</title>
+ <para>
+ <emphasis role="bold">The typical variant of using:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
+ <rich:treeNodes id="project" nodes="#{loaderBean.projects}" var="project">
+
+ <rich:treeNode>
+ <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
+ </rich:treeNode>
+
+ <rich:recursiveTreeNodes id="dir" var="dir" root="#{project.dirs}" nodes="#{dir.directories}">
+
+ <rich:treeNode>
+ <h:commandLink action="#{dir.click}" value="Directory: #{dir.name}" />
+ </rich:treeNode>
+
+ <rich:treeNodes id="file" var="file" nodes="#{dir.files}">
+ <rich:treeNode>
+ <h:commandLink action="#{file.click}" value="File: #{file.name}" />
+ </rich:treeNode>
+ </rich:treeNodes>
+
+ <rich:treeNodes id="file1" var="file" nodes="#{dir.files}">
+ <rich:treeNode>
+ <h:commandLink action="#{file.click}" value="File1: #{file.name}" />
+ </rich:treeNode>
+ </rich:treeNodes>
+
+ <rich:recursiveTreeNodes id="archiveEntry" var="archiveEntry"
+ roots="#{dir.files}" nodes="#{archiveEntry.archiveEntries}"
+ includedRoot="#{archiveEntry.class.simpleName == 'ArchiveFile'}"
+ includedNode="#{archiveEntry.class.simpleName == 'ArchiveEntry'}">
+
+ <rich:treeNode id="archiveEntryNode">
+ <h:commandLink action="#{archiveEntry.click}" value="Archive entry: #{archiveEntry.name}" />
+ </rich:treeNode>
+
+ </rich:recursiveTreeNodes>
+
+ </rich:recursiveTreeNodes>
+ </rich:treeNodes>
+</rich:tree>
+...
+]]></programlisting>
+
+ </section>
+<!--
+ <section>
+ <title>Details of Usage</title>
+<para>
+ It is possible to use <property><rich:effect></property> in two modes:
+<itemizedlist>
+ <listitem>attached to the JSF components or html tags and triggered by particular event.
+ Wiring effect with JSF components might be occurs on the server or client.
+ Wiring with html tag is possible only on the client side </listitem>
+ <listitem>invoking from the javascript code by effect name.
+ During the rendering, <property>rich:effect</property> generates the javascript function with defined name. When the function is called,
+ the effect is applied </listitem>
+</itemizedlist>
+</para>
+ <para>
+ <emphasis role="bold">Those a the typical variants of using:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+
+<rich:panel>
+ <rich:effect event="onmouseout" type="Opacity" params="duration:0.8,from:1.0,to:0.3" />
+ .... panel content ....
+</rich:panel>
+...
+
+
+<div id="contentDiv">
+ ..... div content ......
+</div>
+
+<input type="button" onclick="hideDiv({duration:0.7})" value="Hide" />
+<input type="button" onclick="showDiv()" value="Show" />
+
+<rich:effect name="hideDiv" for="contentDiv" type="Fade" />
+<rich:effect name="showDiv" for="contentDiv" type="Appear" />
+
+
+<rich:effect for="window" event="onload" type="Appear" params="id:'contentDiv',duration:0.8,from:0.3,to:1.0" />
+...
+]]></programlisting>
+
+ <figure>
+ <title>Initial:</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/effect1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <figure>
+ <title>When the mouse cursor is over:</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/effect0.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+<para>
+<emphasis><property>"name"</property></emphasis> attribute defines the name of the javascript function will
+be generated on a page when the component is rendered. You can invoke this function to activate the effect. The function access one parameter.
+It is a set of effect options in JSON format.
+</para>
+
+<para>
+<emphasis><property>"type"</property></emphasis> attribute defines the type of effect. For example, "Fade", "Blind", "Opacity". Take a look at scriptaculous documentation
+for set of available effect.
+</para>
+
+<para>
+<emphasis><property>"for"</property></emphasis> attribute defines the id of the component or html tag, the effect will be attached to.
+Richfaces converts the <emphasis><property>"for"</property></emphasis> attribute value to the client id of the component if such component is found. If not, the value is left as is for possible
+wiring with on the DOM element's id on the client side.
+By default, the target of the effect is the same element that effect pointed to. However, the target element
+is might be overridden with <emphasis><property>"effectId"</property></emphasis> option passed with <emphasis><property>"params"</property></emphasis>
+attribute of with function paramenter.
+</para>
+
+<para>
+<emphasis><property>"params"</property></emphasis> attribute allows to define the set of options possible for particurar effect.
+For example, 'duration', 'delay', 'from', 'to'. Additionally to the options used by the effect itself, there are two option that might override
+the <property>rich:effect</property> attribute. Those are:
+<itemizedlist>
+ <listitem><emphasis><property>"effectId"</property></emphasis> allows to re-define the target of effect.
+ The option is overrire the value of <emphasis><property>"for"</property></emphasis> attribute</listitem>
+ <listitem><emphasis><property>"effectType"</property></emphasis> defines the effect type.
+ The option is overrire the value of <emphasis><property>"type"</property></emphasis> attribute</listitem>
+</itemizedlist>
+</para>
+
+ </section>
+ <section>
+ <title>Relevant resources links</title>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/effect.jsf?c=effect">Here</ulink>
+ you can see the example of <emphasis role="bold"><rich:effect></emphasis> usage. </para>
+ </section>
+
+ -->
+</section>
Deleted: trunk/docs/userguide/en/src/main/docbook/included/treeNodes.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/treeNodes.desc.xml 2007-09-10 08:43:42 UTC (rev 2830)
+++ trunk/docs/userguide/en/src/main/docbook/included/treeNodes.desc.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<section>
- <sectioninfo>
- <keywordset>
- <keyword>treeNodes</keyword>
- </keywordset>
- </sectioninfo>
- <section>
- <title>Description</title>
- <para>
- The <property>rich:treeNodes</property> provides possibility to define data models and create representations for them.
- </para>
-
- <figure>
- <title>Expanded tree with treeNodes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/treeNodes1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
- <section>
- <title>Key Features</title>
- <itemizedlist>
- <listitem>Allows to define combined data models</listitem>
- <listitem>Possibility to define nodes for processing via attributes</listitem>
- </itemizedlist>
- </section>
-</section>
Deleted: trunk/docs/userguide/en/src/main/docbook/included/treeNodes.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/treeNodes.xml 2007-09-10 08:43:42 UTC (rev 2830)
+++ trunk/docs/userguide/en/src/main/docbook/included/treeNodes.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -1,114 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<section>
- <sectioninfo>
- <keywordset>
- <keyword>treeNodes</keyword>
- <keyword>rich:treeNodes</keyword>
- <keyword>HtmlTreeNodes</keyword>
- </keywordset>
- </sectioninfo>
-
- <table>
- <title>Component identification parameters </title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.TreeNodes</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlTreeNodes</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.TreeNodes</entry>
- </row>
- <!--
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.EffectRenderer</entry>
- </row>
- -->
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.TreeNodesTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <section>
- <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant of <property>rich:treeNodes</property> on a page, use the
- following syntax:</para>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:treeNodes var="issue" nodes="#{model.issues}">
- ...
- <rich:treeNode>
- <!-- node content -->
- </rich:treeNode>
- ...
- <!-- Others nodes -->
- ...
-</rich:treeNodes>
-...
-]]></programlisting>
- </section>
-
- <section>
- <title>Creating the Component Dynamically Using Java</title>
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlTreeNodes;
-...
-HtmlTreeNodes myTreeNodes = new HtmlTreeNodes();
-...
-]]></programlisting>
- </section>
-
- <section>
- <title>Details of Usage</title>
- <para>
- <emphasis role="bold">The typical variant of using:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
- <rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
- <rich:treeNodes id="project" nodes="#{loaderBean.projects}" var="project">
- <rich:treeNode>
- <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
- </rich:treeNode>
- <rich:treeNodes id="srcDir" var="srcDir" nodes="#{project.srcDirs}">
- <rich:treeNode>
- <h:commandLink action="#{srcDir.click}" value="Source directory: #{srcDir.name}" />
- </rich:treeNode>
- <rich:treeNodes id="pkg" var="pkg" nodes="#{srcDir.packages}">
- <rich:treeNode>
- <h:commandLink action="#{pkg.click}" value="Package: #{pkg.name}" />
- </rich:treeNode>
- <rich:treeNodes id="class" var="class" nodes="#{pkg.classes}">
- <rich:treeNode>
- <h:commandLink action="#{class.click}" value="Class: #{class.name}" />
- </rich:treeNode>
- </rich:treeNodes>
- </rich:treeNodes>
- </rich:treeNodes>
- </rich:treeNodes>
- </rich:tree>
-...
-]]></programlisting>
-
- </section>
-</section>
Copied: trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.desc.xml (from rev 2830, trunk/docs/userguide/en/src/main/docbook/included/treeNodes.desc.xml)
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.desc.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>treeNodes</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>
+ The <property>rich:treeNodes</property> provides possibility to define data models and create representations for them.
+ </para>
+
+ <figure>
+ <title>Expanded tree with treeNodes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/treeNodes1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Allows to define combined data models</listitem>
+ <listitem>Possibility to define nodes for processing via attributes</listitem>
+ </itemizedlist>
+ </section>
+</section>
Copied: trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml (from rev 2830, trunk/docs/userguide/en/src/main/docbook/included/treeNodes.xml)
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/treeNodesAdaptor.xml 2007-09-10 11:08:00 UTC (rev 2831)
@@ -0,0 +1,114 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>treeNodes</keyword>
+ <keyword>rich:treeNodes</keyword>
+ <keyword>HtmlTreeNodes</keyword>
+ </keywordset>
+ </sectioninfo>
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.TreeNodes</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlTreeNodes</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.TreeNodes</entry>
+ </row>
+ <!--
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.EffectRenderer</entry>
+ </row>
+ -->
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.TreeNodesTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>To create the simplest variant of <property>rich:treeNodes</property> on a page, use the
+ following syntax:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:treeNodes var="issue" nodes="#{model.issues}">
+ ...
+ <rich:treeNode>
+ <!-- node content -->
+ </rich:treeNode>
+ ...
+ <!-- Others nodes -->
+ ...
+</rich:treeNodes>
+...
+]]></programlisting>
+ </section>
+
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlTreeNodes;
+...
+HtmlTreeNodes myTreeNodes = new HtmlTreeNodes();
+...
+]]></programlisting>
+ </section>
+
+ <section>
+ <title>Details of Usage</title>
+ <para>
+ <emphasis role="bold">The typical variant of using:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:tree adviseNodeOpened="#{treeModelBean.adviseNodeOpened}" switchType="client">
+ <rich:treeNodes id="project" nodes="#{loaderBean.projects}" var="project">
+ <rich:treeNode>
+ <h:commandLink action="#{project.click}" value="Project: #{project.name}" />
+ </rich:treeNode>
+ <rich:treeNodes id="srcDir" var="srcDir" nodes="#{project.srcDirs}">
+ <rich:treeNode>
+ <h:commandLink action="#{srcDir.click}" value="Source directory: #{srcDir.name}" />
+ </rich:treeNode>
+ <rich:treeNodes id="pkg" var="pkg" nodes="#{srcDir.packages}">
+ <rich:treeNode>
+ <h:commandLink action="#{pkg.click}" value="Package: #{pkg.name}" />
+ </rich:treeNode>
+ <rich:treeNodes id="class" var="class" nodes="#{pkg.classes}">
+ <rich:treeNode>
+ <h:commandLink action="#{class.click}" value="Class: #{class.name}" />
+ </rich:treeNode>
+ </rich:treeNodes>
+ </rich:treeNodes>
+ </rich:treeNodes>
+ </rich:treeNodes>
+ </rich:tree>
+...
+]]></programlisting>
+
+ </section>
+</section>
18 years, 8 months
JBoss Rich Faces SVN: r2830 - trunk/ui/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-09-10 04:43:42 -0400 (Mon, 10 Sep 2007)
New Revision: 2830
Modified:
trunk/ui/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
http://jira.jboss.com/jira/browse/RF-868
Modified: trunk/ui/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/ui/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-09-09 23:09:05 UTC (rev 2829)
+++ trunk/ui/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2007-09-10 08:43:42 UTC (rev 2830)
@@ -1,9 +1,3 @@
-/**
- * Enable log if defined variable 'LOG'
- */
-if(!LOG){
- var LOG = {a4j_debug:function(){}};
-}
if(!window.RichFaces) window.RichFaces = {};
if(!RichFaces.Menu) RichFaces.Menu = {};
18 years, 8 months
JBoss Rich Faces SVN: r2829 - in trunk/samples/richfaces-demo/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-09-09 19:09:05 -0400 (Sun, 09 Sep 2007)
New Revision: 2829
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml
Log:
Updates for "Hello world" tree
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java 2007-09-09 22:43:34 UTC (rev 2828)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java 2007-09-09 23:09:05 UTC (rev 2829)
@@ -26,10 +26,11 @@
import java.util.Properties;
import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import org.richfaces.component.UITree;
+import org.richfaces.event.NodeSelectedEvent;
import org.richfaces.model.TreeNode;
import org.richfaces.model.TreeNodeImpl;
@@ -37,7 +38,7 @@
private TreeNode rootNode = null;
- private UIComponent tree;
+ private String nodeTitle;
private static final String DATA_PATH = "/richfaces/tree/examples/simple-tree-data.properties";
@@ -94,12 +95,18 @@
return rootNode;
}
+
+ public void processSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ nodeTitle = (String) tree.getRowData();
+ }
- public UIComponent getTree() {
- return tree;
+ public String getNodeTitle() {
+ return nodeTitle;
}
+
+ public void setNodeTitle(String nodeTitle) {
+ this.nodeTitle = nodeTitle;
+ }
- public void setTree(UIComponent tree) {
- this.tree = tree;
- }
}
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-09-09 22:43:34 UTC (rev 2828)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-09-09 23:09:05 UTC (rev 2829)
@@ -162,7 +162,7 @@
<managed-bean>
<managed-bean-name>simpleTreeBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.tree.SimpleTreeBean</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>libraryAjaxTree</managed-bean-name>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml 2007-09-09 22:43:34 UTC (rev 2828)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml 2007-09-09 23:09:05 UTC (rev 2829)
@@ -6,12 +6,11 @@
xmlns:rich="http://richfaces.org/rich">
<h:form>
- <rich:tree style="width:300px" toggleOnClick="true" switchType="client" binding="#{simpleTreeBean.tree}" value="#{simpleTreeBean.treeNode}" var="item" nodeFace="#{simpleTreeBean.tree.leaf ? 'link' : null}">
- <rich:treeNode type="link">
- <a4j:commandLink value="#{item}" />
- </rich:treeNode>
-
+ <rich:tree style="width:300px" nodeSelectListener="#{simpleTreeBean.processSelection}" reRender="selectedNode" ajaxSubmitSelection="true" toggleOnClick="true" switchType="client" value="#{simpleTreeBean.treeNode}" var="item">
</rich:tree>
+
+ <h:outputText value="#{simpleTreeBean.nodeTitle}" id="selectedNode" />
+
</h:form>
</ui:composition>
\ No newline at end of file
18 years, 8 months
JBoss Rich Faces SVN: r2828 - trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-09-09 18:43:34 -0400 (Sun, 09 Sep 2007)
New Revision: 2828
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/IdentifierTreeNode.java
Log:
Tree-demo:
- drag-drop capabilities added
- "Hello world" demo added
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/IdentifierTreeNode.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/IdentifierTreeNode.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/IdentifierTreeNode.java 2007-09-09 22:43:34 UTC (rev 2828)
@@ -0,0 +1,28 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * 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.demo.tree;
+
+import org.richfaces.model.TreeNode;
+
+public interface IdentifierTreeNode extends TreeNode {
+ public long getId();
+}
18 years, 8 months
JBoss Rich Faces SVN: r2827 - in trunk/samples/richfaces-demo/src/main: webapp/WEB-INF and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-09-09 18:41:54 -0400 (Sun, 09 Sep 2007)
New Revision: 2827
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java
trunk/samples/richfaces-demo/src/main/webapp/images/tree/
trunk/samples/richfaces-demo/src/main/webapp/images/tree/cd.gif
trunk/samples/richfaces-demo/src/main/webapp/images/tree/group.gif
trunk/samples/richfaces-demo/src/main/webapp/images/tree/music.gif
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/simple-tree.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Song.java
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml
Log:
Tree-demo:
- drag-drop capabilities added
- "Hello world" demo added
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Album.java 2007-09-09 22:41:54 UTC (rev 2827)
@@ -6,7 +6,7 @@
import org.richfaces.model.TreeNode;
-public class Album implements TreeNode {
+public class Album implements IdentifierTreeNode {
/**
*
*/
@@ -23,9 +23,9 @@
public void addSong(Song song) {
addChild(Long.toString(song.getId()), song);
- song.setParent(this);
}
public void addChild(Object identifier, TreeNode child) {
+ child.setParent(this);
songs.put(identifier, child);
}
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Artist.java 2007-09-09 22:41:54 UTC (rev 2827)
@@ -6,7 +6,7 @@
import org.richfaces.model.TreeNode;
-public class Artist implements TreeNode {
+public class Artist implements IdentifierTreeNode {
private long id;
private Map albums = new HashMap();
private String name;
@@ -24,10 +24,10 @@
public void addAlbum(Album album) {
addChild(Long.toString(album.getId()), album);
- album.setParent(this);
}
public void addChild(Object identifier, TreeNode child) {
+ child.setParent(this);
albums.put(identifier, child);
}
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Library.java 2007-09-09 22:41:54 UTC (rev 2827)
@@ -3,11 +3,19 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
+import javax.faces.FacesException;
+
+import org.richfaces.component.UITree;
+import org.richfaces.component.UITreeNode;
+import org.richfaces.event.DropEvent;
+import org.richfaces.model.ListRowKey;
import org.richfaces.model.TreeNode;
public class Library implements TreeNode {
@@ -27,10 +35,10 @@
}
public void addArtist(Artist artist) {
addChild(Long.toString(artist.getId()), artist);
- artist.setParent(this);
}
public void addChild(Object identifier, TreeNode child) {
+ child.setParent(this);
getArtists().put(identifier, child);
}
@@ -143,4 +151,37 @@
public void setState2(Object state2) {
this.state2 = state2;
}
+
+ public void processDrop(DropEvent event) {
+ ListRowKey srcKey = (ListRowKey) event.getDragValue();
+ ListRowKey destKey = (ListRowKey) event.getDropValue();
+
+ UITree tree = ((UITreeNode) event.getComponent()).getUITree();
+
+ TreeNode destNode = tree.getTreeNode(destKey);
+ TreeNode srcNode = tree.getTreeNode(srcKey);
+
+ try {
+ tree.queueNodeCollapse(srcKey);
+ tree.queueNodeExpand(destKey);
+ } catch (IOException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+
+ String srcNodeKey = String.valueOf(((IdentifierTreeNode) srcNode).getId());
+ srcNode.getParent().removeChild(srcNodeKey);
+ destNode.addChild(srcNodeKey, srcNode);
+
+ List list = new ArrayList();
+ //this is to get row key segments for the parent node of source node
+ //candidate for inclusion to UITree API
+ for (Iterator iterator = srcKey.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ if (iterator.hasNext()) {
+ list.add(object);
+ }
+ }
+ tree.addRequestKey(new ListRowKey(list));
+ tree.addRequestKey(destKey);
+ }
}
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeBean.java 2007-09-09 22:41:54 UTC (rev 2827)
@@ -0,0 +1,105 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * 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.demo.tree;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+
+public class SimpleTreeBean {
+
+ private TreeNode rootNode = null;
+
+ private UIComponent tree;
+
+ private static final String DATA_PATH = "/richfaces/tree/examples/simple-tree-data.properties";
+
+ private void addNodes(String path, TreeNode node, Properties properties) {
+ boolean end = false;
+ int counter = 1;
+
+ while (!end) {
+ String key = path != null ? path + '.' + counter : String.valueOf(counter);
+
+ String value = properties.getProperty(key);
+ if (value != null) {
+ TreeNodeImpl nodeImpl = new TreeNodeImpl();
+ nodeImpl.setData(value);
+ node.addChild(new Integer(counter), nodeImpl);
+
+ addNodes(key, nodeImpl, properties);
+
+ counter++;
+ } else {
+ end = true;
+ }
+ }
+ }
+
+ private void loadTree() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+ InputStream dataStream = externalContext.getResourceAsStream(DATA_PATH);
+ try {
+ Properties properties = new Properties();
+ properties.load(dataStream);
+
+ rootNode = new TreeNodeImpl();
+ addNodes(null, rootNode, properties);
+
+ } catch (IOException e) {
+ throw new FacesException(e.getMessage(), e);
+ } finally {
+ if (dataStream != null) {
+ try {
+ dataStream.close();
+ } catch (IOException e) {
+ externalContext.log(e.getMessage(), e);
+ }
+ }
+ }
+ }
+
+ public TreeNode getTreeNode() {
+ if (rootNode == null) {
+ loadTree();
+ }
+
+ return rootNode;
+ }
+
+ public UIComponent getTree() {
+ return tree;
+ }
+
+ public void setTree(UIComponent tree) {
+ this.tree = tree;
+ }
+}
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Song.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Song.java 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/Song.java 2007-09-09 22:41:54 UTC (rev 2827)
@@ -5,7 +5,7 @@
import org.richfaces.model.TreeNode;
-public class Song implements TreeNode {
+public class Song implements IdentifierTreeNode {
/**
*
*/
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -158,13 +158,28 @@
<property-class>java.lang.String</property-class>
<value>Paint 2D</value>
</managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>simpleTreeBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.tree.SimpleTreeBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>libraryAjaxTree</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.tree.Library</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>libraryClientTree</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.tree.Library</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>libraryServerTree</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.tree.Library</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
<managed-bean>
- <managed-bean-name>library</managed-bean-name>
- <managed-bean-class>org.richfaces.demo.tree.Library</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
- <managed-bean>
<managed-bean-name>dndBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.dnd.DndBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/cd.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/tree/cd.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/group.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/tree/group.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/music.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/tree/music.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -7,18 +7,19 @@
<p>This tree uses "ajax" switch type, note that for collapse/expand operations it will be Ajax request to the server. You may see short delay in this case.</p>
<h:form>
- <rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
- <rich:treeNode type="library">
- <h:outputText value="#{item.type}" />
- </rich:treeNode>
- <rich:treeNode type="artist">
+ <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">
+ <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">
+ <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>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -6,21 +6,23 @@
xmlns:rich="http://richfaces.org/rich">
<p>This is exactly the same tree, but now it uses "client" switch type. Note, that all nodes actually rendered up-front and expand/collapse now do not requre server call</p>
- <rich:tree switchType="client" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
- <rich:treeNode type="library">
- <h:outputText value="#{item.type}" />
- </rich:treeNode>
- <rich:treeNode type="artist">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- <rich:treeNode type="album">
- <h:outputText value="#{item.title}" />
- </rich:treeNode>
- <rich:treeNode type="song">
- <h:outputText value="#{item.title}" />
- </rich:treeNode>
- </rich:tree>
+ <h:form>
+ <rich:tree switchType="client" style="width:300px" dragIndicator=":treeDragIndicator" dropListener="#{libraryClientTree.processDrop}" value="#{libraryClientTree.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>
+
</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -7,18 +7,19 @@
<p>This is again same tree, but now it uses "server" switch type. Full page content will be reloaded at every click.</p>
<h:form>
- <rich:tree switchType="server" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
- <rich:treeNode type="library">
- <h:outputText value="#{item.type}" />
- </rich:treeNode>
- <rich:treeNode type="artist">
+ <rich:tree switchType="server" style="width:300px" dragIndicator=":treeDragIndicator" dropListener="#{libraryServerTree.processDrop}" value="#{libraryServerTree.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">
+ <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">
+ <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>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data.properties (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data.properties 2007-09-09 22:41:54 UTC (rev 2827)
@@ -0,0 +1,32 @@
+1=Daniel Defo
+1.1=Robinson Crusoe
+1.1.1=Start In Life
+2=Edgar Allan Poe
+2.1=Plays
+2.1.1=Politian
+2.2=Short stories
+2.2.1=The Assignation
+2.2.2=Berenice
+2.2.3=The Black Cat
+2.2.4=The Cask of Amontillado
+2.2.5=A Descent into the Maelstrom
+2.3=Poetry
+2.3.1=Alone
+2.3.2=An Enigma
+2.3.3=Annabel Lee
+2.3.4=Bridal Ballad
+3=Henry Wadsworth Longfellow
+3.1=The Song of Hiawatha
+3.1.1=Introduction
+3.1.2=I. The Peace-Pipe
+3.1.3=II. The Four Winds
+3.1.4=III. Hiawatha's Childhood
+3.1.5=IV. Hiawatha and Mudjekeewis
+3.1.6=V. Hiawatha's Fasting
+3.1.7=VI. Hiawatha's Friends
+3.2=Poetry
+3.2.1=A Psalm Of Life
+3.2.2=Birds Of Passage
+3.2.3=Hiawatha's Childhood
+3.2.4=Hymn To The Night
+
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -0,0 +1,17 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <rich:tree style="width:300px" toggleOnClick="true" switchType="client" binding="#{simpleTreeBean.tree}" value="#{simpleTreeBean.treeNode}" var="item" nodeFace="#{simpleTreeBean.tree.leaf ? 'link' : null}">
+ <rich:treeNode type="link">
+ <a4j:commandLink value="#{item}" />
+ </rich:treeNode>
+
+ </rich:tree>
+ </h:form>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/simple-tree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/simple-tree.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/simple-tree.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -0,0 +1,18 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <div class="sample-container" >
+ <ui:include src="/richfaces/tree/examples/simple.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/tree/examples/simple.xhtml"/>
+ </ui:include>
+ </div>
+ </ui:define>
+ </ui:composition>
+</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -7,6 +7,8 @@
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
+ <rich:dragIndicator id="treeDragIndicator" />
+
<p>
Tree is a component that renders a tree control on the page.<br/>
The most important tree features are:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree.xhtml 2007-09-09 22:40:42 UTC (rev 2826)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree.xhtml 2007-09-09 22:41:54 UTC (rev 2827)
@@ -9,10 +9,13 @@
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Tree</ui:define>
<ui:define name="current">panel</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" selectedTab="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/tree/usage.xhtml"/>
</rich:tab>
+ <rich:tab label=""Hello world!" tree">
+ <ui:include src="/richfaces/tree/simple-tree.xhtml"/>
+ </rich:tab>
<ui:include src="/templates/include/tagInfo.xhtml">
<ui:param name="path" value="rich/tree"/>
</ui:include>
18 years, 8 months
JBoss Rich Faces SVN: r2826 - trunk/ui/tree/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-09-09 18:40:42 -0400 (Sun, 09 Sep 2007)
New Revision: 2826
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
fixed: children div has been drawn as visible even if no children exist
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-09-09 20:18:05 UTC (rev 2825)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-09-09 22:40:42 UTC (rev 2826)
@@ -142,6 +142,7 @@
public void afterUp(int levels) throws IOException {
Context c = droppedDownToLevelFlag.getContext();
if (c != null) {
+ c.setHasChildren(false);
openDiv(c);
closeDiv();
droppedDownToLevelFlag.setContext(null);
@@ -184,7 +185,7 @@
getUtils().writeAttribute(writer, "id", context.getClientId() + "childs");
- if (!context.isExpanded()) {
+ if (!context.isExpanded() || !context.isHasChildren()) {
getUtils().writeAttribute(writer, "style", "display: none;");
} else {
if (tree.isShowConnectingLines()) {
@@ -241,6 +242,7 @@
Context c = flag.getContext();
if (c != null) {
+ c.setHasChildren(false);
navigator.openDiv(c);
navigator.closeDiv();
}
@@ -643,6 +645,7 @@
private Object rowKey;
private boolean expanded;
private boolean last;
+ private boolean hasChildren = true;
public String getClientId() {
return clientId;
}
@@ -667,4 +670,10 @@
public void setLast(boolean last) {
this.last = last;
}
+ public boolean isHasChildren() {
+ return hasChildren;
+ }
+ public void setHasChildren(boolean hasChildren) {
+ this.hasChildren = hasChildren;
+ }
}
\ No newline at end of file
18 years, 8 months