Author: ilya_shaikovsky
Date: 2008-09-09 10:14:51 -0400 (Tue, 09 Sep 2008)
New Revision: 10378
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/favorites.gif
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/image.gif
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/trash.gif
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/trash_full.gif
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/DemoTreeNodeImpl.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeDndBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simpleDnd.xhtml
Log:
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/DemoTreeNodeImpl.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/DemoTreeNodeImpl.java 2008-09-09
12:52:34 UTC (rev 10377)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/DemoTreeNodeImpl.java 2008-09-09
14:14:51 UTC (rev 10378)
@@ -15,7 +15,10 @@
*/
public class DemoTreeNodeImpl<T> extends TreeNodeImpl<T>{
- private String type;
+ private String icon;
+ private String leafIcon;
+
+ private String type;
/**
* @return the type
@@ -29,6 +32,22 @@
*/
public void setType(String type) {
this.type = type;
- }
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public void setIcon(String icon) {
+ this.icon = icon;
+ }
+
+ public String getLeafIcon() {
+ return leafIcon;
+ }
+
+ public void setLeafIcon(String leafIcon) {
+ this.leafIcon = leafIcon;
+ }
}
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeDndBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeDndBean.java 2008-09-09
12:52:34 UTC (rev 10377)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/tree/SimpleTreeDndBean.java 2008-09-09
14:14:51 UTC (rev 10378)
@@ -52,6 +52,8 @@
private String nodeTitle;
+ private static final String ICONS_PATH = "/images/tree/dnd/";
+
private static final String DATA_PATH =
"/richfaces/tree/examples/simple-tree-data-dnd.properties";
private void addNodes(String path, TreeNode node, Properties properties) {
@@ -68,6 +70,13 @@
if (splittedValue.length > 1) {
nodeImpl.setData(splittedValue[0]);
nodeImpl.setType(splittedValue[1]);
+ if (splittedValue.length>2){
+ nodeImpl.setIcon(ICONS_PATH+splittedValue[2]);
+ nodeImpl.setLeafIcon(ICONS_PATH+splittedValue[2]);
+ }
+ if (splittedValue.length>3){
+ nodeImpl.setLeafIcon(ICONS_PATH+splittedValue[3]);
+ }
node.addChild(new Integer(counter), nodeImpl);
}
addNodes(key, nodeImpl, properties);
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/favorites.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/favorites.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/image.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/image.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/trash.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/trash.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/trash_full.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/tree/dnd/trash_full.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties 2008-09-09
12:52:34 UTC (rev 10377)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties 2008-09-09
14:14:51 UTC (rev 10378)
@@ -1,5 +1,5 @@
-#path=name - type
-1=Unsorted - node
+#path=name - type - icon
+1=Unsorted - node - image.gif
1.1=pic1.jpg - leaf
1.2=pic2.jpg - leaf
1.3=pic3.jpg - leaf
@@ -8,5 +8,5 @@
1.6=pic6.jpg - leaf
1.7=pic7.jpg - leaf
1.8=pic8.jpg - leaf
-2 = Favorites - node
-3 = Trash - node
\ No newline at end of file
+2=Favorites - node - favorites.gif
+3=Trash - node - trash_full.gif - trash.gif
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simpleDnd.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simpleDnd.xhtml 2008-09-09
12:52:34 UTC (rev 10377)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simpleDnd.xhtml 2008-09-09
14:14:51 UTC (rev 10378)
@@ -31,7 +31,7 @@
reRender="selectedNode" ajaxSubmitSelection="true"
switchType="client" dragIndicator="indicator2"
value="#{simpleTreeDndBean.treeNode}" var="item"
id="tree" treeNodeVar="treeNode"
dropListener="#{simpleTreeDndBean.dropListener}"
nodeFace="#{treeNode.parent.parent == null ? 'node' :
'leaf'}">
- <rich:treeNode type="node" acceptedTypes="pic">
+ <rich:treeNode type="node" acceptedTypes="pic"
icon="#{treeNode.icon}" iconLeaf="#{treeNode.leafIcon}">
<h:outputText value="#{item}"/>
</rich:treeNode>
<rich:treeNode type="leaf" dragType="pic">
Show replies by date