JBoss Rich Faces SVN: r19840 - trunk/ui/output/ui/src/main/resources/META-INF.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-11-01 11:25:46 -0400 (Mon, 01 Nov 2010)
New Revision: 19840
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
remove panelMenu from M4
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-11-01 15:11:07 UTC (rev 19839)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-11-01 15:25:46 UTC (rev 19840)
@@ -769,6 +769,7 @@
<component-class>org.richfaces.component.html.HtmlTab</component-class>
</component>
+<!--
<component>
<component-type>org.richfaces.PanelMenuItem</component-type>
<component-class>org.richfaces.component.html.HtmlPanelMenuItem</component-class>
@@ -948,6 +949,7 @@
<property-class>java.lang.Object</property-class>
</property>
</component>
+-->
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
@@ -1019,7 +1021,7 @@
</renderer-extension>
</renderer>
- <renderer>
+<!-- <renderer>
<component-family>org.richfaces.PanelMenuItem</component-family>
<renderer-type>org.richfaces.PanelMenuItem</renderer-type>
<renderer-class>org.richfaces.renderkit.html.PanelMenuItemRenderer</renderer-class>
@@ -1033,7 +1035,7 @@
<component-family>org.richfaces.PanelMenu</component-family>
<renderer-type>org.richfaces.PanelMenu</renderer-type>
<renderer-class>org.richfaces.renderkit.html.PanelMenuRenderer</renderer-class>
- </renderer>
+ </renderer>-->
<client-behavior-renderer>
<client-behavior-renderer-type>org.richfaces.component.behavior.ToggleControl</client-behavior-renderer-type>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-11-01 15:11:07 UTC (rev 19839)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-11-01 15:25:46 UTC (rev 19840)
@@ -50,6 +50,7 @@
</component>
</tag>
+<!--
<tag>
<tag-name>panelMenuItem</tag-name>
<component>
@@ -657,6 +658,7 @@
</attribute>
</tag>
+-->
<tag>
<tag-name>tooltip</tag-name>
14 years, 1 month
JBoss Rich Faces SVN: r19839 - sandbox/trunk/ui/tree-actual/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-01 11:11:07 -0400 (Mon, 01 Nov 2010)
New Revision: 19839
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml
Log:
https://jira.jboss.org/browse/RF-9315
- fixed IE7 wrong rendering issue
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml 2010-11-01 15:05:17 UTC (rev 19838)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/templates/treeNode.template.xml 2010-11-01 15:11:07 UTC (rev 19839)
@@ -17,13 +17,13 @@
<cc:implementation>
<div class="rf-trn">
- <div class="rf-trn-hnd #{facesContext.attributes['__treeNodeHandleClass']}"></div>
- <div class="rf-trn-cnt">
- <div class="rf-trn-ico #{facesContext.attributes['__treeNodeIconClass']}"></div>
+ <span class="rf-trn-hnd #{facesContext.attributes['__treeNodeHandleClass']}" />
+ <span class="rf-trn-cnt">
+ <span class="rf-trn-ico #{facesContext.attributes['__treeNodeIconClass']}" />
<span class="rf-trn-lbl">
<cdk:body />
</span>
- </div>
+ </span>
</div>
</cc:implementation>
14 years, 1 month
JBoss Rich Faces SVN: r19838 - trunk/examples/iteration-demo/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-01 11:05:17 -0400 (Mon, 01 Nov 2010)
New Revision: 19838
Modified:
trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
Log:
https://jira.jboss.org/browse/RF-9315
- added support for different node types
Modified: trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-11-01 15:04:54 UTC (rev 19837)
+++ trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-11-01 15:05:17 UTC (rev 19838)
@@ -24,9 +24,19 @@
</h:form>
<h:form id="form">
- <it:tree id="tree" var="node" value="#{treeBean.rootNodes}" selectionType="#{treeBean.selectionType}" toggleType="#{treeBean.toggleType}">
- <it:treeNode>
- <h:panelGroup id="group">
+ <it:tree id="tree" nodeType="#{node.parent == null ? 'rootNode': 'childNode'}" var="node" value="#{treeBean.rootNodes}" selectionType="#{treeBean.selectionType}" toggleType="#{treeBean.toggleType}">
+ <it:treeNode type="rootNode">
+ <h:panelGroup id="rootNodeGroup">
+ Root node: #{node.data} -
+ <h:commandLink value="link" action="#{treeBean.clickNode}">
+ <f:setPropertyActionListener value="#{node.data}" target="#{treeBean.nodeData}" />
+
+ <f:ajax render=":messages" />
+ </h:commandLink>
+ </h:panelGroup>
+ </it:treeNode>
+ <it:treeNode type="childNode">
+ <h:panelGroup id="childNodeGroup">
#{node.data} -
<h:commandLink value="link" action="#{treeBean.clickNode}">
<f:setPropertyActionListener value="#{node.data}" target="#{treeBean.nodeData}" />
14 years, 1 month
JBoss Rich Faces SVN: r19837 - in sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-01 11:04:54 -0400 (Mon, 01 Nov 2010)
New Revision: 19837
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
https://jira.jboss.org/browse/RF-9315
- added support for different node types
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-01 15:02:46 UTC (rev 19836)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-01 15:04:54 UTC (rev 19837)
@@ -88,12 +88,33 @@
public static final String SELECTION_META_COMPONENT_ID = "selection";
- private static final Predicate<UIComponent> RENDERED_UITREE_NODE = new Predicate<UIComponent>() {
+ private static final class MatchingTreeNodePredicate implements Predicate<UIComponent> {
+
+ private String type;
+
+ public MatchingTreeNodePredicate(String type) {
+ super();
+ this.type = type;
+ }
+
public boolean apply(UIComponent input) {
- return (input instanceof AbstractTreeNode) && input.isRendered();
- };
+ if (!(input instanceof AbstractTreeNode)) {
+ return false;
+ }
+
+ if (!input.isRendered()) {
+ return false;
+ }
+
+ String nodeType = ((AbstractTreeNode) input).getType();
+ if (type == null && nodeType == null) {
+ return true;
+ }
+
+ return type != null && type.equals(nodeType);
+ }
};
-
+
private static final Converter ROW_KEY_CONVERTER = new SequenceRowKeyConverter();
/**
@@ -131,6 +152,8 @@
@Attribute(defaultValue = "SwitchType.client")
public abstract SwitchType getSelectionType();
+ public abstract String getNodeType();
+
public Collection<Object> getSelection() {
@SuppressWarnings("unchecked")
Collection<Object> selection = (Collection<Object>) getStateHelper().eval(PropertyKeys.selection);
@@ -220,7 +243,9 @@
return null;
}
- Iterator<UIComponent> iterator = Iterators.filter(getChildren().iterator(), RENDERED_UITREE_NODE);
+ Iterator<UIComponent> iterator = Iterators.filter(getChildren().iterator(),
+ new MatchingTreeNodePredicate(getNodeType()));
+
if (iterator.hasNext()) {
return (AbstractTreeNode) iterator.next();
}
@@ -348,7 +373,13 @@
@Override
protected Iterator<UIComponent> dataChildren() {
- return Iterators.<UIComponent>concat(super.dataChildren(), Iterators.singletonIterator(treeDecoderHelper));
+ AbstractTreeNode treeNodeComponent = getTreeNodeComponent();
+ if (treeNodeComponent != null) {
+ return Iterators.<UIComponent>concat(Iterators.<UIComponent>singletonIterator(treeNodeComponent),
+ Iterators.singletonIterator(treeDecoderHelper));
+ } else {
+ return Iterators.<UIComponent>singletonIterator(treeDecoderHelper);
+ }
}
@Override
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-11-01 15:02:46 UTC (rev 19836)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-11-01 15:04:54 UTC (rev 19837)
@@ -61,6 +61,8 @@
@Attribute(defaultValue = "findTreeComponent().isImmediate()")
public abstract boolean isImmediate();
+ public abstract String getType();
+
protected AbstractTree findTreeComponent() {
UIComponent c = this;
while (c != null && !(c instanceof AbstractTree)) {
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-01 15:02:46 UTC (rev 19836)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-01 15:04:54 UTC (rev 19837)
@@ -268,6 +268,11 @@
AbstractTree tree = (AbstractTree) component;
AbstractTreeNode treeNode = tree.getTreeNodeComponent();
+
+ if (treeNode == null) {
+ return;
+ }
+
boolean expanded = Boolean.valueOf(newToggleState);
if (tree.isExpanded() ^ expanded) {
new TreeToggleEvent(treeNode, expanded).queue();
14 years, 1 month
JBoss Rich Faces SVN: r19836 - in trunk/ui/input/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-01 11:02:46 -0400 (Mon, 01 Nov 2010)
New Revision: 19836
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
trunk/ui/input/ui/src/main/templates/select.template.xml
Log:
fix RF-9604
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-11-01 14:41:42 UTC (rev 19835)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-11-01 15:02:46 UTC (rev 19836)
@@ -11,9 +11,7 @@
this.initialValue = (labelText == inputLabel) ? labelText : "";
this.saveOnBlur = mergedOptions.saveOnBlur;
this.showControls = mergedOptions.showControls;
- this.__proxie
- this.getInput().bind("focus", $.proxy(this.__editHandler, this));
-
+ this.getInput().bind("focus", $.proxy(this.__editHandler, this));
if(this.showControls) {
this.okbtn = $(document.getElementById(id+"Okbtn"));
this.cancelbtn = $(document.getElementById(id+"Cancelbtn"));
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-01 14:41:42 UTC (rev 19835)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-01 15:02:46 UTC (rev 19836)
@@ -1,3 +1,5 @@
+//TODO anton -> Cache impl should be moved to the utils
+
(function ($, rf) {
rf.utils = rf.utils || {};
Modified: trunk/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/select.template.xml 2010-11-01 14:41:42 UTC (rev 19835)
+++ trunk/ui/input/ui/src/main/templates/select.template.xml 2010-11-01 15:02:46 UTC (rev 19836)
@@ -26,6 +26,7 @@
id="#{clientId}Input"
value="#{getSelectLabel(facesContext, component)}"
disabled="#{disabled}"
+ name="#{clientId}Input"
type="text"
class="rf-sel-fnt rf-sel-inp"
autocomplete="off"
14 years, 1 month
JBoss Rich Faces SVN: r19835 - in modules/tests/metamer/trunk: ftest-source and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-01 10:41:42 -0400 (Mon, 01 Nov 2010)
New Revision: 19835
Modified:
modules/tests/metamer/trunk/ftest-source/pom.xml
modules/tests/metamer/trunk/ftest/pom.xml
Log:
tied on richfaces-selenium 1.5.3-SNAPSHOT
Modified: modules/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/pom.xml 2010-11-01 14:38:15 UTC (rev 19834)
+++ modules/tests/metamer/trunk/ftest/pom.xml 2010-11-01 14:41:42 UTC (rev 19835)
@@ -25,7 +25,7 @@
<parent>
<artifactId>functional-test-jboss-ci-template</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.2.Final</version>
+ <version>1.5.3-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.tests</groupId>
Modified: modules/tests/metamer/trunk/ftest-source/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest-source/pom.xml 2010-11-01 14:38:15 UTC (rev 19834)
+++ modules/tests/metamer/trunk/ftest-source/pom.xml 2010-11-01 14:41:42 UTC (rev 19835)
@@ -37,7 +37,7 @@
<dependency>
<artifactId>root</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.2.Final</version>
+ <version>1.5.3-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
14 years, 1 month
JBoss Rich Faces SVN: r19834 - sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-01 10:38:15 -0400 (Mon, 01 Nov 2010)
New Revision: 19834
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
Log:
https://jira.jboss.org/browse/RF-9315
- rf-tr-nd-sel class renamed
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-11-01 14:34:47 UTC (rev 19833)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-11-01 14:38:15 UTC (rev 19834)
@@ -21,7 +21,7 @@
display: inline-block;
}
-.rf-tr-nd-sel {
+.rf-trn-sel {
background: '#{richSkin.additionalBackgroundColor}';
}
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-01 14:34:47 UTC (rev 19833)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-01 14:38:15 UTC (rev 19834)
@@ -187,9 +187,9 @@
__setSelected: function(value) {
var content = this.__getContent();
if (value) {
- content.addClass("rf-tr-nd-sel");
+ content.addClass("rf-trn-sel");
} else {
- content.removeClass("rf-tr-nd-sel");
+ content.removeClass("rf-trn-sel");
}
this.__selected = value;
14 years, 1 month
JBoss Rich Faces SVN: r19833 - in trunk/examples/iteration-demo/src/main: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-01 10:34:47 -0400 (Mon, 01 Nov 2010)
New Revision: 19833
Modified:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java
trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
Log:
https://jira.jboss.org/browse/RF-9315
- removed selection interface
- renamed toggleMode/selectionMode attributes
Modified: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java 2010-11-01 14:33:47 UTC (rev 19832)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/TreeBean.java 2010-11-01 14:34:47 UTC (rev 19833)
@@ -22,6 +22,7 @@
package org.richfaces.demo;
import java.io.Serializable;
+import java.util.Collection;
import java.util.List;
import javax.annotation.PostConstruct;
@@ -31,7 +32,6 @@
import javax.faces.context.FacesContext;
import javax.swing.tree.TreeNode;
-import org.richfaces.component.Selection;
import org.richfaces.component.SwitchType;
import org.richfaces.log.LogFactory;
import org.richfaces.log.Logger;
@@ -50,13 +50,13 @@
private List<TreeNode> rootNodes;
- private SwitchType toggleMode = SwitchType.DEFAULT;
+ private SwitchType toggleType = SwitchType.DEFAULT;
- private SwitchType selectionMode = SwitchType.client;
+ private SwitchType selectionType = SwitchType.client;
private Object nodeData;
- private Selection selection;
+ private Collection<Object> selection;
@PostConstruct
public void init() {
@@ -73,24 +73,24 @@
return rootNodes;
}
- public SwitchType[] getModes() {
+ public SwitchType[] getTypes() {
return SwitchType.values();
}
- public SwitchType getToggleMode() {
- return toggleMode;
+ public SwitchType getToggleType() {
+ return toggleType;
}
- public void setToggleMode(SwitchType switchType) {
- this.toggleMode = switchType;
+ public void setToggleType(SwitchType switchType) {
+ this.toggleType = switchType;
}
- public SwitchType getSelectionMode() {
- return selectionMode;
+ public SwitchType getSelectionType() {
+ return selectionType;
}
- public void setSelectionMode(SwitchType selectionMode) {
- this.selectionMode = selectionMode;
+ public void setSelectionType(SwitchType selectionMode) {
+ this.selectionType = selectionMode;
}
public Object getNodeData() {
@@ -101,11 +101,11 @@
this.nodeData = nodeData;
}
- public Selection getSelection() {
+ public Collection<Object> getSelection() {
return selection;
}
- public void setSelection(Selection selection) {
+ public void setSelection(Collection<Object> selection) {
this.selection = selection;
}
Modified: trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-11-01 14:33:47 UTC (rev 19832)
+++ trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-11-01 14:34:47 UTC (rev 19833)
@@ -14,17 +14,17 @@
<h:messages id="messages" />
<h:form>
- Toggle mode: <h:selectOneRadio value="#{treeBean.toggleMode}" onclick="submit()">
- <f:selectItems value="#{treeBean.modes}" var="item" itemValue="#{item}" />
+ Toggle mode: <h:selectOneRadio value="#{treeBean.toggleType}" onclick="submit()">
+ <f:selectItems value="#{treeBean.types}" var="item" itemValue="#{item}" />
</h:selectOneRadio>
- Selection mode: <h:selectOneRadio value="#{treeBean.selectionMode}" onclick="submit()">
- <f:selectItems value="#{treeBean.modes}" itemDisabled="#{item == 'server'}" var="item" itemValue="#{item}" />
+ Selection mode: <h:selectOneRadio value="#{treeBean.selectionType}" onclick="submit()">
+ <f:selectItems value="#{treeBean.types}" itemDisabled="#{item == 'server'}" var="item" itemValue="#{item}" />
</h:selectOneRadio>
</h:form>
<h:form id="form">
- <it:tree id="tree" var="node" value="#{treeBean.rootNodes}" selectionMode="#{treeBean.selectionMode}" toggleMode="#{treeBean.toggleMode}">
+ <it:tree id="tree" var="node" value="#{treeBean.rootNodes}" selectionType="#{treeBean.selectionType}" toggleType="#{treeBean.toggleType}">
<it:treeNode>
<h:panelGroup id="group">
#{node.data} -
14 years, 1 month
JBoss Rich Faces SVN: r19832 - in sandbox/trunk/ui/tree-actual: ui/src/main/java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-01 10:33:47 -0400 (Mon, 01 Nov 2010)
New Revision: 19832
Removed:
sandbox/trunk/ui/tree-actual/api/src/main/java/org/richfaces/component/
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/SelectionImpl.java
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml
Log:
https://jira.jboss.org/browse/RF-9315
- removed selection interface
- renamed toggleMode/selectionMode attributes
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-01 14:24:14 UTC (rev 19831)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-01 14:33:47 UTC (rev 19832)
@@ -22,6 +22,8 @@
package org.richfaces.component;
import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@@ -124,15 +126,16 @@
}
@Attribute(defaultValue = "SwitchType.DEFAULT")
- public abstract SwitchType getToggleMode();
+ public abstract SwitchType getToggleType();
@Attribute(defaultValue = "SwitchType.client")
- public abstract SwitchType getSelectionMode();
+ public abstract SwitchType getSelectionType();
- public Selection getSelection() {
- Selection selection = (Selection) getStateHelper().eval(PropertyKeys.selection);
+ public Collection<Object> getSelection() {
+ @SuppressWarnings("unchecked")
+ Collection<Object> selection = (Collection<Object>) getStateHelper().eval(PropertyKeys.selection);
if (selection == null) {
- selection = new SelectionImpl();
+ selection = new HashSet<Object>();
ValueExpression ve = getValueExpression(PropertyKeys.selection.toString());
if (ve != null) {
@@ -145,7 +148,7 @@
return selection;
}
- public void setSelection(Selection selection) {
+ public void setSelection(Collection<Object> selection) {
getStateHelper().put(PropertyKeys.selection, selection);
}
@@ -285,14 +288,14 @@
} else if (event instanceof TreeSelectionEvent) {
TreeSelectionEvent selectionEvent = (TreeSelectionEvent) event;
- Selection selection = getSelection();
+ Collection<Object> selection = getSelection();
for (Object addedKey: selectionEvent.getAddedKeys()) {
- selection.addToSelection(addedKey);
+ selection.add(addedKey);
}
for (Object removedKey: selectionEvent.getRemovedKeys()) {
- selection.removeFromSelection(removedKey);
+ selection.remove(removedKey);
}
}
}
Deleted: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/SelectionImpl.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/SelectionImpl.java 2010-11-01 14:24:14 UTC (rev 19831)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/SelectionImpl.java 2010-11-01 14:33:47 UTC (rev 19832)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, 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.component;
-
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import com.google.common.collect.Iterators;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class SelectionImpl implements Selection, Serializable {
-
- private static final long serialVersionUID = 7738700662652136887L;
-
- private Set<Object> selectedKeys = new HashSet<Object>();
-
- public boolean addToSelection(Object rowKey) {
- return selectedKeys.add(rowKey);
- }
-
- public boolean isSelected(Object rowKey) {
- return selectedKeys.contains(rowKey);
- }
-
- public Iterator<Object> getSelectionIterator() {
- return Iterators.unmodifiableIterator(selectedKeys.iterator());
- }
-
- public boolean removeFromSelection(Object rowKey) {
- return selectedKeys.remove(rowKey);
- }
-
- public boolean isEmpty() {
- return selectedKeys.isEmpty();
- }
-
- public void clear() {
- selectedKeys = new HashSet<Object>();
- }
-
-}
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java 2010-11-01 14:24:14 UTC (rev 19831)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java 2010-11-01 14:33:47 UTC (rev 19832)
@@ -42,7 +42,7 @@
this.facesContext = facesContext;
this.tree = tree;
- traverseAll = SwitchType.client == tree.getToggleMode();
+ traverseAll = (SwitchType.client == tree.getToggleType());
}
public boolean shouldIterateChildren(Object rowKey) {
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-01 14:24:14 UTC (rev 19831)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-01 14:33:47 UTC (rev 19832)
@@ -28,6 +28,7 @@
import static org.richfaces.renderkit.util.AjaxRendererUtils.buildEventOptions;
import java.io.IOException;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
@@ -45,7 +46,6 @@
import org.richfaces.component.AbstractTree;
import org.richfaces.component.AbstractTreeNode;
import org.richfaces.component.MetaComponentResolver;
-import org.richfaces.component.Selection;
import org.richfaces.component.SwitchType;
import org.richfaces.component.TreeDecoderHelper;
import org.richfaces.event.TreeSelectionEvent;
@@ -54,7 +54,6 @@
import org.richfaces.log.RichfacesLogger;
import com.google.common.base.Strings;
-import com.google.common.collect.Iterators;
/**
@@ -154,7 +153,7 @@
protected String getAjaxSubmitFunction(FacesContext context, UIComponent component) {
AbstractTree tree = (AbstractTree) component;
- if (tree.getToggleMode() != SwitchType.ajax && tree.getSelectionMode() != SwitchType.ajax) {
+ if (tree.getToggleType() != SwitchType.ajax && tree.getSelectionType() != SwitchType.ajax) {
return null;
}
@@ -182,7 +181,7 @@
String selectedNodeId = "";
AbstractTree tree = (AbstractTree) component;
- Iterator<Object> selectedKeys = tree.getSelection().getSelectionIterator();
+ Iterator<Object> selectedKeys = tree.getSelection().iterator();
if (selectedKeys.hasNext()) {
Object selectionKey = selectedKeys.next();
@@ -218,13 +217,13 @@
protected SwitchType getSelectionMode(FacesContext context, UIComponent component) {
AbstractTree tree = (AbstractTree) component;
- SwitchType selectionMode = tree.getSelectionMode();
- if (selectionMode != null && selectionMode != SwitchType.ajax && selectionMode != SwitchType.client) {
+ SwitchType selectionType = tree.getSelectionType();
+ if (selectionType != null && selectionType != SwitchType.ajax && selectionType != SwitchType.client) {
//TODO - better message
- throw new IllegalArgumentException(String.valueOf(selectionMode));
+ throw new IllegalArgumentException(String.valueOf(selectionType));
}
- return selectionMode;
+ return selectionType;
}
protected String getNamingContainerSeparatorChar(FacesContext context) {
@@ -298,16 +297,16 @@
selectionRowKey = tree.getRowKeyConverter().getAsObject(context, component, selectionRowKeyString);
}
- Selection selection = tree.getSelection();
+ Collection<Object> selection = tree.getSelection();
Set<Object> addedKeys = new HashSet<Object>(2);
Set<Object> removedKeys = new HashSet<Object>(2);
if (selectionRowKey == null) {
- Iterators.addAll(removedKeys, selection.getSelectionIterator());
- } else if (!selection.isSelected(selectionRowKey)) {
+ removedKeys.addAll(selection);
+ } else if (!selection.contains(selectionRowKey)) {
addedKeys.add(selectionRowKey);
- Iterators.addAll(removedKeys, selection.getSelectionIterator());
+ removedKeys.addAll(selection);
}
if (!removedKeys.isEmpty() || !addedKeys.isEmpty()) {
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-01 14:24:14 UTC (rev 19831)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-01 14:33:47 UTC (rev 19832)
@@ -159,7 +159,7 @@
if (newState ^ this.isExpanded()) {
var tree = this.getTree();
- switch (tree.getToggleMode()) {
+ switch (tree.getToggleType()) {
case 'client':
this.elt.addClass(TREE_CLASSES[newState ? 1 : 0]).removeClass(TREE_CLASSES[!newState ? 1 : 0]);
this.__getHandle().addClass(TREE_HANDLE_CLASSES[newState ? 1 : 0]).removeClass(TREE_HANDLE_CLASSES[!newState ? 1 : 0]);
@@ -247,8 +247,8 @@
init: function (id, options) {
this.$super.init.call(this, id);
- this.__toggleMode = options.toggleMode || 'ajax';
- this.__selectionMode = options.selectionMode || 'client';
+ this.__toggleType = options.toggleType || 'ajax';
+ this.__selectionType = options.selectionType || 'client';
if (options.ajaxSubmitFunction) {
this.__ajaxSubmitFunction = new Function("event", "source", "params", options.ajaxSubmitFunction);
@@ -302,7 +302,7 @@
var clientParams = {};
clientParams[toggleSource + NEW_NODE_TOGGLE_STATE] = newNodeState;
- if (this.__toggleMode == 'server') {
+ if (this.getToggleType() == 'server') {
var form = $(richfaces.getDomElement(this.id)).closest('form');
richfaces.submitForm(form, clientParams);
} else {
@@ -310,12 +310,12 @@
}
},
- getToggleMode: function() {
- return this.__toggleMode;
+ getToggleType: function() {
+ return this.__toggleType;
},
- getSelectionMode: function() {
- return this.__selectionMode;
+ getSelectionType: function() {
+ return this.__selectionType;
},
getTree: function() {
@@ -331,7 +331,7 @@
},
__handleSelectionChange: function() {
- if (this.__selectionMode == 'client') {
+ if (this.getSelectionType() == 'client') {
this.__updateSelection();
} else {
this.__ajaxSubmitFunction(null, this.id);
Modified: sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml
===================================================================
--- sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml 2010-11-01 14:24:14 UTC (rev 19831)
+++ sandbox/trunk/ui/tree-actual/ui/src/main/templates/tree.template.xml 2010-11-01 14:33:47 UTC (rev 19832)
@@ -30,8 +30,8 @@
<script type="text/javascript">
RichFaces.ui.Tree.setNamingContainerSeparatorChar(#{toScriptArgs(getNamingContainerSeparatorChar(facesContext))});
<cdk:scriptObject name="options">
- <cdk:scriptOption attributes="toggleMode" defaultValue="SwitchType.DEFAULT" />
- <cdk:scriptOption name="selectionMode" value="#{getSelectionMode(facesContext, component)}" defaultValue="SwitchType.client" />
+ <cdk:scriptOption attributes="toggleType" defaultValue="SwitchType.DEFAULT" />
+ <cdk:scriptOption name="selectionType" value="#{getSelectionMode(facesContext, component)}" defaultValue="SwitchType.client" />
<cdk:scriptOption name="ajaxSubmitFunction" value="#{getAjaxSubmitFunction(facesContext, component)}" />
</cdk:scriptObject>
14 years, 1 month
JBoss Rich Faces SVN: r19831 - trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-11-01 10:24:14 -0400 (Mon, 01 Nov 2010)
New Revision: 19831
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
push demo commented out. it's not compatible with GAE. And not checked after redesign.
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-11-01 14:21:49 UTC (rev 19830)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-11-01 14:24:14 UTC (rev 19831)
@@ -62,7 +62,7 @@
</sample>
</samples>
</demo>
- <demo>
+ <!-- demo>
<id>push</id>
<name>a4j:push</name>
<samples>
@@ -71,7 +71,7 @@
<name>push Simple</name>
</sample>
</samples>
- </demo>
+ </demo-->
<demo>
<id>param</id>
<name>a4j:param</name>
14 years, 1 month