JBoss Rich Faces SVN: r23006 - modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable.
by richfaces-svn-commits@lists.jboss.org
Author: bleathem
Date: 2011-11-25 13:45:42 -0500 (Fri, 25 Nov 2011)
New Revision: 23006
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml
Log:
Added the cellspacing and cellpadding attributes to the rishDataTable simple sample
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/simple.xhtml 2011-11-25 18:45:42 UTC (rev 23006)
@@ -54,6 +54,8 @@
<rich:dataTable id="richDataTable"
captionClass="#{richDataTableBean.attributes['captionClass'].value}"
+ cellpadding="#{richDataTableBean.attributes['cellpadding'].value}"
+ cellspacing="#{richDataTableBean.attributes['cellspacing'].value}"
columnClasses="#{richDataTableBean.attributes['columnClasses'].value}"
first="#{richDataTableBean.attributes['first'].value}"
footerClass="#{richDataTableBean.attributes['footerClass'].value}"
13 years, 1 month
JBoss Rich Faces SVN: r23005 - in modules/tests/metamer/trunk: application/src/main/java/org/richfaces/tests/metamer/model/tree and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-11-25 09:53:19 -0500 (Fri, 25 Nov 2011)
New Revision: 23005
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/componentToInclude.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/outOfTemplateAfterToInclude.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeDataModel.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeNode.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleSwingTreeNode.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
Log:
RFPL-981: added more model types (rich:tree)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -38,6 +38,9 @@
import javax.faces.bean.ViewScoped;
import javax.faces.event.ComponentSystemEvent;
+import org.richfaces.model.SwingTreeNodeDataModelImpl;
+import org.richfaces.model.TreeDataModel;
+
import org.richfaces.component.UITree;
import org.richfaces.event.DropEvent;
import org.richfaces.tests.metamer.Attributes;
@@ -67,7 +70,8 @@
private static Logger logger;
private Attributes attributes;
- private List<RichFacesTreeNode<Labeled>> richfacesTreeNodeRoot;
+ private RichFacesTreeNode<Labeled> richfacesTreeNodeRoot;
+ private TreeDataModel<?> richFacesTreeDataModelRoot;
private List<SwingTreeNode<Labeled>> swingTreeNodeRoot;
private Collection<? extends Serializable> selection;
@@ -116,12 +120,6 @@
for (CompactDiscXmlDescriptor descriptor : Model.unmarshallCompactDiscs()) {
createCompactDisc(descriptor);
}
- // build trees
- List<SwingTreeNode<Labeled>> swingTreeNodelist = (List<SwingTreeNode<Labeled>>) (List<?>) buldTree(SwingTreeNode.createFactory());
- swingTreeNodeRoot = swingTreeNodelist;
- List<RichFacesTreeNode<Labeled>> richfacesTreeNodeList = (List<RichFacesTreeNode<Labeled>>) (List<?>) buldTree(RichFacesTreeNode.createFactory());
- richfacesTreeNodeRoot = richfacesTreeNodeList;
-
}
public Attributes getAttributes() {
@@ -137,11 +135,32 @@
RichBean.logToPage("* dropListener");
}
- public List<RichFacesTreeNode<Labeled>> getRichFacesTreeNodeRoot() {
+ public TreeDataModel<?> getRichFacesTreeDataModelRoot() {
+ if (richFacesTreeDataModelRoot == null) {
+ richFacesTreeDataModelRoot = new SwingTreeNodeDataModelImpl();
+ richFacesTreeDataModelRoot.setWrappedData(getSwingTreeNodeRoot());
+ }
+ return richFacesTreeDataModelRoot;
+ }
+
+ public RichFacesTreeNode<Labeled> getRichFacesTreeNodeRoot() {
+ if (richfacesTreeNodeRoot == null) {
+ List<RichFacesTreeNode<Labeled>> richfacesTreeNodeList = (List<RichFacesTreeNode<Labeled>>) (List<?>) buldTree(RichFacesTreeNode.createFactory());
+ richfacesTreeNodeRoot = new RichFacesTreeNode<Labeled>();
+ int i=0;
+ for (RichFacesTreeNode node : richfacesTreeNodeList) {
+ richfacesTreeNodeRoot.addChild(i, node);
+ i++;
+ }
+ }
return richfacesTreeNodeRoot;
}
public List<SwingTreeNode<Labeled>> getSwingTreeNodeRoot() {
+ if (swingTreeNodeRoot == null) {
+ List<SwingTreeNode<Labeled>> swingTreeNodelist = (List<SwingTreeNode<Labeled>>) (List<?>) buldTree(SwingTreeNode.createFactory());
+ swingTreeNodeRoot = swingTreeNodelist;
+ }
return swingTreeNodeRoot;
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -71,7 +71,8 @@
@Override
public void insertChild(int index, Object key, TreeNode child) {
- addChild(key, child);
+ children.put(key, child);
+ keys.add(index, key);
}
@Override
@@ -110,6 +111,7 @@
@Override
public RichFacesTreeNode<Labeled> createTreeNode(TreeNodeWithContent<Labeled> parent, Labeled content) {
RichFacesTreeNode<Labeled> treeNode = new RichFacesTreeNode<Labeled>();
+ treeNode.setContent(content);
if (parent != null) {
RichFacesTreeNode<Labeled> castedParent = (RichFacesTreeNode<Labeled>) parent;
castedParent.addChild(treeNode.getContent(), treeNode);
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -1,3 +1,24 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
package org.richfaces.tests.metamer.model.tree;
import java.io.Serializable;
@@ -11,6 +32,9 @@
import com.google.common.collect.Iterators;
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
public class SwingTreeNode<Content extends Labeled> implements TreeNode, TreeNodeWithContent<Content>, Serializable {
private static final long serialVersionUID = 1L;
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/componentToInclude.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/componentToInclude.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/componentToInclude.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+ <h3><b>rich:tree</b></h3>
+
+ <p>
+ <rich:tree id="richTree"
+ nodeType="#{node.type}"
+ var="node"
+ value="#{treeRoot}"
+ selection="#{richTreeBean.selection}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
+
+ data="#{richTreeBean.attributes['data'].value}"
+ dir="#{richTreeBean.attributes['dir'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ immediate="#{richTreeBean.attributes['immediate'].value}"
+ keepSaved="#{richTreeBean.attributes['keepSaved'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
+ lang="#{richTreeBean.attributes['lang'].value}"
+ limitRender="#{richTreeBean.attributes['limitRender'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
+ onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
+ onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
+ onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
+ onbegin="#{richTreeBean.attributes['onbegin'].value}"
+ onclick="#{richTreeBean.attributes['onclick'].value}"
+ oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
+ ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
+ onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
+ onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
+ onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
+ onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
+ onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
+ onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
+ onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ render="#{richTreeBean.attributes['render'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ status="#{richTreeBean.attributes['status'].value}"
+ style="#{richTreeBean.attributes['style'].value}"
+ styleClass="#{richTreeBean.attributes['styleClass'].value}"
+ title="#{richTreeBean.attributes['title'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ >
+
+ <rich:treeNode type="country"
+ expanded="#{richTreeBean.expanded[node]}"
+
+ dir="#{richTreeNodeBean.attributes[0]['dir'].value}"
+ handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+ immediate="#{richTreeNodeBean.attributes[0]['immediate'].value}"
+ labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+ lang="#{richTreeNodeBean.attributes[0]['lang'].value}"
+ onbeforetoggle="#{richTreeNodeBean.attributes[0]['onbeforetoggle'].value}"
+ onclick="#{richTreeNodeBean.attributes[0]['onclick'].value}"
+ ondblclick="#{richTreeNodeBean.attributes[0]['ondblclick'].value}"
+ onkeydown="#{richTreeNodeBean.attributes[0]['onkeydown'].value}"
+ onkeypress="#{richTreeNodeBean.attributes[0]['onkeypress'].value}"
+ onkeyup="#{richTreeNodeBean.attributes[0]['onkeyup'].value}"
+ onmousedown="#{richTreeNodeBean.attributes[0]['onmousedown'].value}"
+ onmousemove="#{richTreeNodeBean.attributes[0]['onmousemove'].value}"
+ onmouseout="#{richTreeNodeBean.attributes[0]['onmouseout'].value}"
+ onmouseover="#{richTreeNodeBean.attributes[0]['onmouseover'].value}"
+ onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
+ ontoggle="#{richTreeNodeBean.attributes[0]['ontoggle'].value}"
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
+ style="#{richTreeNodeBean.attributes[0]['style'].value}"
+ styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
+ title="#{richTreeNodeBean.attributes[0]['title'].value}"
+ >
+ <f:facet name="handleLoading">
+ <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
+ </f:facet>
+ #{node.content.label}
+ </rich:treeNode>
+
+ <rich:treeNode type="company"
+ expanded="#{richTreeBean.expanded[node]}"
+
+ dir="#{richTreeNodeBean.attributes[1]['dir'].value}"
+ handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+ immediate="#{richTreeNodeBean.attributes[1]['immediate'].value}"
+ labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+ lang="#{richTreeNodeBean.attributes[1]['lang'].value}"
+ onbeforetoggle="#{richTreeNodeBean.attributes[1]['onbeforetoggle'].value}"
+ onclick="#{richTreeNodeBean.attributes[1]['onclick'].value}"
+ ondblclick="#{richTreeNodeBean.attributes[1]['ondblclick'].value}"
+ onkeydown="#{richTreeNodeBean.attributes[1]['onkeydown'].value}"
+ onkeypress="#{richTreeNodeBean.attributes[1]['onkeypress'].value}"
+ onkeyup="#{richTreeNodeBean.attributes[1]['onkeyup'].value}"
+ onmousedown="#{richTreeNodeBean.attributes[1]['onmousedown'].value}"
+ onmousemove="#{richTreeNodeBean.attributes[1]['onmousemove'].value}"
+ onmouseout="#{richTreeNodeBean.attributes[1]['onmouseout'].value}"
+ onmouseover="#{richTreeNodeBean.attributes[1]['onmouseover'].value}"
+ onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
+ ontoggle="#{richTreeNodeBean.attributes[1]['ontoggle'].value}"
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
+ style="#{richTreeNodeBean.attributes[1]['style'].value}"
+ styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ title="#{richTreeNodeBean.attributes[1]['title'].value}"
+ >
+ <f:facet name="handleLoading">
+ <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
+ </f:facet>
+
+ #{node.content.label}
+ </rich:treeNode>
+
+ <rich:treeNode type="cd"
+ expanded="#{richTreeBean.expanded[node]}"
+
+ dir="#{richTreeNodeBean.attributes[2]['dir'].value}"
+ handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
+ immediate="#{richTreeNodeBean.attributes[2]['immediate'].value}"
+ labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
+ lang="#{richTreeNodeBean.attributes[2]['lang'].value}"
+ onbeforetoggle="#{richTreeNodeBean.attributes[2]['onbeforetoggle'].value}"
+ onclick="#{richTreeNodeBean.attributes[2]['onclick'].value}"
+ ondblclick="#{richTreeNodeBean.attributes[2]['ondblclick'].value}"
+ onkeydown="#{richTreeNodeBean.attributes[2]['onkeydown'].value}"
+ onkeypress="#{richTreeNodeBean.attributes[2]['onkeypress'].value}"
+ onkeyup="#{richTreeNodeBean.attributes[2]['onkeyup'].value}"
+ onmousedown="#{richTreeNodeBean.attributes[2]['onmousedown'].value}"
+ onmousemove="#{richTreeNodeBean.attributes[2]['onmousemove'].value}"
+ onmouseout="#{richTreeNodeBean.attributes[2]['onmouseout'].value}"
+ onmouseover="#{richTreeNodeBean.attributes[2]['onmouseover'].value}"
+ onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
+ ontoggle="#{richTreeNodeBean.attributes[2]['ontoggle'].value}"
+ rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
+ style="#{richTreeNodeBean.attributes[2]['style'].value}"
+ styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
+ title="#{richTreeNodeBean.attributes[2]['title'].value}"
+ >
+ #{node.content.label}
+ </rich:treeNode>
+ </rich:tree>
+ </p>
+
+ <h3><b>rich:tree</b> - with default tree nodes</h3>
+ <div>(uses toString on TreeNode as content)</div>
+
+ <p>
+
+
+ <rich:tree id="richTreeDefaultNodes"
+ var="node"
+ value="#{treeRoot}"
+
+ dir="#{richTreeBean.attributes['dir'].value}"
+ lang="#{richTreeBean.attributes['lang'].value}"
+ onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
+ onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
+ onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
+ onbegin="#{richTreeBean.attributes['onbegin'].value}"
+ onclick="#{richTreeBean.attributes['onclick'].value}"
+ oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
+ ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
+ onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
+ onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
+ onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
+ onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
+ onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
+ onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}"
+ selection="#{richTreeBean.selection}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ style="#{richTreeBean.attributes['style'].value}"
+ styleClass="#{richTreeBean.attributes['styleClass'].value}"
+ title="#{richTreeBean.attributes['title'].value}"
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
+ render="#{richTreeBean.attributes['render'].value}"
+ execute="#{richTreeBean.attributes['execute'].value}"
+ toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
+ >
+ </rich:tree>
+ </p>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -31,10 +31,18 @@
<ui:define name="links">
- <metamer:testPageLink id="simple" outcome="simple" value="Simple">
- The simple sample of <b>rich:tree</b> usage including all its attributes.
+ <metamer:testPageLink id="simpleSwingTreeNode" outcome="simpleSwingTreeNode" value="Simple - Swing Tree Node">
+ The simple sample of <b>rich:tree</b> with <b>javax.swing.tree.TreeNode</b>, usage including all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="simpleRichFacesTreeNode" outcome="simpleRichFacesTreeNode" value="Simple - RichFaces Tree Node">
+ The simple sample of <b>rich:tree</b> with <b>org.richfaces.model.TreeNode</b>, usage including all its attributes.
+ </metamer:testPageLink>
+
+ <metamer:testPageLink id="simpleRichFacesTreeDataModel" outcome="simpleRichFacesTreeDataModel" value="Simple - RichFaces Tree Data Model">
+ The simple sample of <b>rich:tree</b> with <b>org.richfaces.model.TreeDataModel</b>, usage including all its attributes.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="treeAdaptors" outcome="treeAdaptors" value="Tree Adaptors">
The <b>rich:tree</b> with declarative model using <b>rich:treeModelRecursiveAdaptor</b> and <b>rich:treeModelAdaptor</b>.
</metamer:testPageLink>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/outOfTemplateAfterToInclude.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/outOfTemplateAfterToInclude.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/outOfTemplateAfterToInclude.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <a4j:commandButton id="expandAll" value="Expand All" action="#{richTreeBean.expandAll}" render="#{nestedComponentId}" />
+ <a4j:commandButton id="collapseAll" value="Collapse All" action="#{richTreeBean.collapseAll}" render="#{nestedComponentId}" />
+
+ <a4j:outputPanel id="panel" ajaxRendered="true">
+ <h:panelGrid columns="2">
+
+ <h:outputLabel value="Test Loading Facet:" />
+ <h:selectBooleanCheckbox id="loadingFacet" value="#{richTreeBean.testLoadingFacet}">
+ <a4j:ajax render="#{nestedComponentId}" />
+ </h:selectBooleanCheckbox>
+
+ <h:outputLabel value="Delayed Render (1sec):" />
+ <h:selectBooleanCheckbox value="#{richTreeBean.delayedRender}">
+ <a4j:ajax />
+ </h:selectBooleanCheckbox>
+
+ <h:outputLabel value="Selection:" />
+ <h:outputText id="selection" value="#{richTreeBean.selection}" />
+
+ <h:outputLabel value="Selection Change Event:" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}" />
+ <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}">
+ <h:outputLabel value="Client ID:" />
+ <h:outputText id="selectionEventClientId" value="#{richTreeListenerBean.treeSelectionChangeEvent.component.id}" />
+
+ <h:outputLabel value="New Selection:" />
+ <h:outputText id="selectionEventNewSelection" value="#{richTreeListenerBean.treeSelectionChangeEvent.newSelection}" />
+
+ <h:outputLabel value="Old Selection:" />
+ <h:outputText id="selectionEventOldSelection" value="#{richTreeListenerBean.treeSelectionChangeEvent.oldSelection}" />
+ </h:panelGrid>
+
+ <h:outputLabel value="Tree Toggle Event:" rendered="#{not empty richTreeListenerBean.treeToggleEvent}" />
+ <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeToggleEvent}">
+ <h:outputLabel value="Client ID:" />
+ <h:outputText id="toggleEventClientId" value="#{richTreeListenerBean.treeToggleEvent.component.id}" />
+
+ <h:outputLabel value="Collapsed:" />
+ <h:outputText id="toggleEventCollapsed" value="#{richTreeListenerBean.treeToggleEvent.collapsed}" />
+
+ <h:outputLabel value="Expanded:" />
+ <h:outputText id="toggleEventExpanded" value="#{richTreeListenerBean.treeToggleEvent.expanded}" />
+ </h:panelGrid>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <fieldset>
+ <legend>rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="country"</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[0]}" id="treeNode1Attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="company"</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[1]}" id="treeNode2Attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="cd"</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[2]}" id="treeNode3Attributes" />
+ </fieldset>
+
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -58,7 +58,7 @@
<rich:dragIndicator id="indicator" />
<p>
- <rich:tree value="#{richTreeBean.swingTreeNodeRoot}" nodeType="#{node.type}" var="node">
+ <rich:tree value="#{richTreeBean.richFacesTreeNodeRoot}" nodeType="#{node.type}" var="node">
<rich:treeNode type="country" title="Country node type" expanded="#{richTreeBean.expanded[node]}" >
<a4j:outputPanel layout="block">
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
-
- <!--
-JBoss, Home of Professional Open Source
-Copyright 2010-2011, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-This software is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
- -->
-
- <ui:composition template="/templates/template.xhtml">
- <ui:param name="componentId" value="richTree" />
-
- <ui:define name="view">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- <f:event type="preRenderView" listener="#{richTreeBean.preRenderView}" />
- </f:metadata>
- </ui:define>
-
- <ui:define name="component">
-
- <h3><b>rich:tree</b></h3>
-
- <p>
- <rich:tree id="richTree"
- nodeType="#{node.type}"
- var="node"
- value="#{richTreeBean.swingTreeNodeRoot}"
- selection="#{richTreeBean.selection}"
- selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
- toggleListener="#{richTreeListenerBean.processToggle}"
-
- data="#{richTreeBean.attributes['data'].value}"
- dir="#{richTreeBean.attributes['dir'].value}"
- execute="#{richTreeBean.attributes['execute'].value}"
- handleClass="#{richTreeBean.attributes['handleClass'].value}"
- iconClass="#{richTreeBean.attributes['iconClass'].value}"
- iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
- iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
- iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
- immediate="#{richTreeBean.attributes['immediate'].value}"
- keepSaved="#{richTreeBean.attributes['keepSaved'].value}"
- labelClass="#{richTreeBean.attributes['labelClass'].value}"
- lang="#{richTreeBean.attributes['lang'].value}"
- limitRender="#{richTreeBean.attributes['limitRender'].value}"
- nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
- onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
- onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
- onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
- onbegin="#{richTreeBean.attributes['onbegin'].value}"
- onclick="#{richTreeBean.attributes['onclick'].value}"
- oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
- ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
- onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
- onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
- onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
- onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
- onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
- onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
- onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
- onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
- onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
- onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
- render="#{richTreeBean.attributes['render'].value}"
- rendered="#{richTreeBean.attributes['rendered'].value}"
- selectionType="#{richTreeBean.attributes['selectionType'].value}"
- status="#{richTreeBean.attributes['status'].value}"
- style="#{richTreeBean.attributes['style'].value}"
- styleClass="#{richTreeBean.attributes['styleClass'].value}"
- title="#{richTreeBean.attributes['title'].value}"
- toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
- toggleType="#{richTreeBean.attributes['toggleType'].value}"
- >
-
- <rich:treeNode type="country"
- expanded="#{richTreeBean.expanded[node]}"
-
- dir="#{richTreeNodeBean.attributes[0]['dir'].value}"
- handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
- iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
- immediate="#{richTreeNodeBean.attributes[0]['immediate'].value}"
- labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
- lang="#{richTreeNodeBean.attributes[0]['lang'].value}"
- onbeforetoggle="#{richTreeNodeBean.attributes[0]['onbeforetoggle'].value}"
- onclick="#{richTreeNodeBean.attributes[0]['onclick'].value}"
- ondblclick="#{richTreeNodeBean.attributes[0]['ondblclick'].value}"
- onkeydown="#{richTreeNodeBean.attributes[0]['onkeydown'].value}"
- onkeypress="#{richTreeNodeBean.attributes[0]['onkeypress'].value}"
- onkeyup="#{richTreeNodeBean.attributes[0]['onkeyup'].value}"
- onmousedown="#{richTreeNodeBean.attributes[0]['onmousedown'].value}"
- onmousemove="#{richTreeNodeBean.attributes[0]['onmousemove'].value}"
- onmouseout="#{richTreeNodeBean.attributes[0]['onmouseout'].value}"
- onmouseover="#{richTreeNodeBean.attributes[0]['onmouseover'].value}"
- onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
- ontoggle="#{richTreeNodeBean.attributes[0]['ontoggle'].value}"
- rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
- style="#{richTreeNodeBean.attributes[0]['style'].value}"
- styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
- title="#{richTreeNodeBean.attributes[0]['title'].value}"
- >
- <f:facet name="handleLoading">
- <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
- </f:facet>
- #{node.content.label}
- </rich:treeNode>
-
- <rich:treeNode type="company"
- expanded="#{richTreeBean.expanded[node]}"
-
- dir="#{richTreeNodeBean.attributes[1]['dir'].value}"
- handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
- iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
- immediate="#{richTreeNodeBean.attributes[1]['immediate'].value}"
- labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
- lang="#{richTreeNodeBean.attributes[1]['lang'].value}"
- onbeforetoggle="#{richTreeNodeBean.attributes[1]['onbeforetoggle'].value}"
- onclick="#{richTreeNodeBean.attributes[1]['onclick'].value}"
- ondblclick="#{richTreeNodeBean.attributes[1]['ondblclick'].value}"
- onkeydown="#{richTreeNodeBean.attributes[1]['onkeydown'].value}"
- onkeypress="#{richTreeNodeBean.attributes[1]['onkeypress'].value}"
- onkeyup="#{richTreeNodeBean.attributes[1]['onkeyup'].value}"
- onmousedown="#{richTreeNodeBean.attributes[1]['onmousedown'].value}"
- onmousemove="#{richTreeNodeBean.attributes[1]['onmousemove'].value}"
- onmouseout="#{richTreeNodeBean.attributes[1]['onmouseout'].value}"
- onmouseover="#{richTreeNodeBean.attributes[1]['onmouseover'].value}"
- onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
- ontoggle="#{richTreeNodeBean.attributes[1]['ontoggle'].value}"
- rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
- style="#{richTreeNodeBean.attributes[1]['style'].value}"
- styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
- title="#{richTreeNodeBean.attributes[1]['title'].value}"
- >
- <f:facet name="handleLoading">
- <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
- </f:facet>
-
- #{node.content.label}
- </rich:treeNode>
-
- <rich:treeNode type="cd"
- expanded="#{richTreeBean.expanded[node]}"
-
- dir="#{richTreeNodeBean.attributes[2]['dir'].value}"
- handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
- iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
- immediate="#{richTreeNodeBean.attributes[2]['immediate'].value}"
- labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
- lang="#{richTreeNodeBean.attributes[2]['lang'].value}"
- onbeforetoggle="#{richTreeNodeBean.attributes[2]['onbeforetoggle'].value}"
- onclick="#{richTreeNodeBean.attributes[2]['onclick'].value}"
- ondblclick="#{richTreeNodeBean.attributes[2]['ondblclick'].value}"
- onkeydown="#{richTreeNodeBean.attributes[2]['onkeydown'].value}"
- onkeypress="#{richTreeNodeBean.attributes[2]['onkeypress'].value}"
- onkeyup="#{richTreeNodeBean.attributes[2]['onkeyup'].value}"
- onmousedown="#{richTreeNodeBean.attributes[2]['onmousedown'].value}"
- onmousemove="#{richTreeNodeBean.attributes[2]['onmousemove'].value}"
- onmouseout="#{richTreeNodeBean.attributes[2]['onmouseout'].value}"
- onmouseover="#{richTreeNodeBean.attributes[2]['onmouseover'].value}"
- onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
- ontoggle="#{richTreeNodeBean.attributes[2]['ontoggle'].value}"
- rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
- style="#{richTreeNodeBean.attributes[2]['style'].value}"
- styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
- title="#{richTreeNodeBean.attributes[2]['title'].value}"
- >
- #{node.content.label}
- </rich:treeNode>
- </rich:tree>
- </p>
-
- <h3><b>rich:tree</b> - with default tree nodes</h3>
- <div>(uses toString on TreeNode as content)</div>
-
- <p>
-
-
- <rich:tree id="richTreeDefaultNodes"
- var="node"
- value="#{richTreeBean.swingTreeNodeRoot}"
-
- dir="#{richTreeBean.attributes['dir'].value}"
- lang="#{richTreeBean.attributes['lang'].value}"
- onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
- onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
- onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
- onbegin="#{richTreeBean.attributes['onbegin'].value}"
- onclick="#{richTreeBean.attributes['onclick'].value}"
- oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
- ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
- onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
- onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
- onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
- onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
- onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
- onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
- onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
- onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
- onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
- onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
- rendered="#{richTreeBean.attributes['rendered'].value}"
- selection="#{richTreeBean.selection}"
- selectionType="#{richTreeBean.attributes['selectionType'].value}"
- style="#{richTreeBean.attributes['style'].value}"
- styleClass="#{richTreeBean.attributes['styleClass'].value}"
- title="#{richTreeBean.attributes['title'].value}"
- toggleType="#{richTreeBean.attributes['toggleType'].value}"
- iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
- iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
- iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
- handleClass="#{richTreeBean.attributes['handleClass'].value}"
- iconClass="#{richTreeBean.attributes['iconClass'].value}"
- labelClass="#{richTreeBean.attributes['labelClass'].value}"
- nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
- selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
- toggleListener="#{richTreeListenerBean.processToggle}"
- render="#{richTreeBean.attributes['render'].value}"
- execute="#{richTreeBean.attributes['execute'].value}"
- toggleNodeEvent="#{richTreeBean.attributes['toggleNodeEvent'].value}"
- >
- </rich:tree>
- </p>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
-
- <a4j:commandButton id="expandAll" value="Expand All" action="#{richTreeBean.expandAll}" render="#{nestedComponentId}" />
- <a4j:commandButton id="collapseAll" value="Collapse All" action="#{richTreeBean.collapseAll}" render="#{nestedComponentId}" />
-
- <a4j:outputPanel id="panel" ajaxRendered="true">
- <h:panelGrid columns="2">
-
- <h:outputLabel value="Test Loading Facet:" />
- <h:selectBooleanCheckbox id="loadingFacet" value="#{richTreeBean.testLoadingFacet}">
- <a4j:ajax render="#{nestedComponentId}" />
- </h:selectBooleanCheckbox>
-
- <h:outputLabel value="Delayed Render (1sec):" />
- <h:selectBooleanCheckbox value="#{richTreeBean.delayedRender}">
- <a4j:ajax />
- </h:selectBooleanCheckbox>
-
- <h:outputLabel value="Selection:" />
- <h:outputText id="selection" value="#{richTreeBean.selection}" />
-
- <h:outputLabel value="Selection Change Event:" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}" />
- <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}">
- <h:outputLabel value="Client ID:" />
- <h:outputText id="selectionEventClientId" value="#{richTreeListenerBean.treeSelectionChangeEvent.component.id}" />
-
- <h:outputLabel value="New Selection:" />
- <h:outputText id="selectionEventNewSelection" value="#{richTreeListenerBean.treeSelectionChangeEvent.newSelection}" />
-
- <h:outputLabel value="Old Selection:" />
- <h:outputText id="selectionEventOldSelection" value="#{richTreeListenerBean.treeSelectionChangeEvent.oldSelection}" />
- </h:panelGrid>
-
- <h:outputLabel value="Tree Toggle Event:" rendered="#{not empty richTreeListenerBean.treeToggleEvent}" />
- <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeToggleEvent}">
- <h:outputLabel value="Client ID:" />
- <h:outputText id="toggleEventClientId" value="#{richTreeListenerBean.treeToggleEvent.component.id}" />
-
- <h:outputLabel value="Collapsed:" />
- <h:outputText id="toggleEventCollapsed" value="#{richTreeListenerBean.treeToggleEvent.collapsed}" />
-
- <h:outputLabel value="Expanded:" />
- <h:outputText id="toggleEventExpanded" value="#{richTreeListenerBean.treeToggleEvent.expanded}" />
- </h:panelGrid>
- </h:panelGrid>
- </a4j:outputPanel>
-
- <fieldset>
- <legend>rich:tree</legend>
- <metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
- </fieldset>
- <fieldset>
- <legend>rich:treeNode type="country"</legend>
- <metamer:attributes value="#{richTreeNodeBean.attributes[0]}" id="treeNode1Attributes" />
- </fieldset>
- <fieldset>
- <legend>rich:treeNode type="company"</legend>
- <metamer:attributes value="#{richTreeNodeBean.attributes[1]}" id="treeNode2Attributes" />
- </fieldset>
- <fieldset>
- <legend>rich:treeNode type="cd"</legend>
- <metamer:attributes value="#{richTreeNodeBean.attributes[2]}" id="treeNode3Attributes" />
- </fieldset>
- </ui:define>
-
- </ui:composition>
-</html>
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeDataModel.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeDataModel.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeDataModel.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView" listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <ui:include src="/components/richTree/componentToInclude.xhtml">
+ <ui:param name="treeRoot" value="#{richTreeBean.richFacesTreeDataModelRoot}" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ui:include src="/components/richTree/outOfTemplateAfterToInclude.xhtml" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeNode.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeNode.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleRichFacesTreeNode.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView" listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <ui:include src="/components/richTree/componentToInclude.xhtml">
+ <ui:param name="treeRoot" value="#{richTreeBean.richFacesTreeNodeRoot}" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ui:include src="/components/richTree/outOfTemplateAfterToInclude.xhtml" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleSwingTreeNode.xhtml (from rev 23004, modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleSwingTreeNode.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simpleSwingTreeNode.xhtml 2011-11-25 14:53:19 UTC (rev 23005)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView" listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <ui:include src="/components/richTree/componentToInclude.xhtml">
+ <ui:param name="treeRoot" value="#{richTreeBean.swingTreeNodeRoot}" />
+ </ui:include>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ui:include src="/components/richTree/outOfTemplateAfterToInclude.xhtml" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/AbstractTestTree.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTree;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class AbstractTestTree extends AbstractMetamerTest {
+
+ @Inject
+ @Use(strings = {"simpleSwingTreeNode", "simpleRichFacesTreeNode", "simpleRichFacesTreeDataModel"})
+ private String sample;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/" + sample + ".xhtml");
+ }
+
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -21,14 +21,10 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richTree;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
-import java.net.URL;
-
import javax.faces.event.PhaseId;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
@@ -38,18 +34,13 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class TestTreePhases extends AbstractMetamerTest {
+public class TestTreePhases extends AbstractTestTree {
@Inject
@Use(booleans = { true, false })
Boolean immediate;
private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
- }
-
@BeforeMethod
public void initialize() {
treeAttributes.set(TreeAttributes.immediate, immediate);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -23,13 +23,11 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
-import java.net.URL;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -38,7 +36,6 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.utils.text.SimplifiedFormat;
import org.richfaces.component.SwitchType;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
@@ -49,7 +46,7 @@
* @version $Revision$
*/
@Use(field = "selectionPaths", value = "")
-public class TestTreeSelection extends AbstractMetamerTest {
+public class TestTreeSelection extends AbstractTestTree {
protected Integer[][] selectionPaths = new Integer[][] {{4, 3}, {1, 4}, {2, 1, 1}, {2}, {2, 1},
{3, 5 }, {4, 10, 3 } };
@@ -69,12 +66,6 @@
JQueryLocator newSelection = jq("span[id$=selectionEventNewSelection]");
JQueryLocator oldSelection = jq("span[id$=selectionEventOldSelection]");
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
- }
-
@BeforeMethod
public void testInitialize() {
treeAttributes.set(TreeAttributes.selectionType, selectionType);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -36,11 +36,7 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
-import static org.richfaces.tests.metamer.ftest.BasicAttributes.handleClass;
-import static org.richfaces.tests.metamer.ftest.BasicAttributes.iconClass;
-import static org.richfaces.tests.metamer.ftest.BasicAttributes.labelClass;
import static org.richfaces.tests.metamer.ftest.BasicAttributes.nodeClass;
import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
import static org.richfaces.tests.metamer.ftest.richTree.TreeAttributes.data;
@@ -59,8 +55,6 @@
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
-import java.net.URL;
-
import org.jboss.cheiron.halt.XHRHalter;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
@@ -71,7 +65,6 @@
import org.jboss.test.selenium.request.RequestType;
import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
import org.richfaces.component.SwitchType;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
@@ -81,7 +74,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class TestTreeSimple extends AbstractMetamerTest {
+public class TestTreeSimple extends AbstractTestTree {
private static final String IMAGE_URL = "/resources/images/loading.gif";
@@ -102,18 +95,13 @@
@Use(empty = true)
Event domEvent;
Event[] domEvents = { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
-
+
TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
TreeNodeModel treeNode;
JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
JQueryLocator loadingFacet = jq("input:checkbox[id$=loadingFacet]");
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
- }
-
@Test
public void testData() {
treeAttributes.set(data, "RichFaces 4");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -21,18 +21,14 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richTree;
-import static org.jboss.test.selenium.locator.LocatorFactory.jq;
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
-import static org.richfaces.tests.metamer.ftest.attributes.AttributeList.treeAttributes;
-import java.net.URL;
import java.util.Deque;
import java.util.LinkedList;
import org.richfaces.component.SwitchType;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
@@ -42,7 +38,7 @@
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class TestTreeToggling extends AbstractMetamerTest {
+public class TestTreeToggling extends AbstractTestTree {
private static final int TOP_LEVEL_NODES = 4;
@@ -55,11 +51,6 @@
private TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
private TreeNodeModel treeNode;
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
- }
-
@BeforeMethod
public void verifyInitialState() {
treeAttributes.set(TreeAttributes.toggleType, toggleType);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-11-24 23:53:52 UTC (rev 23004)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-11-25 14:53:19 UTC (rev 23005)
@@ -104,7 +104,7 @@
@Override
public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
+ return buildUrl(contextPath, "faces/components/richTree/simpleSwingTreeNode.xhtml");
}
@Test
13 years, 1 month
JBoss Rich Faces SVN: r23004 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richCollapsibleSubTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jjamrich
Date: 2011-11-24 18:53:52 -0500 (Thu, 24 Nov 2011)
New Revision: 23004
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
Log:
RF-11656: add example to simulate issue
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java 2011-11-24 17:56:59 UTC (rev 23003)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java 2011-11-24 23:53:52 UTC (rev 23004)
@@ -79,6 +79,9 @@
private Map<String, Object> filtering = new HashMap<String, Object>();
// expanded
private Map<List<Employee>, Boolean> expanded = new HashMap<List<Employee>, Boolean>();
+
+ // expanded state for employee detail (for RF-11656)
+ private Map<Employee, Boolean> expandedEmployee = new HashMap<Employee, Boolean>();
/**
* Initializes the managed bean.
@@ -181,4 +184,12 @@
public Map<List<Employee>, Boolean> getExpanded() {
return expanded;
}
+
+ public Map<Employee, Boolean> getExpandedEmployee() {
+ return expandedEmployee;
+ }
+
+ public void setExpandedEmployee(Map<Employee, Boolean> expandedEmployee) {
+ this.expandedEmployee = expandedEmployee;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-11-24 17:56:59 UTC (rev 23003)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-11-24 23:53:52 UTC (rev 23004)
@@ -64,6 +64,10 @@
<metamer:testPageLink id="keepSaved" outcome="keepSaved" value="Keep Saved">
Page for testing attribute keepSaved of <b>rich:collapsibleSubTable</b>.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="rf-11656" outcome="rf-11656" value="RF-11656">
+ Page for testing <a href="https://issues.jboss.org/browse/RF-11656" target="_blank" >RF-11656</a>
+ </metamer:testPageLink>
</ui:define>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/rf-11656.xhtml 2011-11-24 23:53:52 UTC (rev 23004)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <p>
+ Page with nested collapsibleSubTable to verify <a href="https://issues.jboss.org/browse/RF-11656" target="_blank">RF-11656</a>
+ <br/><br/>
+ Nested collapsibleSubTable contains information about employee's company (Company Name and Phone).
+ <br/>
+ collapsibleSubTableToggler managing @expanded on nested CollapsibleSubTable is labeled "Employess's Company Details".
+ If you are not able to collapse Company details for employee, it is still not working<br/>
+ This attribute value (@expanded) for nested collapsibleSubTable should be set to false as well, and don't work.
+ </p>
+
+ <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list" keepSaved="true">
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup">
+ <rich:column id="columnHeaderEmployees" colspan="3">
+ <h:outputText id="columnHeaderEmployeesText" value="Employees" />
+ </rich:column>
+ <rich:column id="columnHeaderName" breakRowBefore="true">
+ <h:outputText id="columnHeaderNameText" value="Name" />
+ </rich:column>
+ <rich:column id="columnHeaderTitle">
+ <h:outputText id="columnHeaderTitleText" value="Title" />
+ </rich:column>
+ <rich:column id="columnHeaderBirthdate">
+ <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column id="columnSubTable1" colspan="3">
+ <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable1"/>
+ <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
+ </rich:column>
+
+
+ <rich:collapsibleSubTable id="richSubTable1"
+ value="#{richSubTableBean.state ? list : null}"
+ var="employee"
+ rows="3"
+ expandMode="ajax"
+ expanded="#{richSubTableBean.expanded[list]}">
+
+ <rich:column>
+ <h:outputText style="margin-left: 15px" value="#{employee.name}"/>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{employee.title}"/>
+ </rich:column>
+ <rich:column id="columnBirthdate">
+ <h:outputText id="birthdate" value="#{employee.birthdate}">
+ <f:convertDateTime pattern="d MMM yyyy"/>
+ </h:outputText>
+ </rich:column>
+
+ <rich:collapsibleSubTable value="#{employee.companies}"
+ var="company"
+ id="richSubTable2"
+ rows="2"
+ expandMode="ajax"
+ expanded="#{richSubTableBean.expandedEmployee[employee]}">
+ <!-- Following ^^^^^^^^ attribute doesn't influence component as expected -->
+ <rich:column>
+ <f:facet name="header">
+ <rich:collapsibleSubTableToggler id="subTableTC2" for="richSubTable2"/>
+ <h:outputText value="Employee's Company Details" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Company Name"/>
+ </f:facet>
+ <h:outputText style="margin-left: 30px" value="#{company.name}"/>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Company Phone"/>
+ </f:facet>
+ <h:outputText value="#{company.phone}"/>
+ </rich:column>
+ </rich:collapsibleSubTable>
+ </rich:collapsibleSubTable>
+
+ </rich:dataTable>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
13 years, 1 month
JBoss Rich Faces SVN: r23002 - in modules/tests/metamer/trunk/application/src/main/webapp: WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-11-24 12:56:16 -0500 (Thu, 24 Nov 2011)
New Revision: 23002
Added:
modules/tests/metamer/trunk/application/src/main/webapp/error/
modules/tests/metamer/trunk/application/src/main/webapp/error/404.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/error/500.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml
Log:
error pages for 404 and 500 added to the application
Modified: modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2011-11-24 15:54:29 UTC (rev 23001)
+++ modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/web.xml 2011-11-24 17:56:16 UTC (rev 23002)
@@ -1,97 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
- <display-name>metamer</display-name>
- <!-- disabled because of a bug in Mojarra 2.1 showing an error message on every page
- <context-param>
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+ <display-name>metamer</display-name>
+
+ <!-- disabled because of a bug in Mojarra 2.1 showing an error message on every page
+ <context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
- </context-param>-->
- <context-param>
- <param-name>com.sun.faces.enableMissingResourceLibraryDetection</param-name>
- <param-value>true</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.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
- <param-value>2097152</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.push.jms.connectionPassword</param-name>
- <param-value>guest</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.push.jms.connectionUsername</param-name>
- <param-value>guest</param-value>
- </context-param>
-
- <!-- resource mapping enable/disable/configure -->
- <context-param>
- <param-name>org.richfaces.resourceMapping.compressedStages</param-name>
- <param-value>None</param-value>
- </context-param>
- <!-- -->
- <context-param>
- <param-name>org.richfaces.resourceMapping.packedStages</param-name>
- <param-value>None</param-value>
- </context-param>
- <!-- -->
- <context-param>
- <param-name>org.richfaces.resourceMapping.enabled</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{richBean.skin}</param-value>
- </context-param>
- <filter>
- <filter-name>PushFilter</filter-name>
- <filter-class>org.richfaces.webapp.PushFilter</filter-class>
- <async-supported>true</async-supported>
- </filter>
- <filter>
- <filter-name>Test Identity Filter</filter-name>
- <filter-class>org.richfaces.tests.metamer.TestIdentityFilter</filter-class>
- <async-supported>true</async-supported>
- </filter>
- <filter-mapping>
- <filter-name>PushFilter</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- </filter-mapping>
- <filter-mapping>
- <filter-name>Test Identity Filter</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- </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>
- <servlet-name>Resource Servlet</servlet-name>
- <servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Resource Servlet</servlet-name>
- <url-pattern>/org.richfaces.resources/*</url-pattern>
- </servlet-mapping>
- <welcome-file-list>
- <welcome-file>faces/index.xhtml</welcome-file>
- </welcome-file-list>
+ </context-param>
+ -->
+ <context-param>
+ <param-name>com.sun.faces.enableMissingResourceLibraryDetection</param-name>
+ <param-value>true</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.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
+ <param-value>2097152</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.push.jms.connectionPassword</param-name>
+ <param-value>guest</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.push.jms.connectionUsername</param-name>
+ <param-value>guest</param-value>
+ </context-param>
+ <!-- resource mapping enable/disable/configure -->
+ <context-param>
+ <param-name>org.richfaces.resourceMapping.compressedStages</param-name>
+ <param-value>None</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.resourceMapping.packedStages</param-name>
+ <param-value>None</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.resourceMapping.enabled</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{richBean.skin}</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>PushFilter</filter-name>
+ <filter-class>org.richfaces.webapp.PushFilter</filter-class>
+ <async-supported>true</async-supported>
+ </filter>
+ <filter>
+ <filter-name>Test Identity Filter</filter-name>
+ <filter-class>org.richfaces.tests.metamer.TestIdentityFilter</filter-class>
+ <async-supported>true</async-supported>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>PushFilter</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>Test Identity Filter</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ </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>
+ <servlet-name>Resource Servlet</servlet-name>
+ <servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Resource Servlet</servlet-name>
+ <url-pattern>/org.richfaces.resources/*</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>faces/index.xhtml</welcome-file>
+ </welcome-file-list>
+
+ <error-page>
+ <error-code>500</error-code>
+ <location>/faces/error/500.xhtml</location>
+ </error-page>
+ <error-page>
+ <error-code>404</error-code>
+ <location>/faces/error/404.xhtml</location>
+ </error-page>
+
</web-app>
Added: modules/tests/metamer/trunk/application/src/main/webapp/error/404.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/error/404.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/error/404.xhtml 2011-11-24 17:56:16 UTC (rev 23002)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<h:head>
+ <title>Error 404</title>
+ <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
+</h:head>
+
+<h:body>
+ <h1 style="color: red;">Error 404: Not Found</h1>
+
+ <p>
+ <h:link id="goHomeLink" outcome="/index" value="Back to the Main Page" />
+ </p>
+
+</h:body>
+</html>
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/error/500.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/error/500.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/error/500.xhtml 2011-11-24 17:56:16 UTC (rev 23002)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<h:head>
+ <title>Error 500</title>
+ <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
+</h:head>
+
+<h:body>
+ <h1 style="color: red;">Error 500: Internal Server Error</h1>
+
+ <p>
+ <h:link id="goHomeLink" outcome="/index" value="Back to the Main Page" />
+ </p>
+
+</h:body>
+</html>
\ No newline at end of file
13 years, 1 month
JBoss Rich Faces SVN: r23001 - in modules/tests/metamer/trunk: application/src/main/java/org/richfaces/tests/metamer/model and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jpapouse
Date: 2011-11-24 10:54:29 -0500 (Thu, 24 Nov 2011)
New Revision: 23001
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CompactDisc.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Labeled.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/State.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContent.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContentFactory.java
Removed:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Company.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
Log:
RFPL-981: preparing environment for using other models than javax.swing.tree.TreeNode (rich:tree)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -24,10 +24,14 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -39,11 +43,15 @@
import org.richfaces.tests.metamer.Attributes;
import org.richfaces.tests.metamer.bean.Model;
import org.richfaces.tests.metamer.bean.RichBean;
-import org.richfaces.tests.metamer.model.tree.CompactDisc;
+import org.richfaces.tests.metamer.model.CompactDisc;
+import org.richfaces.tests.metamer.model.Company;
+import org.richfaces.tests.metamer.model.Labeled;
+import org.richfaces.tests.metamer.model.State;
import org.richfaces.tests.metamer.model.tree.CompactDiscXmlDescriptor;
-import org.richfaces.tests.metamer.model.tree.Company;
-import org.richfaces.tests.metamer.model.tree.Country;
-import org.richfaces.tests.metamer.model.tree.NamedNode;
+import org.richfaces.tests.metamer.model.tree.RichFacesTreeNode;
+import org.richfaces.tests.metamer.model.tree.SwingTreeNode;
+import org.richfaces.tests.metamer.model.tree.TreeNodeWithContent;
+import org.richfaces.tests.metamer.model.tree.TreeNodeWithContentFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,20 +67,27 @@
private static Logger logger;
private Attributes attributes;
- private List<NamedNode> root = new ArrayList<NamedNode>();
+ private List<RichFacesTreeNode<Labeled>> richfacesTreeNodeRoot;
+ private List<SwingTreeNode<Labeled>> swingTreeNodeRoot;
private Collection<? extends Serializable> selection;
// FIXME: @ManagedProperty(value = "#{model}")
// private Model model;
+ private Map<State, Set<Company>> companiesCache;
+ private Map<Company, Set<CompactDisc>> cdCache;
- private Map<String, Country> countriesCache = new HashMap<String, Country>();
- private Map<String, Company> companiesCache = new HashMap<String, Company>();
-
private boolean testLoadingFacet = false;
private boolean delayedRender = false;
- private Map<NamedNode, Boolean> expanded = new HashMap<NamedNode, Boolean>();
+ private Map<TreeNodeWithContent<Labeled>, Boolean> expanded = new HashMap<TreeNodeWithContent<Labeled>, Boolean>();
+ private Comparator<Labeled> labeledComparator = new Comparator<Labeled>() {
+ @Override
+ public int compare(Labeled o1, Labeled o2) {
+ return o1.getLabel().compareTo(o2.getLabel());
+ }
+ };
+
/**
* Initializes the managed bean.
*/
@@ -95,9 +110,18 @@
attributes.remove("stateVar");
attributes.remove("nodeType");
+ // build cache
+ companiesCache = new TreeMap<State, Set<Company>>(labeledComparator);
+ cdCache = new HashMap<Company, Set<CompactDisc>>();
for (CompactDiscXmlDescriptor descriptor : Model.unmarshallCompactDiscs()) {
createCompactDisc(descriptor);
}
+ // build trees
+ List<SwingTreeNode<Labeled>> swingTreeNodelist = (List<SwingTreeNode<Labeled>>) (List<?>) buldTree(SwingTreeNode.createFactory());
+ swingTreeNodeRoot = swingTreeNodelist;
+ List<RichFacesTreeNode<Labeled>> richfacesTreeNodeList = (List<RichFacesTreeNode<Labeled>>) (List<?>) buldTree(RichFacesTreeNode.createFactory());
+ richfacesTreeNodeRoot = richfacesTreeNodeList;
+
}
public Attributes getAttributes() {
@@ -108,54 +132,19 @@
this.attributes = attributes;
}
- private CompactDisc createCompactDisc(CompactDiscXmlDescriptor descriptor) {
- final Company company = findOrCreateCompany(descriptor);
-
- CompactDisc cd = new CompactDisc(descriptor.getTitle(), descriptor.getArtist(), company, descriptor.getPrice(),
- descriptor.getYear());
- company.getCds().add(cd);
- expanded.put(cd, false);
- return cd;
+
+ public void processDragging(DropEvent dropEvent) {
+ RichBean.logToPage("* dropListener");
}
- private Company findOrCreateCompany(CompactDiscXmlDescriptor descriptor) {
- final Country country = findOrCreateCountry(descriptor);
-
- String companyName = descriptor.getCompany();
- Company company = companiesCache.get(companyName);
- if (company == null) {
- company = new Company();
- company.setName(companyName);
- company.setParent(country);
- country.getCompanies().add(company);
- companiesCache.put(companyName, company);
- expanded.put(company, false);
- }
- return company;
+ public List<RichFacesTreeNode<Labeled>> getRichFacesTreeNodeRoot() {
+ return richfacesTreeNodeRoot;
}
-
- private Country findOrCreateCountry(CompactDiscXmlDescriptor descriptor) {
- String countryName = descriptor.getCountry();
- Country country = countriesCache.get(countryName);
- if (country == null) {
- country = new Country();
- country.setName(countryName);
- countriesCache.put(countryName, country);
- expanded.put(country, false);
- root.add(country);
- }
- return country;
- }
- public void processDragging(DropEvent dropEvent) {
- RichBean.logToPage("* dropListener");
+ public List<SwingTreeNode<Labeled>> getSwingTreeNodeRoot() {
+ return swingTreeNodeRoot;
}
- public List<NamedNode> getRoot() {
-
- return root;
- }
-
public Collection<? extends Serializable> getSelection() {
return selection;
}
@@ -190,19 +179,67 @@
}
}
- public Map<NamedNode, Boolean> getExpanded() {
+ public Map<TreeNodeWithContent<Labeled>, Boolean> getExpanded() {
return expanded;
}
public void expandAll() {
- for (Entry<NamedNode, Boolean> entry : expanded.entrySet()) {
+ for (Entry<TreeNodeWithContent<Labeled>, Boolean> entry : expanded.entrySet()) {
entry.setValue(true);
}
}
public void collapseAll() {
- for (Entry<NamedNode, Boolean> entry : expanded.entrySet()) {
+ for (Entry<TreeNodeWithContent<Labeled>, Boolean> entry : expanded.entrySet()) {
entry.setValue(false);
}
}
+
+ private List<TreeNodeWithContent<Labeled>> buldTree(TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>> treeNodeFactory) {
+ List<TreeNodeWithContent<Labeled>> firstLevelNodes = new ArrayList<TreeNodeWithContent<Labeled>>();
+ for(State state : companiesCache.keySet()) {
+ TreeNodeWithContent<Labeled> stateTreeNode = treeNodeFactory.createTreeNode(null, state);
+ stateTreeNode.setType("country");
+ for(Company company : companiesCache.get(state)) {
+ TreeNodeWithContent<Labeled> companyTreeNode = treeNodeFactory.createTreeNode(stateTreeNode, company);
+ companyTreeNode.setType("company");
+ for (CompactDisc cd : cdCache.get(company)) {
+ TreeNodeWithContent<Labeled> cdTreeNode = treeNodeFactory.createTreeNode(companyTreeNode, cd);
+ cdTreeNode.setType("cd");
+ expanded.put(cdTreeNode, false);
+ }
+ expanded.put(companyTreeNode, false);
+ }
+ expanded.put(stateTreeNode, false);
+ firstLevelNodes.add(stateTreeNode);
+ }
+ return firstLevelNodes;
+ }
+
+ private CompactDisc createCompactDisc(CompactDiscXmlDescriptor descriptor) {
+ final Company company = findOrCreateCompany(descriptor);
+ CompactDisc cd = new CompactDisc(descriptor.getTitle(), descriptor.getArtist());
+ cdCache.get(company).add(cd);
+ return cd;
+ }
+
+ private Company findOrCreateCompany(CompactDiscXmlDescriptor descriptor) {
+ final State country = findOrCreateCountry(descriptor);
+ Company company = new Company(descriptor.getCompany());
+ if (!cdCache.containsKey(company)) {
+ cdCache.put(company, new TreeSet<CompactDisc>(labeledComparator));
+ companiesCache.get(country).add(company);
+ }
+ return company;
+ }
+
+ private State findOrCreateCountry(CompactDiscXmlDescriptor descriptor) {
+ String countryName = descriptor.getCountry();
+ State country = new State();
+ country.setName(countryName);
+ if (!companiesCache.containsKey(country)) {
+ companiesCache.put(country, new TreeSet<Company>(labeledComparator));
+ }
+ return country;
+ }
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CompactDisc.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CompactDisc.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CompactDisc.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class CompactDisc implements Labeled, Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private String artist;
+ private String title;
+
+ public CompactDisc(String title, String artist) {
+ this.artist = artist;
+ this.title = title;
+ }
+
+ @Override
+ public String getLabel() {
+ return artist + " - " + title;
+ }
+
+ public String getArtist() {
+ return artist;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setArtist(String artist) {
+ this.artist = artist;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @Override
+ public String toString() {
+ return "CompactDisc [artist=" + artist + ", title=" + title + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((artist == null) ? 0 : artist.hashCode());
+ result = prime * result + ((title == null) ? 0 : title.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CompactDisc other = (CompactDisc) obj;
+ if (artist == null) {
+ if (other.artist != null)
+ return false;
+ } else if (!artist.equals(other.artist))
+ return false;
+ if (title == null) {
+ if (other.title != null)
+ return false;
+ } else if (!title.equals(other.title))
+ return false;
+ return true;
+ }
+
+
+}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Company.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Company.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Company.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -33,7 +33,7 @@
* @version $Revision$
*/
@XmlRootElement(name = "company")
-public class Company implements Serializable {
+public class Company implements Labeled, Serializable {
private static final long serialVersionUID = -1L;
private String name;
@@ -93,5 +93,14 @@
public int hashCode() {
return 31 + 17 * name.hashCode();
}
+
+ public String getLabel() {
+ return name;
+ }
+
+ @Override
+ public String toString() {
+ return "Company [name=" + name + "]";
+ }
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Labeled.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Labeled.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/Labeled.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public interface Labeled {
+
+ String getLabel();
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/State.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/State.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/State.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class State implements Labeled, Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private String name;
+
+ @Override
+ public String getLabel() {
+ return name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return "Country [name=" + name + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ State other = (State) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+}
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -1,104 +0,0 @@
-package org.richfaces.tests.metamer.model.tree;
-
-import java.util.Enumeration;
-
-import javax.swing.tree.TreeNode;
-
-public class CompactDisc extends NamedNode {
-
- private static final long serialVersionUID = 1L;
-
- private Company company;
- private String artist;
- private String title;
- private float price;
- private int year;
-
- public CompactDisc() {
- this.setType("cd");
- }
-
- public CompactDisc(String title, String artist, Company company, float price, int year) {
- super();
- this.setType("cd");
- this.company = company;
- this.artist = artist;
- this.title = title;
- this.price = price;
- this.year = year;
- }
-
- public TreeNode getChildAt(int childIndex) {
- return null;
- }
-
- public int getChildCount() {
- return 0;
- }
-
- public TreeNode getParent() {
- return company;
- }
-
- public int getIndex(TreeNode node) {
- return 0;
- }
-
- public boolean getAllowsChildren() {
- return false;
- }
-
- public boolean isLeaf() {
- return true;
- }
-
- public Enumeration<TreeNode> children() {
- return new Enumeration<TreeNode>() {
-
- public boolean hasMoreElements() {
- return false;
- }
-
- public TreeNode nextElement() {
- return null;
- }
- };
- }
-
- public String getArtist() {
- return artist;
- }
-
- public void setArtist(String artist) {
- this.artist = artist;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public float getPrice() {
- return price;
- }
-
- public void setPrice(float price) {
- this.price = price;
- }
-
- public int getYear() {
- return year;
- }
-
- public void setYear(int year) {
- this.year = year;
- }
-
- @Override
- public String toString() {
- return "CompactDisc [artist=" + artist + ", title=" + title + "]";
- }
-}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -5,6 +5,8 @@
import javax.xml.bind.annotation.XmlElement;
public class CompactDiscXmlDescriptor implements Serializable {
+
+ private static final long serialVersionUID = 1L;
private String artist;
private String title;
private String country;
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -1,80 +0,0 @@
-package org.richfaces.tests.metamer.model.tree;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.swing.tree.TreeNode;
-
-import com.google.common.collect.Iterators;
-
-public class Company extends NamedNode {
-
- private static final long serialVersionUID = 1L;
-
- private String name;
- private List<CompactDisc> compactDiscs = new ArrayList<CompactDisc>();
-
- private Country country;
-
- public Company() {
- this.setType("company");
- }
-
- public TreeNode getChildAt(int childIndex) {
- return compactDiscs.get(childIndex);
- }
-
- public int getChildCount() {
- return compactDiscs.size();
- }
-
- public TreeNode getParent() {
- return country;
- }
-
- public void setParent(Country country) {
- this.country = country;
- }
-
- public int getIndex(TreeNode node) {
- return compactDiscs.indexOf(node);
- }
-
- public boolean getAllowsChildren() {
- return true;
- }
-
- public boolean isLeaf() {
- return compactDiscs.isEmpty();
- }
-
- public Enumeration children() {
- return Iterators.asEnumeration(compactDiscs.iterator());
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Country getCountry() {
- return country;
- }
-
- public void setCountry(Country country) {
- this.country = country;
- }
-
- public List<CompactDisc> getCds() {
- return compactDiscs;
- }
-
- @Override
- public String toString() {
- return "Company [name=" + name + "]";
- }
-}
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -1,66 +0,0 @@
-package org.richfaces.tests.metamer.model.tree;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.swing.tree.TreeNode;
-
-import com.google.common.collect.Iterators;
-
-public class Country extends NamedNode {
-
- private static final long serialVersionUID = 1L;
-
- private String name;
- private List<Company> companies = new ArrayList<Company>();
-
- public Country() {
- this.setType("country");
- }
-
- public TreeNode getChildAt(int childIndex) {
- return companies.get(childIndex);
- }
-
- public int getChildCount() {
- return companies.size();
- }
-
- public TreeNode getParent() {
- return null;
- }
-
- public int getIndex(TreeNode node) {
- return companies.indexOf(node);
- }
-
- public boolean getAllowsChildren() {
- return true;
- }
-
- public boolean isLeaf() {
- return companies.isEmpty();
- }
-
- public Enumeration<Company> children() {
- return Iterators.asEnumeration(companies.iterator());
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<Company> getCompanies() {
- return companies;
- }
-
- @Override
- public String toString() {
- return "Country [name=" + name + "]";
- }
-}
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -1,20 +0,0 @@
-package org.richfaces.tests.metamer.model.tree;
-
-import java.io.Serializable;
-
-import javax.swing.tree.TreeNode;
-
-public abstract class NamedNode implements TreeNode, Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private String type;
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/RichFacesTreeNode.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model.tree;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.richfaces.model.TreeNode;
+import org.richfaces.tests.metamer.model.Labeled;
+import org.richfaces.tests.metamer.model.tree.TreeNodeWithContent;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public class RichFacesTreeNode<Content extends Labeled> implements TreeNode, TreeNodeWithContent<Content>, Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private Map<Object, TreeNode> children = new HashMap<Object, TreeNode>();
+ private List<Object> keys = new ArrayList<Object>();
+ private Content content;
+ private String type;
+
+ @Override
+ public void addChild(Object key, TreeNode child) {
+ children.put(key, child);
+ keys.add(key);
+ }
+
+ @Override
+ public Content getContent() {
+ return content;
+ }
+
+ @Override
+ public TreeNode getChild(Object key) {
+ return children.get(key);
+ }
+
+ @Override
+ public Iterator<Object> getChildrenKeysIterator() {
+ return children.keySet().iterator();
+ }
+
+ @Override
+ public int indexOf(Object key) {
+ return keys.indexOf(key);
+ }
+
+ @Override
+ public void insertChild(int index, Object key, TreeNode child) {
+ addChild(key, child);
+ }
+
+ @Override
+ public boolean isLeaf() {
+ return children.isEmpty();
+ }
+
+ @Override
+ public void removeChild(Object key) {
+ children.remove(key);
+ keys.remove(key);
+ }
+
+ @Override
+ public void setContent(Content content) {
+ this.content = content;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ @Override
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public String toString() {
+ return content == null ? super.toString() : content.toString();
+ }
+
+ public static TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>> createFactory() {
+ return new TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>>() {
+ @Override
+ public RichFacesTreeNode<Labeled> createTreeNode(TreeNodeWithContent<Labeled> parent, Labeled content) {
+ RichFacesTreeNode<Labeled> treeNode = new RichFacesTreeNode<Labeled>();
+ if (parent != null) {
+ RichFacesTreeNode<Labeled> castedParent = (RichFacesTreeNode<Labeled>) parent;
+ castedParent.addChild(treeNode.getContent(), treeNode);
+ }
+ return treeNode;
+ }
+ };
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/SwingTreeNode.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,106 @@
+package org.richfaces.tests.metamer.model.tree;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.tree.TreeNode;
+
+import org.richfaces.tests.metamer.model.Labeled;
+
+import com.google.common.collect.Iterators;
+
+public class SwingTreeNode<Content extends Labeled> implements TreeNode, TreeNodeWithContent<Content>, Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private Content content;
+ private List<TreeNode> children = new ArrayList<TreeNode>();
+ private TreeNode parent;
+ private String type;
+
+ public void addChild(TreeNode child) {
+ children.add(child);
+ }
+
+ @Override
+ public Content getContent() {
+ return content;
+ }
+
+ @Override
+ public void setContent(Content content) {
+ this.content = content;
+ }
+
+ @Override
+ public Enumeration<TreeNode> children() {
+ return Iterators.asEnumeration(children.iterator());
+ }
+
+ @Override
+ public boolean getAllowsChildren() {
+ return isLeaf();
+ }
+
+ @Override
+ public TreeNode getChildAt(int childIndex) {
+ return children.get(childIndex);
+ }
+
+ @Override
+ public int getChildCount() {
+ return children.size();
+ }
+
+ @Override
+ public int getIndex(TreeNode node) {
+ return children.indexOf(node);
+ }
+
+ @Override
+ public TreeNode getParent() {
+ return parent;
+ }
+
+ public void setParent(TreeNode parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public boolean isLeaf() {
+ return children.isEmpty();
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ @Override
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public static TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>> createFactory() {
+ return new TreeNodeWithContentFactory<TreeNodeWithContent<Labeled>>() {
+ @Override
+ public SwingTreeNode<Labeled> createTreeNode(TreeNodeWithContent<Labeled> parent, Labeled content) {
+ SwingTreeNode<Labeled> treeNode = new SwingTreeNode<Labeled>();
+ treeNode.setContent(content);
+ if (parent != null) {
+ SwingTreeNode<Labeled> castedParent = (SwingTreeNode<Labeled>) parent;
+ castedParent.addChild(treeNode);
+ treeNode.setParent(castedParent);
+ }
+ return treeNode;
+ }
+ };
+ }
+
+ @Override
+ public String toString() {
+ return content == null ? super.toString() : content.toString();
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContent.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContent.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContent.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model.tree;
+
+import org.richfaces.tests.metamer.model.Labeled;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public interface TreeNodeWithContent<Content extends Labeled> {
+
+ Content getContent();
+
+ String getType();
+
+ void setContent(Content content);
+
+ void setType(String type);
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContentFactory.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContentFactory.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/TreeNodeWithContentFactory.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model.tree;
+
+import org.richfaces.tests.metamer.model.Labeled;
+
+/**
+ * @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
+ */
+public interface TreeNodeWithContentFactory<TreeNode extends TreeNodeWithContent<Labeled>> {
+
+ TreeNode createTreeNode(TreeNode parent, Labeled content);
+}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/rf-10994.xhtml 2011-11-24 15:54:29 UTC (rev 23001)
@@ -58,25 +58,25 @@
<rich:dragIndicator id="indicator" />
<p>
- <rich:tree value="#{richTreeBean.root}" nodeType="#{node.type}" var="node">
+ <rich:tree value="#{richTreeBean.swingTreeNodeRoot}" nodeType="#{node.type}" var="node">
<rich:treeNode type="country" title="Country node type" expanded="#{richTreeBean.expanded[node]}" >
<a4j:outputPanel layout="block">
<rich:dropTarget acceptedTypes="file" dropListener="#{richTreeBean.processDragging}" />
- <h:outputText value="#{node.name}" />
+ <h:outputText value="#{node.content.label}" />
</a4j:outputPanel>
</rich:treeNode>
<rich:treeNode type="company" title="Company node type" expanded="#{richTreeBean.expanded[node]}" >
<a4j:outputPanel layout="block">
<rich:dragSource type="file" dragIndicator="indicator" />
- <h:outputText value="#{node.name}" />
+ <h:outputText value="#{node.content.label}" />
</a4j:outputPanel>
</rich:treeNode>
<rich:treeNode type="cd" title="CD node type" expanded="#{richTreeBean.expanded[node]}" >
<a4j:outputPanel layout="block">
- <h:outputText value="#{node.artist} - #{node.title}" />
+ <h:outputText value="#{node.content.label}" />
</a4j:outputPanel>
</rich:treeNode>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-11-24 15:54:29 UTC (rev 23001)
@@ -46,7 +46,7 @@
<rich:tree id="richTree"
nodeType="#{node.type}"
var="node"
- value="#{richTreeBean.root}"
+ value="#{richTreeBean.swingTreeNodeRoot}"
selection="#{richTreeBean.selection}"
selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
toggleListener="#{richTreeListenerBean.processToggle}"
@@ -125,7 +125,7 @@
<f:facet name="handleLoading">
<h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
</f:facet>
- #{node.name}
+ #{node.content.label}
</rich:treeNode>
<rich:treeNode type="company"
@@ -161,7 +161,7 @@
<h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
</f:facet>
- #{node.name}
+ #{node.content.label}
</rich:treeNode>
<rich:treeNode type="cd"
@@ -193,7 +193,7 @@
styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
title="#{richTreeNodeBean.attributes[2]['title'].value}"
>
- #{node.artist} - #{node.title}
+ #{node.content.label}
</rich:treeNode>
</rich:tree>
</p>
@@ -206,7 +206,7 @@
<rich:tree id="richTreeDefaultNodes"
var="node"
- value="#{richTreeBean.root}"
+ value="#{richTreeBean.swingTreeNodeRoot}"
dir="#{richTreeBean.attributes['dir'].value}"
lang="#{richTreeBean.attributes['lang'].value}"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreePhases.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -57,8 +57,8 @@
@Test
public void testPhasesSelection() {
- tree.getNode(2).expand();
- tree.getNode(2).getNode(3).select();
+ tree.getNode(4).expand();
+ tree.getNode(4).getNode(3).select();
phaseInfo.assertPhases(PhaseId.ANY_PHASE);
phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "selection change listener invoked");
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -51,8 +51,8 @@
@Use(field = "selectionPaths", value = "")
public class TestTreeSelection extends AbstractMetamerTest {
- protected Integer[][] selectionPaths = new Integer[][] {{2, 3}, {3, 4}, {4, 1, 1}, {4}, {4, 1},
- {1, 5 }, {2, 3, 3 } };
+ protected Integer[][] selectionPaths = new Integer[][] {{4, 3}, {1, 4}, {2, 1, 1}, {2}, {2, 1},
+ {3, 5 }, {4, 10, 3 } };
protected TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
protected TreeNodeModel treeNode;
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -359,8 +359,8 @@
XHRHalter xhrHalter = null;
- for (int index : new int[] { 2, 3 }) {
- treeNode = (index == 2) ? tree.getNode(index) : treeNode.getNode(index);
+ for (int index : new int[] { 1, 2 }) {
+ treeNode = (index == 1) ? tree.getNode(index) : treeNode.getNode(index);
assertFalse(treeNode.getHandleLoading().isVisible());
assertTrue(treeNode.getHandle().isCollapsed());
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-11-24 14:50:12 UTC (rev 23000)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeToggling.java 2011-11-24 15:54:29 UTC (rev 23001)
@@ -46,7 +46,7 @@
private static final int TOP_LEVEL_NODES = 4;
- protected int[][] paths = new int[][] {{3, 2, 1 }, {2, 4, 1 }};
+ protected int[][] paths = new int[][] {{1, 2, 1 }, {4, 4, 1 }};
@Inject
@Use(enumeration = true)
13 years, 1 month
JBoss Rich Faces SVN: r23000 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-11-24 09:50:12 -0500 (Thu, 24 Nov 2011)
New Revision: 23000
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
logging changed to debug
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-11-24 14:18:24 UTC (rev 22999)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-11-24 14:50:12 UTC (rev 23000)
@@ -79,7 +79,7 @@
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(RichBean.class);
- logger.info("initializing bean " + getClass().getName());
+ logger.debug("initializing bean " + getClass().getName());
createSkinList();
createComponentsMap();
13 years, 1 month
JBoss Rich Faces SVN: r22999 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-11-24 09:18:24 -0500 (Thu, 24 Nov 2011)
New Revision: 22999
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java
Log:
test for rich:tabPanel fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java 2011-11-24 13:53:55 UTC (rev 22998)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanelAddPanel1.java 2011-11-24 14:18:24 UTC (rev 22999)
@@ -106,14 +106,15 @@
// tab switch work at least with "client" option
selenium.click(switchTypeFormat.format(SWITCH_TYPE_CLIENT));
+ selenium.waitForPageToLoad();
System.out.println("testSwitchTypeAjax: tab count: " + selenium.getCount(tabsCount));
-
- for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT - 1; i >= STATIC_TAB_COUNT; i--) {
- selenium.click(inactiveHeadersFormat.format(i + 1));
- waitGui.failWith("Tab " + (i + 1) + " doesn't display correct content.").until(
- textEquals.text("Content of dynamicaly created tab" + (i + 1))
- .locator(itemContentsFormat.format(i + 1)));
+
+ for (int i = STATIC_TAB_COUNT + MAX_NEW_TAB_COUNT; i > STATIC_TAB_COUNT; i--) {
+ selenium.click(inactiveHeadersFormat.format(i));
+ waitGui.failWith("Tab " + i + " doesn't display correct content.").until(
+ textEquals.text("Content of dynamicaly created tab" + i)
+ .locator(itemContentsFormat.format(i)));
}
}
13 years, 1 month
JBoss Rich Faces SVN: r22998 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-11-24 08:53:55 -0500 (Thu, 24 Nov 2011)
New Revision: 22998
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
Log:
test for attribute popupWidth of rich:dropDownMenu fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-11-24 13:18:57 UTC (rev 22997)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-11-24 13:53:55 UTC (rev 22998)
@@ -111,7 +111,8 @@
assertTrue(selenium.belongsClass(fileMenu, "rf-ddm-dis"), "Menu should have class \"rf-ddm-dis\".");
assertTrue(selenium.isElementPresent(icon), "Icon should be present on the page.");
assertFalse(selenium.isElementPresent(fileMenuLabel), "File menu should have a disabled label.");
- assertTrue(selenium.isElementPresent(pjq("div[id$=menu1] div.rf-ddm-lbl-dis")), "File menu should have a disabled label.");
+ assertTrue(selenium.isElementPresent(pjq("div[id$=menu1] div.rf-ddm-lbl-dis")),
+ "File menu should have a disabled label.");
}
@Test
@@ -183,10 +184,12 @@
selenium.mouseOver(fileMenuLabel);
selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
- waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.").until(isDisplayed.locator(groupList));
+ waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.")
+ .until(isDisplayed.locator(groupList));
selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseleave()"));
- waitGui.failWith("Attribute ongrouphide does not work correctly").until(new EventFiredCondition(new Event("grouphide")));
+ waitGui.failWith("Attribute ongrouphide does not work correctly").until(
+ new EventFiredCondition(new Event("grouphide")));
}
@Test
@@ -198,7 +201,8 @@
selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.").until(isDisplayed.locator(group));
- waitGui.failWith("Attribute ongroupshow does not work correctly").until(new EventFiredCondition(new Event("groupshow")));
+ waitGui.failWith("Attribute ongroupshow does not work correctly").until(
+ new EventFiredCondition(new Event("groupshow")));
}
@Test
@@ -269,15 +273,16 @@
@Test
public void testPopupWidth() {
- assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH), "250px", "Default width of menu");
+ final CssProperty minWidth = new CssProperty("min-width");
+ assertEquals(selenium.getStyle(fileMenuList, minWidth), "250px", "Default width of menu");
selenium.type(pjq("input[id$=popupWidthInput]"), "150");
selenium.waitForPageToLoad();
- assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH), "150px", "Width of menu");
+ assertEquals(selenium.getStyle(fileMenuList, minWidth), "150px", "Width of menu");
selenium.type(pjq("input[id$=popupWidthInput]"), "423");
selenium.waitForPageToLoad();
- assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH), "423px", "Width of menu");
+ assertEquals(selenium.getStyle(fileMenuList, minWidth), "423px", "Width of menu");
}
@Test
@@ -296,7 +301,8 @@
selenium.mouseOver(fileMenuLabel);
assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
- waitGui.interval(3000).withDelay(true).failWith("Menu was not opened.").until(isDisplayed.locator(fileMenuList));
+ waitGui.interval(3000).withDelay(true).failWith("Menu was not opened.")
+ .until(isDisplayed.locator(fileMenuList));
}
@Test
13 years, 1 month
JBoss Rich Faces SVN: r22997 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-11-24 08:18:57 -0500 (Thu, 24 Nov 2011)
New Revision: 22997
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/AbstractValidatorsTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsCSV.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsJSR303.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestWrappingValidator.java
Log:
tests for rich:validator moved to 4.Future
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/AbstractValidatorsTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/AbstractValidatorsTest.java 2011-11-24 12:57:37 UTC (rev 22996)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/AbstractValidatorsTest.java 2011-11-24 13:18:57 UTC (rev 22997)
@@ -28,7 +28,6 @@
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.BeforeClass;
/**
@@ -153,7 +152,6 @@
// waitGui.until(textEquals.locator(msgFormat.format(ID.size)).text(messages.get(ID.size)));
}
- @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void verifyAllWrongWithJSFSubmit() {
selenium.click(setWrongBtn);
@@ -396,7 +394,6 @@
/**
* Integer input, verify selection size
*/
- @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
protected void verifySelectionSize() {
selenium.click(setCorrectBtn);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsCSV.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsCSV.java 2011-11-24 12:57:37 UTC (rev 22996)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsCSV.java 2011-11-24 13:18:57 UTC (rev 22997)
@@ -24,11 +24,12 @@
import java.net.URL;
import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
* Selenium tests for page faces/components/richValidator/csv.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
@@ -38,88 +39,90 @@
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richValidator/csv.xhtml");
}
-
+
@Test
public void testAllWrong() {
verifyAllWrongWithAjaxSubmit();
}
-
- @Test
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void testAllWrongJSF() {
verifyAllWrongWithJSFSubmit();
}
-
+
@Test
public void testBooleanTrue() {
verifyBooleanTrue();
}
-
+
@Test
public void testBooleanFalse() {
verifyBooleanFalse();
}
-
+
@Test
public void testDecimalMinMax() {
verifyDecimalMinMax();
}
-
+
@Test
public void testIntegerMax() {
verifyMax();
}
-
+
@Test
public void testIntegerMin() {
verifyMin();
}
-
+
@Test
public void testIntegerMinMax() {
verifyMinMax();
}
-
+
@Test
public void testTextNotEmpty() {
verifyNotEmpty();
}
-
+
@Test
public void testTextNotNull() {
verifyNotNull();
}
-
+
@Test
public void testTextPattern() {
verifyPattern();
}
-
+
@Test
public void testTextCustomPattern() {
verifyCustom();
}
-
+
@Test
public void testTextRegExp() {
verifyRegExp();
}
-
+
@Test
public void testDatePast() {
verifyDatePast();
}
-
+
@Test
public void testDateFuture() {
verifyDateFuture();
}
-
+
@Test
public void testStringSize() {
verifyStringSize();
}
-
- @Test
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void testSelectionSize() {
verifySelectionSize();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsJSR303.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsJSR303.java 2011-11-24 12:57:37 UTC (rev 22996)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestValidatorsJSR303.java 2011-11-24 13:18:57 UTC (rev 22997)
@@ -24,11 +24,12 @@
import java.net.URL;
import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
* Selenium tests for page faces/components/richValidator/jsr303.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
@@ -38,83 +39,85 @@
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richValidator/jsr303.xhtml");
}
-
+
@Test
public void testAllWrong() {
verifyAllWrongWithAjaxSubmit();
}
-
- @Test
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void testAllWrongJSF() {
verifyAllWrongWithJSFSubmit();
}
-
+
@Test
public void testBooleanTrue() {
verifyBooleanTrue();
}
-
+
@Test
public void testBooleanFalse() {
verifyBooleanFalse();
}
-
+
@Test
public void testDecimalMinMax() {
verifyDecimalMinMax();
}
-
+
@Test
public void testIntegerMax() {
verifyMax();
}
-
+
@Test
public void testIntegerMin() {
verifyMin();
}
-
+
@Test
public void testIntegerMinMax() {
verifyMinMax();
}
-
+
@Test
public void testTextNotEmpty() {
verifyNotEmpty();
}
-
+
@Test
public void testTextNotNull() {
verifyNotNull();
}
-
+
@Test
public void testTextPattern() {
verifyPattern();
}
-
+
@Test
public void testTextCustomPattern() {
verifyCustom();
}
-
+
@Test
public void testDatePast() {
verifyDatePast();
}
-
+
@Test
public void testDateFuture() {
verifyDateFuture();
}
-
+
@Test
public void testStringSize() {
verifyStringSize();
}
-
- @Test
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void testSelectionSize() {
verifySelectionSize();
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestWrappingValidator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestWrappingValidator.java 2011-11-24 12:57:37 UTC (rev 22996)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richValidator/TestWrappingValidator.java 2011-11-24 13:18:57 UTC (rev 22997)
@@ -24,11 +24,12 @@
import java.net.URL;
import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.testng.annotations.Test;
/**
* Selenium tests for page faces/components/richValidator/wrapping.xhtml
- *
+ *
* @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
* @version $Revision$
*/
@@ -39,83 +40,85 @@
public URL getTestUrl() {
return URLUtils.buildUrl(contextPath, "faces/components/richValidator/wrapping.xhtml");
}
-
+
@Test
public void testAllWrong() {
verifyAllWrongWithAjaxSubmit();
}
-
- @Test
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void testAllWrongJSF() {
verifyAllWrongWithJSFSubmit();
}
-
+
@Test
public void testBooleanTrue() {
verifyBooleanTrue();
}
-
+
@Test
public void testBooleanFalse() {
verifyBooleanFalse();
}
-
+
@Test
public void testDecimalMinMax() {
verifyDecimalMinMax();
}
-
+
@Test
public void testIntegerMax() {
verifyMax();
}
-
+
@Test
public void testIntegerMin() {
verifyMin();
}
-
+
@Test
public void testIntegerMinMax() {
verifyMinMax();
}
-
+
@Test
public void testTextNotEmpty() {
verifyNotEmpty();
}
-
+
@Test
public void testTextNotNull() {
verifyNotNull();
}
-
+
@Test
public void testTextPattern() {
verifyPattern();
}
-
+
@Test
public void testTextCustomPattern() {
verifyCustom();
}
-
+
@Test
public void testDatePast() {
verifyDatePast();
}
-
+
@Test
public void testDateFuture() {
verifyDateFuture();
}
-
+
@Test
public void testStringSize() {
verifyStringSize();
}
-
- @Test
+
+ @Test(groups = { "4.Future" })
+ @IssueTracking(value = "https://issues.jboss.org/browse/RF-11035")
public void testSelectionSize() {
verifySelectionSize();
}
13 years, 1 month