JBoss Rich Faces SVN: r21913 - in branches/4.0.0.CR1/examples/richfaces-showcase/src/main: resources/org/richfaces/demo/data/common and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-02-24 07:29:56 -0500 (Thu, 24 Feb 2011)
New Revision: 21913
Modified:
branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java
branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/GroupDescriptor.java
branches/4.0.0.CR1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/templates/includes/navigation.xhtml
Log:
http://jira.jboss.org/browse/RF-10582
Modified: branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java
===================================================================
--- branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java 2011-02-24 12:01:51 UTC (rev 21912)
+++ branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java 2011-02-24 12:29:56 UTC (rev 21913)
@@ -10,9 +10,22 @@
private static final long serialVersionUID = 6822187362271025752L;
private static final String BASE_SAMPLES_DIR = "/richfaces/";
-
+
private List<SampleDescriptor> samples;
+ private boolean containsNewSamples() {
+ for (SampleDescriptor sample : samples) {
+ if (sample.isNewItem()){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isNewItems() {
+ return (isNewItem() || containsNewSamples());
+ }
+
public SampleDescriptor getSampleById(String id) {
for (SampleDescriptor sample : getSamples()) {
if (sample.getId().equals(id)) {
Modified: branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/GroupDescriptor.java
===================================================================
--- branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/GroupDescriptor.java 2011-02-24 12:01:51 UTC (rev 21912)
+++ branches/4.0.0.CR1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/navigation/GroupDescriptor.java 2011-02-24 12:29:56 UTC (rev 21913)
@@ -11,6 +11,19 @@
private List<DemoDescriptor> demos;
+ private boolean containsNewDemos() {
+ for (DemoDescriptor demo : demos) {
+ if (demo.isNewItems()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isNewItems() {
+ return isNewItem() || containsNewDemos();
+ }
+
@XmlElementWrapper(name = "demos")
@XmlElement(name = "demo")
public List<DemoDescriptor> getDemos() {
Modified: branches/4.0.0.CR1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- branches/4.0.0.CR1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-02-24 12:01:51 UTC (rev 21912)
+++ branches/4.0.0.CR1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-02-24 12:29:56 UTC (rev 21913)
@@ -172,10 +172,10 @@
</demo>
</demos>
</group>
- <group>
+ <group new="true">
<name>Validation</name>
<demos>
- <demo new="true">
+ <demo>
<id>clientValidation</id>
<name>Client Side Validation</name>
<samples>
@@ -189,7 +189,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>graphValidator</id>
<name>rich:graphValidator</name>
<samples>
@@ -199,7 +199,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>message</id>
<name>rich:message</name>
<samples>
@@ -209,7 +209,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>messages</id>
<name>rich:messages</name>
<samples>
@@ -464,7 +464,7 @@
<group>
<name>Menus</name>
<demos>
- <demo new="true">
+ <demo>
<id>panelMenu</id>
<name>rich:panelMenu</name>
<samples>
@@ -474,7 +474,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>toolBar</id>
<name>rich:toolBar</name>
<samples>
@@ -488,7 +488,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>dropDownMenu</id>
<name>rich:dropDownMenu</name>
<samples>
@@ -521,19 +521,19 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>calendar</id>
<name>rich:calendar</name>
<samples>
- <sample new="true">
+ <sample>
<id>calendar</id>
<name>Simple Calendar</name>
</sample>
- <sample new="true">
+ <sample>
<id>clientStylingDisablement</id>
<name>Client Side Styling/Disablement</name>
</sample>
- <sample new="true">
+ <sample>
<id>dataModel</id>
<name>Data Model Support</name>
</sample>
@@ -589,7 +589,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>fileUpload</id>
<name>rich:fileUpload</name>
<samples>
@@ -605,7 +605,7 @@
<name>Drag and Drop</name>
<demos>
<demo new="true">
- <id>dragDrop</id>
+ <id>dragDrop</id>
<name>Drag and Drop</name>
<samples>
<sample>
Modified: branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
===================================================================
--- branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2011-02-24 12:01:51 UTC (rev 21912)
+++ branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2011-02-24 12:29:56 UTC (rev 21913)
@@ -12,7 +12,7 @@
</style>
<h:form id="form">
<h:panelGrid columns="2" columnClasses="cols,cols" width="400">
- <rich:panelMenu style="width:200px" mode="ajax" groupMode="ajax"
+ <rich:panelMenu style="width:200px" itemMode="ajax" groupMode="ajax"
groupExpandedLeftIcon="triangleUp"
groupCollapsedLeftIcon="triangleDown"
topGroupExpandedRightIcon="chevronUp"
Modified: branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/templates/includes/navigation.xhtml
===================================================================
--- branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/templates/includes/navigation.xhtml 2011-02-24 12:01:51 UTC (rev 21912)
+++ branches/4.0.0.CR1/examples/richfaces-showcase/src/main/webapp/templates/includes/navigation.xhtml 2011-02-24 12:29:56 UTC (rev 21913)
@@ -7,10 +7,13 @@
xmlns:c="http://java.sun.com/jsp/jstl/core">
<rich:panelMenu activeItem="#{demoNavigator.currentDemo.id}">
<c:forEach items="#{demoNavigator.groups}" var="gr">
- <rich:panelMenuGroup label="#{gr.name}">
+ <rich:panelMenuGroup label="#{gr.name}"
+ rightExpandedIcon="#{gr.newItems ? '/images/icons/new-ic.gif' : null}"
+ rightCollapsedIcon="#{gr.newItems ? '/images/icons/new-ic.gif' : null}">
<c:forEach items="#{gr.demos}" var="d">
- <rich:panelMenuItem label="#{d.name}" action="#{d.id}" rightIcon="none"
+ <rich:panelMenuItem label="#{d.name}" action="#{d.id}"
mode="client" name="#{d.id}"
+ rightIcon="#{(d.newItems || gr.newItem) ? '/images/icons/new-small-ic.gif' : null}"
onclick="document.location='#{facesContext.externalContext.requestContextPath}/richfaces/component-sample.jsf?demo=#{d.id}&skin=#{skinBean.skin}'">
</rich:panelMenuItem>
</c:forEach>
13 years, 11 months
JBoss Rich Faces SVN: r21912 - in branches/4.0.0.CR1/ui/iteration/ui/src/main: resources/META-INF/cdk/attributes and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-24 07:01:51 -0500 (Thu, 24 Feb 2011)
New Revision: 21912
Added:
branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/tree-serverEventListeners-props.xml
branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/treeNode-serverEventListeners-props.xml
Modified:
branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
Log:
https://issues.jboss.org/browse/RF-10594
https://issues.jboss.org/browse/RF-10603
Modified: branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2011-02-24 11:11:26 UTC (rev 21911)
+++ branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2011-02-24 12:01:51 UTC (rev 21912)
@@ -30,7 +30,6 @@
import javax.el.ELContext;
import javax.el.ELException;
-import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
@@ -57,7 +56,6 @@
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.component.util.MessageUtil;
import org.richfaces.context.ExtendedVisitContext;
@@ -92,7 +90,8 @@
family = AbstractTree.COMPONENT_FAMILY,
tag = @Tag(name = "tree", handler = "org.richfaces.view.facelets.TreeHandler"),
renderer = @JsfRenderer(type = "org.richfaces.TreeRenderer"),
- attributes = {"ajax-props.xml", "events-props.xml", "core-props.xml", "i18n-props.xml", "tree-common-props.xml", "rowKeyConverter-prop.xml"}
+ attributes = {"ajax-props.xml", "events-props.xml", "core-props.xml", "i18n-props.xml", "tree-common-props.xml",
+ "rowKeyConverter-prop.xml", "tree-serverEventListeners-props.xml"}
)
//TODO add rowData caching for wrapper events
public abstract class AbstractTree extends UIDataAdaptor implements MetaComponentResolver, MetaComponentEncoder, TreeSelectionChangeSource, TreeToggleSource {
@@ -138,14 +137,6 @@
selection
}
- @SuppressWarnings("unused")
- @Attribute(generate = false, signature = @Signature(returnType = Void.class, parameters = TreeSelectionChangeEvent.class))
- private MethodExpression selectionChangeListener;
-
- @SuppressWarnings("unused")
- @Attribute(generate = false, signature = @Signature(returnType = Void.class, parameters = TreeToggleListener.class))
- private MethodExpression toggleListener;
-
private transient TreeRange treeRange;
private transient UIComponent currentComponent = this;
@@ -203,6 +194,7 @@
return COMPONENT_FAMILY;
}
+ @Attribute
public Collection<Object> getSelection() {
@SuppressWarnings("unchecked")
Collection<Object> selection = (Collection<Object>) getStateHelper().eval(PropertyKeys.selection);
Modified: branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
===================================================================
--- branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2011-02-24 11:11:26 UTC (rev 21911)
+++ branches/4.0.0.CR1/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2011-02-24 12:01:51 UTC (rev 21912)
@@ -23,7 +23,6 @@
import java.io.IOException;
-import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -40,7 +39,6 @@
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.context.ExtendedVisitContextMode;
@@ -58,7 +56,7 @@
family = AbstractTreeNode.COMPONENT_FAMILY,
tag = @Tag(name = "treeNode", handler = "org.richfaces.view.facelets.TreeNodeHandler"),
renderer = @JsfRenderer(type = "org.richfaces.TreeNodeRenderer"),
- attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml", "tree-common-props.xml"}
+ attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml", "tree-common-props.xml", "treeNode-serverEventListeners-props.xml"}
)
public abstract class AbstractTreeNode extends UIComponentBase implements MetaComponentResolver, MetaComponentEncoder, IterationStateHolder, TreeToggleSource {
@@ -72,9 +70,6 @@
expanded
}
- @Attribute(generate = false, signature = @Signature(returnType = Void.class, parameters = TreeToggleEvent.class))
- private MethodExpression toggleListener;
-
public AbstractTreeNode() {
setRendererType("org.richfaces.TreeNodeRenderer");
}
Added: branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/tree-serverEventListeners-props.xml
===================================================================
--- branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/tree-serverEventListeners-props.xml (rev 0)
+++ branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/tree-serverEventListeners-props.xml 2011-02-24 12:01:51 UTC (rev 21912)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright ${year}, 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. -->
+<cdk:properties xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee">
+
+ <property>
+ <property-name>selectionChangeListener</property-name>
+ <property-class>javax.el.MethodExpression</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>toggleListener</property-name>
+ <property-class>javax.el.MethodExpression</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ </property-extension>
+ </property>
+
+</cdk:properties>
Added: branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/treeNode-serverEventListeners-props.xml
===================================================================
--- branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/treeNode-serverEventListeners-props.xml (rev 0)
+++ branches/4.0.0.CR1/ui/iteration/ui/src/main/resources/META-INF/cdk/attributes/treeNode-serverEventListeners-props.xml 2011-02-24 12:01:51 UTC (rev 21912)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright ${year}, 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. -->
+<cdk:properties xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee">
+
+ <property>
+ <property-name>toggleListener</property-name>
+ <property-class>javax.el.MethodExpression</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ </property-extension>
+ </property>
+
+</cdk:properties>
13 years, 11 months
JBoss Rich Faces SVN: r21911 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-24 06:11:26 -0500 (Thu, 24 Feb 2011)
New Revision: 21911
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
Log:
fixed issues with recognition of selected nodes in map
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2011-02-24 11:10:32 UTC (rev 21910)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2011-02-24 11:11:26 UTC (rev 21911)
@@ -129,6 +129,11 @@
public int compareTo(K o) {
return this.number - o.number;
}
+
+ @Override
+ public String toString() {
+ return Integer.toString(number);
+ }
}
public class V implements Serializable {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-24 11:10:32 UTC (rev 21910)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-24 11:11:26 UTC (rev 21911)
@@ -140,15 +140,21 @@
}
private Integer fixShiftWhenModelPresent(List<Integer> list, int integer) {
- if (paths.toString().equals(pathsForRecursiveModel.toString())) {
- if (!list.isEmpty()) {
- if (list.get(0) % 2 == 0) {
- if (list.size() == 2) {
+ if (!list.isEmpty()) {
+ if (list.get(0) % 2 == 0) {
+ if (list.size() == 2) {
+ if (paths.toString().equals(pathsForRecursiveModel.toString())) {
return integer + 7;
+ } else if (paths.toString().equals(pathsForMapModel.toString())) {
+ return integer + 3;
}
- } else {
- if (list.size() == 3) {
+ }
+ } else {
+ if (list.size() == 3) {
+ if (paths.toString().equals(pathsForRecursiveModel.toString())) {
return integer + 7;
+ } else if (paths.toString().equals(pathsForMapModel.toString())) {
+ return integer + 3;
}
}
}
13 years, 11 months
JBoss Rich Faces SVN: r21910 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-24 06:10:32 -0500 (Thu, 24 Feb 2011)
New Revision: 21910
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
Log:
made selection serializable (RF-10602)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-02-24 11:09:55 UTC (rev 21909)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-02-24 11:10:32 UTC (rev 21910)
@@ -57,7 +57,7 @@
private static Logger logger;
private Attributes attributes;
private List<NamedNode> root = new ArrayList<NamedNode>();
- private transient Collection<Object> selection;
+ private Collection<? extends Serializable> selection;
// FIXME: @ManagedProperty(value = "#{model}")
// private Model model;
@@ -149,11 +149,11 @@
return root;
}
- public Collection<Object> getSelection() {
+ public Collection<? extends Serializable> getSelection() {
return selection;
}
- public void setSelection(Collection<Object> selection) {
+ public void setSelection(Collection<? extends Serializable> selection) {
this.selection = selection;
}
13 years, 11 months
JBoss Rich Faces SVN: r21909 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTreeModelAdaptor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-24 06:09:55 -0500 (Thu, 24 Feb 2011)
New Revision: 21909
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/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
Log:
made tree selection asserts little more verbose
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-02-24 05:30:15 UTC (rev 21908)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSelection.java 2011-02-24 11:09:55 UTC (rev 21909)
@@ -29,11 +29,13 @@
import static org.testng.Assert.assertTrue;
import java.net.URL;
+import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
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;
@@ -62,7 +64,7 @@
@Inject
@Use(value = "selectionTypes")
- SwitchType selectionType = SwitchType.client;
+ SwitchType selectionType;
SwitchType[] selectionTypes = new SwitchType[] { SwitchType.ajax, SwitchType.client };
SwitchType[] eventEnabledSelectionTypes = new SwitchType[] { SwitchType.ajax };
@@ -122,10 +124,22 @@
}
treeNode.select();
assertEquals(getClientId(), "richTree");
- assertEquals(getSelection(), path);
- assertEquals(getNewSelection(), path);
+ assertEquals(
+ getSelection(),
+ path,
+ SimplifiedFormat.format("Actual Selection ({0}) doesn't correspond to expected ({1})",
+ Arrays.deepToString(getSelection()), Arrays.deepToString(path)));
+ assertEquals(
+ getNewSelection(),
+ path,
+ SimplifiedFormat.format("Actual New selection ({0}) doesn't correspond to expected ({1})",
+ Arrays.deepToString(getNewSelection()), Arrays.deepToString(path)));
if (old != null) {
- assertEquals(getOldSelection(), old);
+ assertEquals(
+ getOldSelection(),
+ old,
+ SimplifiedFormat.format("Actual Old selection ({0}) doesn't correspond to expected ({1})",
+ Arrays.deepToString(getOldSelection()), Arrays.deepToString(old)));
} else {
assertEquals(selenium.getText(oldSelection), "[]");
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-24 05:30:15 UTC (rev 21908)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-24 11:09:55 UTC (rev 21909)
@@ -57,7 +57,7 @@
@Inject
@Use(enumeration = true)
- public RecursiveModelRepresentation representation = RecursiveModelRepresentation.LIST;
+ public RecursiveModelRepresentation representation;
@Inject
@Use(booleans = { true, false })
@@ -134,7 +134,7 @@
list.add(integer);
}
if (list.isEmpty()) {
- throw new IllegalStateException("pattern does not match");
+ throw new IllegalStateException("selection string does not match pattern: " + string);
}
return list.toArray(new Integer[list.size()]);
}
13 years, 11 months
JBoss Rich Faces SVN: r21908 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-02-24 00:30:15 -0500 (Thu, 24 Feb 2011)
New Revision: 21908
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemBean.java
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemNode.java
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.png
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml
Log:
Updated trees declarative models documentation RFPL-991
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2011-02-24 01:35:22 UTC (rev 21907)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2011-02-24 05:30:15 UTC (rev 21908)
@@ -425,23 +425,26 @@
<section id="sect-Component_Reference-Trees-Tree_adaptors">
<title>Tree adaptors</title>
<para>
- Use a tree adaptor to create a tree and populate it with data from a defined data model.
+ Use a tree adaptor to populate a tree model declaratively from a non-hierarchical model, such as a list or a map.
</para>
<section id="sect-Component_Reference-Tree_adaptors-richtreeModelAdaptor">
<title><sgmltag><rich:treeModelAdaptor></sgmltag></title>
<para>
- The <sgmltag><rich:treeModelAdaptor></sgmltag> component takes a defined data model and uses it to populate an associated <sgmltag><rich:tree></sgmltag> component.
+ The <sgmltag><rich:treeModelAdaptor></sgmltag> component takes an object which implements the <interfacename>Map</interfacename> or <interfacename>Iterable</interfacename> interfaces. It adds all the object entries to the parent node as child nodes.
</para>
<section id="sect-Component_Reference-richtreeModelAdaptor-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:treeModelAdaptor></sgmltag> component is added as a nested child component to the <sgmltag><rich:tree></sgmltag> component it will populate.
+ The <sgmltag><rich:treeModelAdaptor></sgmltag> component is added as a nested child component to a <sgmltag><rich:tree></sgmltag> component, or to another tree adaptor component.
</para>
<para>
- The <sgmltag><rich:treeModelAdaptor></sgmltag> component requires the <varname>nodes</varname> attribute for basic usage. The <varname>nodes</varname> attribute defines a collection of elements to iterate through for populating the tree.
+ The <sgmltag><rich:treeModelAdaptor></sgmltag> component requires the <varname>nodes</varname> attribute for basic usage. The <varname>nodes</varname> attribute defines a collection of elements to iterate through for populating the nodes.
</para>
+ <para>
+ Define the appearance of each node added by the adaptor with a child <sgmltag><rich:treeNode></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-Trees-richtreeNode" /> for details on the <sgmltag><rich:treeNode></sgmltag> component.
+ </para>
</section>
<section id="sect-Component_Reference-richtreeModelAdaptor-Multiple_levels">
@@ -450,12 +453,15 @@
<sgmltag><rich:treeModelAdaptor></sgmltag> components can further be nested in other <sgmltag><rich:treeModelAdaptor></sgmltag> components to subsequently populate lower levels of the tree.
</para>
<para>
- Use the <varname>var</varname> attribute to access the current collection element at each level. <xref linkend="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components" /> demonstrates a series of nested <sgmltag><rich:treeModelAdaptor></sgmltag> components, each using the parent's <varname>var</varname> attribute to reference the current element.
+ To access the current element at each iteration, use the <varname>var</varname> attribute of either the parent <sgmltag><rich:tree></sgmltag> component or the <sgmltag><rich:treeModelAdaptor></sgmltag> component itself. <xref linkend="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components" /> demonstrates a series of nested <sgmltag><rich:treeModelAdaptor></sgmltag> components, each using the parent's <varname>var</varname> attribute to reference the current element.
</para>
<example id="exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components">
<title><sgmltag>Nested <rich:treeModelAdaptor> components</sgmltag></title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richtreeModelAdaptor-Nested_richtreeModelAdaptor_components.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</example>
+ <para>
+ Each <sgmltag><rich:treeModelAdaptor></sgmltag> component is mapped to a list of objects. During the iteration, the corresponding object properties are used to define the node labels and actions, and are in turn used for iterating through nested lists.
+ </para>
</section>
<section id="sect-Component_Reference-richtreeModelAdaptor-Reference_data">
@@ -488,7 +494,7 @@
<section id="sect-Component_Reference-Tree_adaptors-richtreeModelRecursiveAdaptor">
<title><sgmltag><rich:treeModelRecursiveAdaptor></sgmltag></title>
<para>
- The <sgmltag><rich:treeModelRecursiveAdaptor></sgmltag> component recursively populates a tree with hierarchical nodes, such as for a file system with multiple levels of directories and files.
+ The <sgmltag><rich:treeModelRecursiveAdaptor></sgmltag> component iterates through recursive collections in order to populate a tree with hierarchical nodes, such as for a file system with multiple levels of directories and files.
</para>
<section id="sect-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage">
@@ -505,6 +511,30 @@
<example id="exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage">
<title>Basic usage</title>
<programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The <sgmltag><rich:treeModelRecursiveAdaptor></sgmltag> component references the <classname>FileSystemBean</classname> class as the source for the data.
+ </para>
+ <programlisting language="Java" role="JAVA"><xi:include parse="text" href="extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemBean.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The <classname>FileSystemBean</classname> class in turn uses the <classname>FileSystemNode</classname> class to recursively iterate through the collection.
+ </para>
+ <programlisting language="Java" role="JAVA"><xi:include parse="text" href="extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemNode.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The <function>getDirectories()</function> function is used recursively until the object has the collection of children. The model adaptor calls the <function>getFiles()</function> function at each level in order to add the file nodes.
+ </para>
+ <para>
+ The resulting tree hierarchically lists the directories and files in the collection.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A hierarchical tree detailing a file system.
+ </para>
+ </textobject>
+ </mediaobject>
</example>
</section>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml 2011-02-24 01:35:22 UTC (rev 21907)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml 2011-02-24 05:30:15 UTC (rev 21908)
@@ -11,7 +11,7 @@
</para>
<example id="exam-Component_Reference-Validation-JSR-303_validation_annotations">
<title>JSR-303 validation annotations</title>
- <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-Validation-JSR-303_validation_annotations.js" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <programlisting language="Java" role="JAVA"><xi:include parse="text" href="extras/exam-Component_Reference-Validation-JSR-303_validation_annotations.js" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
</example>
<note>
<title>Requirements</title>
@@ -152,7 +152,7 @@
<para>
The input controls validate against the following bean:
</para>
- <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richgraphValidator-Basic_usage.js" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <programlisting language="Java" role="JAVA"><xi:include parse="text" href="extras/exam-Component_Reference-richgraphValidator-Basic_usage.js" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<para>
When validation occurs, the whole object is validated against the annotation contstraints. The <varname>@AssertTrue</varname> annotation relies on the <methodname>isPasswordsEqual()</methodname> function to check whether the two entered passwords are equal.
</para>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemBean.java
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemBean.java (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemBean.java 2011-02-24 05:30:15 UTC (rev 21908)
@@ -0,0 +1,14 @@
+@ManagedBean
+@RequestScoped
+public class FileSystemBean {
+ private static final String SRC_PATH = "/WEB-INF";
+
+ private List<FileSystemNode> srcRoots;
+
+ public synchronized List<FileSystemNode> getSourceRoots() {
+ if (srcRoots == null) {
+ srcRoots = new FileSystemNode(SRC_PATH).getDirectories();
+ }
+ return srcRoots;
+ }
+}
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemNode.java
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemNode.java (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeModelRecursiveAdaptor-FileSystemNode.java 2011-02-24 05:30:15 UTC (rev 21908)
@@ -0,0 +1,30 @@
+public class FileSystemNode {
+ ...
+ public synchronized List<FileSystemNode> getDirectories() {
+ if (directories == null) {
+ directories = Lists.newArrayList();
+ Iterables.addAll(directories, transform(filter(getResourcePaths(), containsPattern("/$")), FACTORY));
+ }
+ return directories;
+ }
+
+ public synchronized List<String> getFiles() {
+ if (files == null) {
+ files = new ArrayList<String>();
+ Iterables.addAll(files, transform(filter(getResourcePaths(), not(containsPattern("/$"))), TO_SHORT_PATH));
+ }
+ return files;
+ }
+
+ private Iterable<String> getResourcePaths() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+ Set<String> resourcePaths = externalContext.getResourcePaths(this.path);
+
+ if (resourcePaths == null) {
+ resourcePaths = Collections.emptySet();
+ }
+ return resourcePaths;
+ }
+ ...
+}
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.png
===================================================================
(Binary files differ)
Property changes on: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/exam-Component_Reference-richtreeModelRecursiveAdaptor-Basic_usage.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
13 years, 11 months
JBoss Rich Faces SVN: r21907 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/model/treeAdaptor and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-23 20:35:22 -0500 (Wed, 23 Feb 2011)
New Revision: 21907
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
added KeyConverter which enables selection of map values by adaptors (RFPL-1133)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-02-24 01:34:24 UTC (rev 21906)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-02-24 01:35:22 UTC (rev 21907)
@@ -50,13 +50,16 @@
@ViewScoped
public class RichTreeModelRecursiveAdaptorBean implements Serializable {
+
private static final long serialVersionUID = 4008175400649809L;
private static Logger logger;
+ private static List<RecursiveNode> rootNodes;
+
private Attributes attributes;
private AtomicReference<Boolean> leafChildrenNullable = new AtomicReference<Boolean>(true);
private boolean useMapModel;
- private transient List<RecursiveNode> rootNodes;
private Map<String, Boolean> expanded = new TreeMap<String, Boolean>();
+ private boolean rootNodesInitialized = false;
/*
* Nodes which was loaded lazily in the current request
@@ -97,7 +100,7 @@
}
public List<RecursiveNode> getRootNodes() {
- if (rootNodes == null) {
+ if (!rootNodesInitialized) {
rootNodes = RecursiveNode.createChildren(null, leafChildrenNullable,
new Reference<LazyLoadingListener<Node>>() {
private static final long serialVersionUID = 1L;
@@ -107,6 +110,7 @@
return nodeLazyLoadingListener;
}
});
+ rootNodesInitialized = true;
}
return rootNodes;
}
@@ -130,4 +134,8 @@
public Map<String, Boolean> getExpanded() {
return expanded;
}
+
+ public static List<RecursiveNode> getRootNodesStatically() {
+ return rootNodes;
+ }
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java 2011-02-24 01:35:22 UTC (rev 21907)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * 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.treeAdaptor;
+
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+
+import org.apache.commons.lang.CharUtils;
+import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+
+import com.google.common.base.Strings;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@FacesConverter("treeAdaptorKeyConverter")
+public class KeyConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ List<RecursiveNode> list = RichTreeModelRecursiveAdaptorBean.getRootNodesStatically();
+ RecursiveNode recursive = null;
+ ModelNode model = null;
+
+ char alpha = ' ';
+ for (int i = 0; i < value.length(); i++) {
+ char ch = value.charAt(i);
+ if (CharUtils.isAsciiAlpha(ch)) {
+ alpha = ch;
+ switch (alpha) {
+ case 'M':
+ model = recursive.getModel();
+ break;
+ default:
+ }
+ }
+ if (CharUtils.isAsciiNumeric(ch)) {
+ int num = CharUtils.toIntValue(ch);
+ switch (alpha) {
+ case 'R':
+ recursive = list.get(num);
+ list = recursive.getRecursiveList();
+ break;
+
+ case 'K':
+ for (ModelNode.K key : model.getMap().keySet()) {
+ if (key.number == num) {
+ return key;
+ }
+ }
+ throw new IllegalStateException();
+ default:
+ }
+ }
+ }
+
+ if (Strings.isNullOrEmpty(value)) {
+ return null;
+ }
+
+ return null;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+ if (value instanceof ModelNode.K) {
+ ModelNode.K k = (ModelNode.K) value;
+ return k.getLabel();
+ }
+
+ if (value == null) {
+ return "";
+ }
+
+ throw new IllegalStateException();
+ }
+
+}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2011-02-24 01:34:24 UTC (rev 21906)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2011-02-24 01:35:22 UTC (rev 21907)
@@ -112,7 +112,7 @@
}
}
- public class K implements Serializable {
+ public class K implements Serializable, Comparable<K> {
private static final long serialVersionUID = 1L;
int number;
@@ -124,6 +124,11 @@
public String getLabel() {
return ModelNode.this.getLabel() + "-K-" + number;
}
+
+ @Override
+ public int compareTo(K o) {
+ return this.number - o.number;
+ }
}
public class V implements Serializable {
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-02-24 01:34:24 UTC (rev 21906)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2011-02-24 01:35:22 UTC (rev 21907)
@@ -125,7 +125,8 @@
<rich:treeModelAdaptor
nodes="#{node.model.map}"
- rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
+ rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}"
+ rowKeyConverter="treeAdaptorKeyConverter">
<rich:treeNode>
#{node.label}
</rich:treeNode>
13 years, 11 months
JBoss Rich Faces SVN: r21906 - modules/tests/metamer/trunk/application/src/main/webapp/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-23 20:34:24 -0500 (Wed, 23 Feb 2011)
New Revision: 21906
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js
Log:
enabled updating javax.faces.ViewState across all forms for MyFaces (Mojarra compatibility RFPL-1187)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js 2011-02-24 01:33:56 UTC (rev 21905)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js 2011-02-24 01:34:24 UTC (rev 21906)
@@ -1,4 +1,14 @@
/**
+ * MyFaces configuration
+ */
+window.myfaces = window.myfaces || {};
+myfaces.config = myfaces.config || {};
+/**
+ * enables updating javax.faces.ViewState across all forms (Mojarra compatibility - https://issues.jboss.org/browse/RFPL-1187)
+ */
+myfaces.config.no_portlet_env = true;
+
+/**
* Variable used in Selenium tests for testing JavaScript events. Each event adds its name to this
* variable. E.g. if onbegin, onbeforedomupdate and oncomplete is set, successful result will be
* "begin beforedomupdate complete ".
13 years, 11 months
JBoss Rich Faces SVN: r21905 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-23 20:33:56 -0500 (Wed, 23 Feb 2011)
New Revision: 21905
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
Log:
refactored a4j:status - instant attributes test
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java 2011-02-24 01:33:20 UTC (rev 21904)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java 2011-02-24 01:33:56 UTC (rev 21905)
@@ -63,6 +63,7 @@
void testRequestButton(ElementLocator<?> button, String startStatusText, String stopStatusText) {
XHRHalter.enable();
selenium.click(button);
+
XHRHalter halt = getCurrentXHRHalter();
assertEquals(retrieveStatus.retrieve(), startStatusText);
retrieveStatus.initializeValue();
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java 2011-02-24 01:33:20 UTC (rev 21904)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java 2011-02-24 01:33:56 UTC (rev 21905)
@@ -21,17 +21,17 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jStatus;
+import static org.jboss.test.selenium.encapsulated.JavaScript.js;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
-import static org.jboss.test.selenium.encapsulated.JavaScript.js;
import static org.testng.Assert.assertEquals;
import java.net.URL;
import org.jboss.cheiron.halt.XHRHalter;
import org.jboss.test.selenium.encapsulated.JavaScript;
-import org.jboss.test.selenium.locator.ElementLocator;
+import org.jboss.test.selenium.request.RequestType;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -41,13 +41,8 @@
@IssueTracking("https://issues.jboss.org/browse/RFPL-1186")
public class TestInstantAttributes extends AbstracStatusTest {
- StatusAttributes attributes = new StatusAttributes() {
- protected void applyText(ElementLocator<?> locator, String value) {
- guardXhr(selenium).type(locator, value);
+ StatusAttributes attributes = new StatusAttributes();
- };
- };
-
JavaScript alert = js("alert('{0}')");
@Override
@@ -55,18 +50,28 @@
return buildUrl(contextPath, "faces/components/a4jStatus/instantAttributes.xhtml");
}
+ @BeforeMethod
+ public void setupAttributes() {
+ attributes.setRequestType(RequestType.XHR);
+ }
+
@Test
public void testOnStart() {
+ attributes.setRequestType(null);
+
+ XHRHalter.enable();
for (int i = 0; i < 2; i++) {
- attributes.setOnStart(alert.parametrize("start" + 1));
+ final int ii = i;
+ retrieveRequestTime.initializeValue();
+ attributes.setOnStart(js("window.metamer = " + ii));
+ getCurrentXHRHalter().complete();
+ waitGui.waitForChange(retrieveRequestTime);
- XHRHalter.enable();
selenium.click(button1);
- selenium.waitForCondition(js("selenium.isAlertPresent()"));
- assertEquals(selenium.getAlert(), "start" + 1);
+ selenium.waitForCondition(js("window.metamer == " + i));
getCurrentXHRHalter().complete();
- XHRHalter.disable();
}
+ XHRHalter.disable();
}
@Test
13 years, 11 months
JBoss Rich Faces SVN: r21904 - modules/tests/metamer/trunk/ftest-source/src/main/resources/javascript/cheiron.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-23 20:33:20 -0500 (Wed, 23 Feb 2011)
New Revision: 21904
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/resources/javascript/cheiron/XHRHalter.js
Log:
support for halting MyFaces requests (RFPL-1186)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/resources/javascript/cheiron/XHRHalter.js
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/resources/javascript/cheiron/XHRHalter.js 2011-02-24 01:13:55 UTC (rev 21903)
+++ modules/tests/metamer/trunk/ftest-source/src/main/resources/javascript/cheiron/XHRHalter.js 2011-02-24 01:33:20 UTC (rev 21904)
@@ -176,6 +176,8 @@
if (XHRHalter.isEnabled()) {
var halter = XHRHalter._associations[this];
halter.sendParams['content'] = content;
+ halter.saveXhrParams();
+ halter.wait();
} else {
return XHRHalter.XHRWrapperInjection.send.call(this, content);
}
13 years, 11 months