Author: lfryc(a)redhat.com
Date: 2010-12-15 12:08:39 -0500 (Wed, 15 Dec 2010)
New Revision: 20584
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/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - tree node look customization from RF-9686 integrated to Metamer (RF-9827)
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 2010-12-15
17:07:20 UTC (rev 20583)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15
17:08:39 UTC (rev 20584)
@@ -75,6 +75,15 @@
attributes.get("rendered").setValue(true);
attributes.get("toggleType").setValue("ajax");
attributes.get("selectionType").setValue("ajax");
+
+ // FIXME attributes not in taglib
+ attributes.setAttribute("iconLeaf", null);
+ attributes.setAttribute("iconExpanded", null);
+ attributes.setAttribute("iconCollapsed", null);
+ attributes.setAttribute("handleClass", null);
+ attributes.setAttribute("iconClass", null);
+ attributes.setAttribute("labelClass", null);
+ attributes.setAttribute("nodeClass", null);
// hidden attributes
attributes.remove("selectionChangeListener");
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2010-12-15
17:07:20 UTC (rev 20583)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2010-12-15
17:08:39 UTC (rev 20584)
@@ -42,7 +42,7 @@
private static final long serialVersionUID = 4008175400649809L;
private static Logger logger;
- private Attributes attributes;
+ private Attributes[] attributes = new Attributes[3];
/**
* Initializes the managed bean.
@@ -52,16 +52,28 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class,
getClass(), false);
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i] = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class,
getClass(), false);
- attributes.get("rendered").setValue(true);
+
+ attributes[i].get("rendered").setValue(true);
+
+ // FIXME attributes not in taglib
+ attributes[i].setAttribute("iconLeaf", null);
+ attributes[i].setAttribute("iconExpanded", null);
+ attributes[i].setAttribute("iconCollapsed", null);
+ attributes[i].setAttribute("handleClass", null);
+ attributes[i].setAttribute("iconClass", null);
+ attributes[i].setAttribute("labelClass", null);
+ attributes[i].setAttribute("styleClass", null);
+ }
}
- public Attributes getAttributes() {
+ public Attributes[] getAttributes() {
return attributes;
}
- public void setAttributes(Attributes attributes) {
+ public void setAttributes(Attributes[] attributes) {
this.attributes = attributes;
}
}
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 2010-12-15
17:07:20 UTC (rev 20583)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15
17:08:39 UTC (rev 20584)
@@ -73,24 +73,75 @@
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}"
- <rich:treeNode type="country">
+ <rich:treeNode type="country"
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+
iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+
iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+
handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
+
iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+
labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+
styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
+ >
#{node.name}
</rich:treeNode>
- <rich:treeNode type="company"
icon="/images/tree/disc.gif">
+ <rich:treeNode type="company"
+ icon="/images/tree/disc.gif"
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
+
iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+
iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+
iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+
handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
+
iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+
labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+
styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ >
#{node.name}
</rich:treeNode>
- <rich:treeNode type="cd" icon="/images/tree/song.gif">
+ <rich:treeNode type="cd"
+ icon="/images/tree/song.gif"
+ rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
+
iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
+
iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
+
handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
+
iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
+
labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
+
styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
+ >
#{node.artist} - #{node.title}
</rich:treeNode>
</rich:tree>
</ui:define>
<ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richTreeBean.attributes}"
id="attributes" />
+ <fieldset>
+ <legend>rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}"
id="attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="company"</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>
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 2010-12-15
17:07:20 UTC (rev 20583)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15
17:08:39 UTC (rev 20584)
@@ -71,6 +71,13 @@
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}"
<a4j:ajax event="selectionchange"
render="selectionOutput" />
@@ -83,19 +90,32 @@
recursionOrder="#{richTreeModelRecursiveAdaptorBean.attributes['recursionOrder'].value}"
- <rich:treeNode rendered="#{node.class.simpleName !=
'RecursiveNode' || node.number != 1 ||
richTreeNodeBean.attributes['rendered'].value}">
+ <rich:treeNode
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value
|| node.number != 1}"
+
iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+
iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+
iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+
handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
+
iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+
labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+
styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}">
+
<a4j:outputPanel id="panel">
#{node.label}
</a4j:outputPanel>
</rich:treeNode>
- <rich:treeModelAdaptor nodes="#{node.model.list}"
rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
+ <rich:treeModelAdaptor
+ nodes="#{node.model.list}"
+
rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
<rich:treeNode>
#{node.label}
</rich:treeNode>
</rich:treeModelAdaptor>
- <rich:treeModelAdaptor nodes="#{node.model.map}"
rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
+ <rich:treeModelAdaptor
+ nodes="#{node.model.map}"
+
rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
<rich:treeNode>
#{node.label}
</rich:treeNode>
@@ -106,7 +126,16 @@
nodes="#{richTreeModelRecursiveAdaptorBean.useMapModel ?
node.recursiveMap : node.recursiveList}"
rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}">
- <rich:treeNode
rendered="#{richTreeNodeBean.attributes['rendered'].value || node.number !=
1}">
+ <rich:treeNode
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value
|| node.number != 1}"
+
iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+
iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+
iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+
handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
+
iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+
labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+
styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ >
#{node.label}
</rich:treeNode>
</rich:treeModelRecursiveAdaptor>
@@ -144,13 +173,14 @@
<fieldset>
<legend>rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}"
id="treeAttributes" />
<fieldset>
- <legend>rich:treeModelRecursiveAdaptor [1]</legend>
+ <legend>rich:treeModelRecursiveAdaptor [0]</legend>
<fieldset>
- <legend>rich:treeNode</legend>
- <metamer:attributes value="#{richTreeNodeBean.attributes}"
id="nodeAttributes" />
+ <legend>rich:treeNode [0]</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[0]}"
id="node0Attributes" />
</fieldset>
<fieldset>
@@ -159,12 +189,15 @@
</fieldset>
<fieldset>
- <legend>rich:treeModelRecursiveAdaptor [2]</legend>
+ <legend>rich:treeModelRecursiveAdaptor [1]</legend>
<metamer:attributes
value="#{richTreeModelRecursiveAdaptorBean.attributes}"
id="recursiveAttributes" />
+
+ <fieldset>
+ <legend>rich:treeNode [1]</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[1]}"
id="node1Attributes" />
+ </fieldset>
</fieldset>
</fieldset>
-
- <metamer:attributes value="#{richTreeBean.attributes}"
id="treeAttributes" />
</fieldset>
</ui:define>