Author: adubovsky
Date: 2009-04-08 05:51:49 -0400 (Wed, 08 Apr 2009)
New Revision: 13420
Added:
trunk/test-applications/seamApp/web/src/main/java/tTree/
trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java
trunk/test-applications/seamApp/web/src/main/java/tTree/data/
trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java
trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java
trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java
trunk/test-applications/seamApp/web/src/main/resources/org/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties
trunk/test-applications/seamApp/web/src/main/resources/tTree/
trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml
trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml
Removed:
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeDefault.xhtml
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java
trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml
Log:
+ tree changes
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java
===================================================================
---
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2009-04-08
08:40:26 UTC (rev 13419)
+++
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -56,7 +56,7 @@
map.add("TogglePanel", add("/TogglePanel/TogglePanel", new boolean
[] {false, true, true}));
map.add("ToolBar", add("/ToolBar/ToolBar", new boolean [] {false,
true, false}));
map.add("Tooltip", add("/Tooltip/Tooltip", new boolean [] {false,
true, true}));
- map.add("Tree", add("/Tree/Tree", new boolean [] {false, true,
false}));
+ map.add("Tree", add("/Tree/Tree", new boolean [] {true, true,
true}));
map.add("VirtualEarth", add("/VirtualEarth/VirtualEarth", new
boolean [] {false, true, false}));
map.add("ScrollableDataTable",
add("/ScrollableDataTable/ScrollableDataTable", new boolean [] {false, true,
false}));
map.add("jQuery", add("/jQuery/jQuery", new boolean [] {true,
false, false}));
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,54 @@
+package tTree;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("pVisability")
+(a)Scope(ScopeType.SESSION)
+public class PVisability {
+ private boolean tTreeSubviewID;
+ private boolean tTreePropertySubviewID;
+ private boolean tTreeStraightforwardSubviewID;
+ private boolean tTreeDefaultSubviewID;
+
+ public PVisability() {
+ tTreeSubviewID = true;
+ tTreePropertySubviewID = false;
+ tTreeStraightforwardSubviewID = false;
+ tTreeDefaultSubviewID = false;
+ }
+
+ public boolean istTreeDefaultSubviewID() {
+ return tTreeDefaultSubviewID;
+ }
+
+ public void settTreeDefaultSubviewID(boolean treeDefaultSubviewID) {
+ tTreeDefaultSubviewID = treeDefaultSubviewID;
+ }
+
+ public boolean istTreeSubviewID() {
+ return tTreeSubviewID;
+ }
+
+ public void settTreeSubviewID(boolean treeSubviewID) {
+ tTreeSubviewID = treeSubviewID;
+ }
+
+ public boolean istTreePropertySubviewID() {
+ return tTreePropertySubviewID;
+ }
+
+ public void settTreePropertySubviewID(boolean treePropertySubviewID) {
+ tTreePropertySubviewID = treePropertySubviewID;
+ }
+
+ public boolean istTreeStraightforwardSubviewID() {
+ return tTreeStraightforwardSubviewID;
+ }
+
+ public void settTreeStraightforwardSubviewID(
+ boolean treeStraightforwardSubviewID) {
+ tTreeStraightforwardSubviewID = treeStraightforwardSubviewID;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java 2009-04-08 09:51:49
UTC (rev 13420)
@@ -0,0 +1,202 @@
+package tTree;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UITree;
+import org.richfaces.component.xml.XmlTreeDataBuilder;
+import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;;
+
+@Name("tTree")
+(a)Scope(ScopeType.SESSION)
+public class TTree {
+ private String switchType = "server";
+ private TreeNode data;
+ private UITree tree;
+ private boolean immediate = false;
+ private boolean ajaxSubmitSelection = false;
+ private String anOpened = "null";
+ private String anSelected = "null";
+ private boolean rendered = true;
+ private boolean showConnectingLines = false;
+ private boolean toggleOnClick = false;
+ private boolean useCustomIcons = false;
+
+ private String reRenderCheck = "... waiting ...";
+
+ public TTree() {
+ try {
+ data = XmlTreeDataBuilder.build(new InputSource(getClass()
+ .getResourceAsStream("test.xml")));
+
+ TreeNode pomData = XmlTreeDataBuilder.build(new InputSource(
+ getClass().getResourceAsStream("pom_sample.xml")));
+
+ Iterator children = pomData.getChildren();
+ while (children.hasNext()) {
+ Map.Entry entry = (Map.Entry) children.next();
+ data.addChild(new Long(1), (TreeNode) entry.getValue());
+ }
+
+ } catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void addCustomIcons() {
+ if (useCustomIcons) {
+ tree.setIcon("/pics/1.gif");
+ tree.setIconCollapsed("/pics/3.gif");
+ tree.setIconExpanded("/pics/4.gif");
+ tree.setIconLeaf("/pics/2.gif");
+ } else {
+ tree.setIcon(null);
+ tree.setIconCollapsed(null);
+ tree.setIconExpanded(null);
+ tree.setIconLeaf(null);
+ }
+ }
+
+ public void add() {
+ ComponentInfo info = ComponentInfo.getInstance();
+ info.addField(tree);
+ }
+
+ public void resetReRenderCheck() {
+ reRenderCheck = "... waiting ...";
+ }
+
+ public Boolean adviseNodeOpened(UITree t) {
+ Boolean tAnOpened = null;
+ if (anOpened.equals("FALSE"))
+ tAnOpened = Boolean.FALSE;
+ else if (anOpened.equals("TRUE"))
+ tAnOpened = Boolean.TRUE;
+
+ return tAnOpened;
+ }
+
+ public Boolean adviseNodeSelected(UITree t) {
+ Boolean tAnSelected = null;
+ if (anSelected.equals("FALSE"))
+ tAnSelected = Boolean.FALSE;
+ else if (anSelected.equals("TRUE"))
+ tAnSelected = Boolean.TRUE;
+
+ return tAnSelected;
+ }
+
+ public void changeExpandListener(NodeExpandedEvent e) {
+ reRenderCheck = "!!! I am WORKing !!!";
+ System.out.println("!!! changeExpandListener !!!");
+ }
+
+ public void nodeSelectListener(NodeSelectedEvent e) {
+ reRenderCheck = "!!! I am WORKing !!!";
+ System.out.println("!!! nodeSelectListener !!!");
+ }
+
+ public String getReRenderCheck() {
+ return reRenderCheck;
+ }
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public boolean isAjaxSubmitSelection() {
+ return ajaxSubmitSelection;
+ }
+
+ public void setAjaxSubmitSelection(boolean ajaxSubmitSelection) {
+ this.ajaxSubmitSelection = ajaxSubmitSelection;
+ }
+
+ public String getSwitchType() {
+ return switchType;
+ }
+
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
+ }
+
+ public TreeNode getData() {
+ return data;
+ }
+
+ public void setData(TreeNode data) {
+ this.data = data;
+ }
+
+ public UITree getTree() {
+ return tree;
+ }
+
+ public void setTree(UITree tree) {
+ this.tree = tree;
+ }
+
+ public String getAnOpened() {
+ return anOpened;
+ }
+
+ public void setAnOpened(String anOpened) {
+ this.anOpened = anOpened;
+ }
+
+ public String getAnSelected() {
+ return anSelected;
+ }
+
+ public void setAnSelected(String anSelected) {
+ this.anSelected = anSelected;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public boolean isShowConnectingLines() {
+ return showConnectingLines;
+ }
+
+ public void setShowConnectingLines(boolean showConnectingLines) {
+ this.showConnectingLines = showConnectingLines;
+ }
+
+ public boolean isToggleOnClick() {
+ return toggleOnClick;
+ }
+
+ public void setToggleOnClick(boolean toggleOnClick) {
+ this.toggleOnClick = toggleOnClick;
+ }
+
+ public boolean isUseCustomIcons() {
+ return useCustomIcons;
+ }
+
+ public void setUseCustomIcons(boolean useCustomIcons) {
+ this.useCustomIcons = useCustomIcons;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,254 @@
+package tTree;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UITree;
+import org.richfaces.component.UITreeNode;
+import org.richfaces.event.DragEvent;
+import org.richfaces.event.DropEvent;
+import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+import org.richfaces.model.TreeRowKey;
+
+@Name("tTreeDND")
+(a)Scope(ScopeType.SESSION)
+public class TTreeDND {
+ private static final String DATA_PATH =
"org/richfaces/simpleTreeData.properties";
+
+ private TreeNode<String> treeNodeLeft;
+ private UITree leftTree;
+ private String leftSelectedNodeTitle;
+ private String rightSelectedNodeTitle;
+ private TreeNode<String> treeNodeRight;
+ private UITree rightTree;
+
+ private void addNodes(String path, TreeNode<String> node,
+ Properties properties) {
+ boolean end = false;
+ int counter = 1;
+ while (!end) {
+ String key = path != null ? path + '.' + counter : String
+ .valueOf(counter);
+ String value = properties.getProperty(key);
+ if (value != null) {
+ TreeNodeImpl<String> nodeImpl = new TreeNodeImpl<String>();
+ nodeImpl.setData(value);
+ node.addChild(new Integer(counter), nodeImpl);
+ addNodes(key, nodeImpl, properties);
+ counter++;
+ } else {
+ end = true;
+ }
+ }
+ }
+
+ private TreeNode<String> initPaneTree() {
+ TreeNode<String> rootNode = null;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+
+ InputStream dataStream = this.getClass().getClassLoader()
+ .getResourceAsStream(DATA_PATH);
+
+ try {
+ Properties properties = new Properties();
+ properties.load(dataStream);
+ rootNode = new TreeNodeImpl<String>();
+ addNodes(null, rootNode, properties);
+ } catch (IOException e) {
+
+ throw new FacesException(e.getMessage(), e);
+
+ } finally {
+ if (dataStream != null) {
+ try {
+ dataStream.close();
+ } catch (IOException e) {
+ externalContext.log(e.getMessage(), e);
+ }
+ }
+ }
+ return rootNode;
+ }
+
+ private Object getNewId(TreeNode parentNode) {
+ Map<Object, TreeNode> childs = new HashMap<Object, TreeNode>();
+ Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
+ while (iter != null && iter.hasNext()) {
+ Map.Entry<Object, TreeNode> entry = iter.next();
+ childs.put(entry.getKey(), entry.getValue());
+ }
+
+ Integer index = 1;
+ while (childs.containsKey(index)) {
+ index++;
+ }
+ return index;
+ }
+
+ public void onDrop(DropEvent dropEvent) {
+ System.out.println("onDrop occured.");
+ System.out.println("DragValue: " + dropEvent.getDragValue());
+ System.out.println("DropValue: " + dropEvent.getDropValue());
+
+ // resolve drag source attributes
+ UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ?
(UITreeNode) dropEvent
+ .getDraggableSource()
+ : null;
+ UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
+ TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ?
(TreeRowKey) dropEvent
+ .getDragValue()
+ : null;
+
+ // resolve drag destination attributes
+ UITreeNode destNode = (dropEvent.getSource() instanceof UITreeNode) ? (UITreeNode)
dropEvent
+ .getSource()
+ : null;
+ UITree destTree = destNode != null ? destNode.getUITree()
+ : (UITree) dropEvent.getComponent();
+ TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ?
(TreeRowKey) dropEvent
+ .getDropValue()
+ : null;
+
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ if (dropNodeKey != null) {
+ // add destination node for rerender
+ destTree.addRequestKey(dropNodeKey);
+
+ Object state = null;
+ TreeNode draggedNode = null;
+ if (dragNodeKey != null) { // Drag from this or other tree
+ draggedNode = srcTree.getModelTreeNode(dragNodeKey);
+
+ TreeNode parentNode = draggedNode.getParent();
+ // 1. remove node from tree
+ state = srcTree.removeNode(dragNodeKey);
+ // 2. add parent for rerender
+ Object rowKey = srcTree.getTreeNodeRowKey(parentNode);
+ srcTree.addRequestKey(rowKey);
+ } else if (dropEvent.getDragValue() != null) { // Drag from some
+ // drag source
+ draggedNode = new TreeNodeImpl<String>();
+ draggedNode.setData(dropEvent.getDragValue().toString());
+ }
+
+ // generate new node id
+ Object id = getNewId(destTree.getTreeNode(dropNodeKey));
+ destTree.addNode(dropNodeKey, draggedNode, id, state);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ // Add destination tree to reRender
+ try {
+ ac.addComponentToAjaxRender(destTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ // Add source tree to reRender
+ try {
+ ac.addComponentToAjaxRender(srcTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ System.out.println("+++++");
+ }
+
+ public void onExpand(NodeExpandedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ System.out.println("Tree ('" + tree.getId() + "') node "
+ + (tree.isExpanded() ? "expanded" : "collapsed") + " "
+ + tree.getRowKey());
+ }
+
+ public void onDrag(DragEvent dragEvent) {
+ System.out.println("onDrag occured.");
+ System.out.println("DragValue: " + dragEvent.getDragValue());
+ System.out.println("DropValue: " + dragEvent.getDropValue());
+ }
+
+ public void processLSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ leftSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public void processRSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ rightSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public TreeNode<String> getTreeNodeLeft() {
+ if (treeNodeLeft == null) {
+ treeNodeLeft = initPaneTree();
+ }
+ return treeNodeLeft;
+ }
+
+ public void setTreeNodeLeft(TreeNode<String> treeNodeLeft) {
+ this.treeNodeLeft = treeNodeLeft;
+ }
+
+ public UITree getLeftTree() {
+ return leftTree;
+ }
+
+ public void setLeftTree(UITree leftTree) {
+ this.leftTree = leftTree;
+ }
+
+ public String getRightSelectedNodeTitle() {
+ return rightSelectedNodeTitle;
+ }
+
+ public void setRightSelectedNodeTitle(String rightSelectedNodeTitle) {
+ this.rightSelectedNodeTitle = rightSelectedNodeTitle;
+ }
+
+ public String getLeftSelectedNodeTitle() {
+ return leftSelectedNodeTitle;
+ }
+
+ public void setLeftSelectedNodeTitle(String leftSelectedNodeTitle) {
+ this.leftSelectedNodeTitle = leftSelectedNodeTitle;
+ }
+
+ public UITree getRightTree() {
+ return rightTree;
+ }
+
+ public void setRightTree(UITree rightTree) {
+ this.rightTree = rightTree;
+ }
+
+ public TreeNode<String> getTreeNodeRight() {
+ if (treeNodeRight == null) {
+ treeNodeRight = initPaneTree();
+ }
+ return treeNodeRight;
+ }
+
+ public void setTreeNodeRight(TreeNode<String> treeNodeRight) {
+ this.treeNodeRight = treeNodeRight;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,44 @@
+package tTree;
+
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import tTree.data.Dir;
+import tTree.data.Package;
+import tTree.data.Project;
+
+@Name("tTreeNA")
+(a)Scope(ScopeType.SESSION)
+public class TTreeNA {
+ private ArrayList<Project> treeNA;
+
+ public TTreeNA() {
+ treeNA = new ArrayList<Project>();
+ ArrayList<Dir> dirsArr = new ArrayList<Dir>();
+ ArrayList<Package> packArr = new ArrayList<Package>();
+
+ treeNA.clear();
+ for (int i = 0; i < 3; i++) {
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + i + " " + j + "
" + k));
+ }
+ dirsArr.add(new Dir("dir #" + i + " " + j, new
ArrayList<Package>(packArr)));
+ }
+ treeNA.add(new Project("project #" + i, new
ArrayList<Dir>(dirsArr)));
+ }
+ }
+
+ public ArrayList<Project> getTreeNA() {
+ return treeNA;
+ }
+
+ public void setTreeNA(ArrayList<Project> treeNA) {
+ this.treeNA = treeNA;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,54 @@
+package tTree;
+
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import tTree.data.Dir;
+import tTree.data.Package;
+
+@Name("tTreeRNA")
+(a)Scope(ScopeType.SESSION)
+public class TTreeRNA {
+ private ArrayList<Dir> treeRNAroots;
+
+ public TTreeRNA() {
+ treeRNAroots = new ArrayList<Dir>();
+ ArrayList<Dir> dirsArr = new ArrayList<Dir>();
+ ArrayList<Dir> subDirsArr = new ArrayList<Dir>();
+ ArrayList<Package> packArr = new ArrayList<Package>();
+ ArrayList<Package> subPackArr = new ArrayList<Package>();
+
+ treeRNAroots.clear();
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ subDirsArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + j + " " + k));
+ }
+ for (int f = 0; f < 4; f++) {
+ subPackArr.clear();
+ for (int l = 0; l < 5; l++) {
+ subPackArr.add(new Package("subPackage #" + j + " " + f
+ + " " + l));
+ }
+ subDirsArr.add(new Dir("subDir #" + j + " " + f,
+ new ArrayList<Package>(subPackArr)));
+ }
+ dirsArr.add(new Dir("dir #" + j, new ArrayList<Package>(packArr),
+ new ArrayList<Dir>(subDirsArr)));
+ }
+ treeRNAroots.add(new Dir("*** root ***", null, dirsArr));
+ }
+
+ public ArrayList<Dir> getTreeRNAroots() {
+ return treeRNAroots;
+ }
+
+ public void setTreeRNAroots(ArrayList<Dir> treeRNAroots) {
+ this.treeRNAroots = treeRNAroots;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,44 @@
+package tTree.data;
+
+import java.util.ArrayList;
+
+public class Dir {
+ private String name;
+ private ArrayList<Package> packages;
+ private ArrayList<Dir> dirs;
+
+ public Dir(String name, ArrayList<Package> packages) {
+ this.name = name;
+ this.packages = packages;
+ }
+
+ public Dir(String name, ArrayList<Package> packages, ArrayList<Dir> dirs) {
+ this.name = name;
+ this.packages = packages;
+ this.dirs = dirs;
+ }
+
+ public ArrayList<Dir> getDirs() {
+ return dirs;
+ }
+
+ public void setDirs(ArrayList<Dir> dirs) {
+ this.dirs = dirs;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ArrayList<Package> getPackages() {
+ return packages;
+ }
+
+ public void setPackages(ArrayList<Package> packages) {
+ this.packages = packages;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,17 @@
+package tTree.data;
+
+public class Package {
+ private String name;
+
+ public Package(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,29 @@
+package tTree.data;
+
+import java.util.ArrayList;
+
+public class Project {
+ private String name;
+ private ArrayList<Dir> srcDirs;
+
+ public Project(String name, ArrayList<Dir> srcDirs) {
+ this.name = name;
+ this.srcDirs = srcDirs;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ArrayList<Dir> getSrcDirs() {
+ return srcDirs;
+ }
+
+ public void setSrcDirs(ArrayList<Dir> srcDirs) {
+ this.srcDirs = srcDirs;
+ }
+}
Added:
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties
===================================================================
---
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties
(rev 0)
+++
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,67 @@
+1=Daniel Defo
+1.1=Robinson Crusoe
+1.1.1=Start In Life
+1.1.2=Slavery And Escape
+1.1.3=Wrecked On A Desert Island
+1.1.4=First Weeks On The Island
+1.1.5=Builds A House - The Journal
+1.1.6=Ill And Conscience-Stricken
+1.1.7=Agricultural Experience
+1.1.8=Surveys His Position
+1.1.9=A Boat
+1.1.10=Tames Goats
+1.1.11=Finds Print Of Man's Foot On The Sand
+1.1.12=A Cave Retreat
+1.1.13=Wreck Of A Spanish Ship
+1.1.14=A Dream Realised
+1.1.15=Friday's Education
+1.1.16=Rescue Of Prisoners From Cannibals
+1.1.17=Visit Of Mutineers
+1.1.18=The Ship Recovered
+1.1.19=Return To England
+1.1.20=Fight Between Friday And A Bear
+2=Edgar Allan Poe
+2.1=Plays
+2.1.1=Politian
+2.2=Short stories
+2.2.1=The Assignation
+2.2.2=Berenice
+2.2.3=The Black Cat
+2.2.4=The Cask of Amontillado
+2.2.5=A Descent into the Maelstrom
+2.3=Poetry
+2.3.1=Alone
+2.3.2=An Enigma
+2.3.3=Annabel Lee
+2.3.4=Bridal Ballad
+3=Henry Wadsworth Longfellow
+3.1=The Song of Hiawatha
+3.1.1=Introduction
+3.1.2=I. The Peace-Pipe
+3.1.3=II. The Four Winds
+3.1.4=III. Hiawatha's Childhood
+3.1.5=IV. Hiawatha and Mudjekeewis
+3.1.6=V. Hiawatha's Fasting
+3.1.7=VI. Hiawatha's Friends
+3.1.8=VII. Hiawatha's Sailing
+3.1.9=VIII. Hiawatha's Fishing
+3.1.10=IX. Hiawatha and the Pearl-Feather
+3.1.11=X. Hiawatha's Wooing
+3.1.12=XI. Hiawatha's Wedding-Feast
+3.1.13=XII. The Son of the Evening Star
+3.1.14=XIII. Blessing the Cornfields
+3.1.15=XIV. Picture-Writing
+3.1.16=XV. Hiawatha's Lamentation
+3.1.17=XVI. Pau-Puk-Keewis
+3.1.18=XVII. The Hunting of Pau-Puk-Keewis
+3.1.19=XVIII. The Death of Kwasind
+3.1.20=XIX. The Ghosts
+3.1.21=XX. The Famine
+3.1.22=XXI. The White Man's Foot
+3.1.23=XXII. Hiawatha's Departure
+3.2=Poetry
+3.2.1=A Psalm Of Life
+3.2.2=Birds Of Passage
+3.2.3=Hiawatha's Childhood
+3.2.4=Hymn To The Night
+
Added: trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tree</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ajax4jsf.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>tree</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>maven2-repository.dev.java.net</id>
+ <
name>Java.net Repository for Maven</name>
+ <
url>https://maven2-repository.dev.java.net/nonav/repository</url>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <id>maven2-snapshots.ajax4jsf.org</id>
+ <name>Ajax4jsf Repository for Maven Snapshots</name>
+ <
url>https://ajax4jsf.dev.java.net/nonav/snapshots</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <id>maven2-snapshots.ajax4jsf.org</id>
+ <name>Ajax4jsf Repository for Maven Snapshots</name>
+ <
url>https://ajax4jsf.dev.java.net/nonav/snapshots</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.1_02</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ajax4jsf</groupId>
+ <artifactId>framework</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml
(rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <description>RF Test-Application</description>
+ <display-name>test-application</display-name>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+
<param-value>/WEB-INF/faces-config-RichPanelsBean.xml,/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,
+ /WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,
+ /WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,
+ /WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,
+ /WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,
+ /WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,
+ /WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,
+ /WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,
+ /WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,
+ /WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,
+ /WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,
+ /WEB-INF/faces-config-RichTest.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,
+ /WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml 2009-04-08
08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml 2009-04-08
09:51:49 UTC (rev 13420)
@@ -274,6 +274,9 @@
<rich:column>
<fieldset class="rich-fieldset">
<legend class="rich-legend">Student</legend>
+ <input type="checkbox"> The first </input> <br />
+ <input type="checkbox"> The second </input> <br />
+ <input type="checkbox"> The third </input>
</fieldset>
</rich:column>
<rich:column>
@@ -294,6 +297,7 @@
<h:outputText value="components have not disabled state" />
</rich:column>
</rich:columnGroup>
+<!--
<rich:columnGroup>
<rich:column>
<h:outputText value="isindex" />
@@ -322,5 +326,6 @@
<keygen disabled="true" class="rich-keygen" />
</rich:column>
</rich:columnGroup>
+ -->
</rich:dataTable>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml 2009-04-08
08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml 2009-04-08
09:51:49 UTC (rev 13420)
@@ -1,194 +1,133 @@
+<f:subview
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich" id="tTreeSubviewID">
-<f:subview
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich" id="treeSubviewID">
-<style type="text/css">
-.LeftTreePane {
-
-}
+ <h:panelGrid columns="2" border="1">
+ <f:facet name="header">
+ <h:outputText value="Select tree to show: " />
+ </f:facet>
+ <h:outputText value="default Tree: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreeSubviewID}">
+ <a4j:support event="onchange"
reRender="dTreePanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Tree with treeNodesAdaptor: " />
+ <h:selectBooleanCheckbox
value="#{pVisability.tTreePropertySubviewID}">
+ <a4j:support event="onchange"
reRender="tTreeNAPanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor: " />
+ <h:selectBooleanCheckbox
+ value="#{pVisability.tTreeStraightforwardSubviewID}">
+ <a4j:support event="onchange"
reRender="tTreeRNAPanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Tree with Drag and Drop functionality: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreeDefaultSubviewID}">
+ <a4j:support event="onchange"
reRender="tTreeDNDPanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+ <rich:spacer height="10" />
-.RightTreePane {
-
-}
+ <a4j:outputPanel id="dTreePanelID">
+ <h:panelGrid columns="1"
rendered="#{pVisability.tTreeSubviewID}">
+ <h:outputText value="default Tree" style="color: red" />
+ <rich:tree id="dTree" switchType="#{tTree.switchType}"
+ value="#{tTree.data}" var="defTree"
binding="#{tTree.tree}"
+ ajaxSubmitSelection="#{tTree.ajaxSubmitSelection}"
+ immediate="#{tTree.immediate}" rendered="#{tTree.rendered}"
+ reRender="reRenderID" ignoreDupResponses="true"
+ nodeFace="#{defTree.name != 'param-value' ? 'text' :
'input'}"
+ showConnectingLines="#{tTree.showConnectingLines}"
focus="focusID"
+ nodeSelectListener="#{tTree.nodeSelectListener}"
+ toggleOnClick="#{tTree.toggleOnClick}"
+ changeExpandListener="#{tTree.changeExpandListener}"
+ adviseNodeOpened="#{tTree.adviseNodeOpened}"
+ adviseNodeSelected="#{tTree.adviseNodeSelected}"
+ onbeforedomupdate="#{event.onbeforedomupdate}"
+ onclick="#{event.onclick}" oncollapse="#{event.oncollapse}"
+ oncomplete="#{event.oncomplete}"
ondblclick="#{event.ondblclick}"
+ ondragend="#{event.ondragend}"
ondragenter="#{event.ondragenter}"
+ ondragexit="#{event.ondragexit}"
ondragstart="#{event.ondragstart}"
+ ondrop="#{event.ondrop}" ondropend="#{event.ondropend}"
+ ondropout="#{event.ondropout}" ondropover="#{event.ondropover}"
+ onexpand="#{event.onexpand}" onkeydown="#{event.onkeydown}"
+ onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
+ onmousedown="#{event.onmousedown}"
+ onmousemove="#{event.onmousemove}"
onmouseout="#{event.onmouseout}"
+ onmouseover="#{event.onmouseover}"
onmouseup="#{event.onmouseup}"
+ onselected="#{event.onselected}">
-.TreeContainer {
- overflow: auto;
- height: 400px;
- border: 3px inset gray;
-}
-</style>
-<script type="text/javascript">
- // <![CDATA[
- function blinkElement(elt) {
- while (elt.tagName.toLowerCase() != 'table') {
- elt = elt.parentNode;
- }
-
- elt.style.borderColor= '#5555FF';
- elt.style.borderStyle= 'dotted';
- elt.style.borderWidth = '3px';
- setTimeout( function() { this.style.borderStyle = 'none'; }.bind(elt), 300);
- }
- // ]]>
- </script>
- <a4j:outputPanel ajaxRendered="true">
- <h:messages />
- </a4j:outputPanel>
+ <rich:treeNode type="input">
+ <h:outputText value="#{defTree} : " />
+ <h:inputText value="#{defTree.name}" />
+ </rich:treeNode>
- <rich:tree id="tree" switchType="#{treeBean.switchType}"
value="#{treeBean.data}" var="data"
selectedClass="#{style.selectedClass}"
styleClass="#{style.styleClass}" style="#{style.style}"
highlightedClass="#{style.highlightedClass}"
- nodeFace="#{data.name != 'param-value' ? 'input' :
'text'}" changeExpandListener="#{treeBean.onExpand}"
- nodeSelectListener="#{treeBean.onSelect}"
binding="#{treeBean.tree}" onselected="window.status='selectedNode:
'+event.selectedNode;"
- onexpand="window.status='expandedNode: '+event.expandedNode"
oncollapse="window.status='collapsedNode: '+ event.collapsedNode"
- ajaxSubmitSelection="true" reRender="outputText, selectOneListbox"
preserveModel="none" dragIndicator="treeIndicator"
- immediate="false" acceptedTypes="file1"
dragType="#{treeBean.dragOn ? 'file1' : ''}"
iconCollapsed="#{treeBean.iconCollapsed}"
- iconExpanded="#{treeBean.iconExpanded}"
iconLeaf="#{treeBean.iconLeaf}" icon="#{treeBean.icon}"
dropListener="#{treeBean.processDrop}"
- onclick="#{event.onclick}" ondblclick="#{event.ondblclick}"
ondragend="#{event.ondragend}" ondragenter="#{event.ondragenter}"
ondragexit="#{event.ondragexit}" ondragstart="#{event.ondragstart}"
ondrop="#{event.ondrop}" ondropend="#{event.ondropend}"
onkeydown="#{event.onkeydown}" onkeypress="#{event.onkeypress}"
onkeyup="#{event.onkeyup}" onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
onbeforedomupdate="#{event.onbeforedomupdate}"
oncomplete="#{event.oncomplete}" ondropout="#{event.ondropout}"
ondropover="#{event.ondropover}">
+ <rich:treeNode type="text">
+ <h:outputText value="#{defTree}" />
+ </rich:treeNode>
+ </rich:tree>
+ <hr />
+ <h:commandButton id="focusID" action="#{tTree.add}"
value="add test" />
+ <h:panelGrid columns="2">
+ <f:facet name="header">
+ <h:outputText value="Tree Properties" />
+ </f:facet>
- <f:facet name="icon">
- <h:outputText value="icon" rendered="#{treeBean.renderFacets}"
/>
- </f:facet>
- <f:facet name="iconLeaf">
- <h:outputText value="leaf" rendered="#{treeBean.renderFacets}"
/>
- </f:facet>
- <f:facet name="iconExpanded">
- <h:outputText value="expanded"
rendered="#{treeBean.renderFacets}" />
- </f:facet>
- <f:facet name="iconCollapsed">
- <h:outputText value="collapsed"
rendered="#{treeBean.renderFacets}" />
- </f:facet>
+ <h:outputText value="reRender:" />
+ <h:panelGroup>
+ <a4j:commandButton value="reset"
+ action="#{tTree.resetReRenderCheck}"
reRender="reRenderID"></a4j:commandButton>
+ <h:outputText id="reRenderID" value="#{tTree.reRenderCheck}"
/>
+ </h:panelGroup>
- <rich:dndParam name="treeParam" value="Tree Parameter" />
- <rich:dndParam name="accept" value="accept" />
+ <h:outputText value="Change tree switchType:" />
+ <h:selectOneRadio value="#{tTree.switchType}"
onclick="submit();">
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ </h:selectOneRadio>
- <rich:treeNode type="input"
dropListener="#{treeBean.processDrop}"
- oncollapse="Element.removeClassName(event['treeItem'].getElement(),
'colored')"
- onexpand="Element.addClassName(event['treeItem'].getElement(),
'colored')"
- onbeforedomupdate="#{event.onbeforedomupdate}"
onclick="#{event.onclick}" oncomplete="#{event.oncomplete}"
oncontextmenu="#{event.oncontextmenu}"
ondblclick="#{event.ondblclick}" ondragend="#{event.ondragend}"
ondragenter="#{event.ondragenter}" ondragexit="#{event.ondragexit}"
ondragstart="#{event.ondragstart}" ondrop="#{event.ondrop}"
ondropend="#{event.ondropend}" ondropout="#{event.ondropout}"
ondropover="#{event.ondropover}" onkeydown="#{event.onkeydown}"
onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}"
onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}"
onmouseup="#{event.onmouseup}" onselected="#{event.onselected}">
- <h:outputText value="#{data} : " />
- <h:inputText value="#{data.name}" required="true"
styleClass="inputs">
- </h:inputText>
+ <h:outputText value="rendered:" />
+ <h:selectBooleanCheckbox value="#{tTree.rendered}"
+ onchange="submit();" />
- <rich:dndParam name="nodeParam" value="Node Parameter" />
+ <h:outputText value="showConnectingLines:" />
+ <h:selectBooleanCheckbox value="#{tTree.showConnectingLines}"
+ onchange="submit();" />
- </rich:treeNode>
- <rich:treeNode type="text" nodeClass="customNode"
acceptedTypes="file2" onselected="return false;">
- <h:outputText value="#{data}" />
- </rich:treeNode>
- </rich:tree>
+ <h:outputText value="toggleOnClick:" />
+ <h:selectBooleanCheckbox value="#{tTree.toggleOnClick}"
+ onchange="submit();" />
- <f:verbatim>
- <br />
- </f:verbatim>
+ <h:outputText value="ajaxSubmitSelection:" />
+ <h:selectBooleanCheckbox value="#{tTree.ajaxSubmitSelection}"
+ onchange="submit();" />
- <h:outputText value="Enter path to expand:" />
- <h:inputText value="#{treeBean.pathToExpand}">
- <a4j:support event="onchange" reRender="tree"
action="#{treeBean.expandNode}" />
- </h:inputText>
+ <h:outputText value="immediate:" />
+ <h:selectBooleanCheckbox value="#{tTree.immediate}"
+ onchange="submit();" />
- <rich:separator></rich:separator>
+ <h:outputText value="use custom icons:" />
+ <h:selectBooleanCheckbox value="#{tTree.useCustomIcons}">
+ <a4j:support action="#{tTree.addCustomIcons}"
event="onchange"
+ reRender="dTreePanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
- <h:panelGrid columns="2">
- <h:outputText value="Change tree switchType:" />
- <h:selectOneRadio value="#{treeBean.switchType}"
onclick="submit()">
- <f:selectItem itemLabel="client" itemValue="client" />
- <f:selectItem itemLabel="server" itemValue="server" />
- <f:selectItem itemLabel="ajax" itemValue="ajax" />
- </h:selectOneRadio>
+ <h:outputText value="adviseNodeOpened:" />
+ <h:selectOneRadio value="#{tTree.anOpened}"
onclick="submit();">
+ <f:selectItem itemLabel="null (default)" itemValue="null"
/>
+ <f:selectItem itemLabel="false (do not open)"
itemValue="FALSE" />
+ <f:selectItem itemLabel="true (open)" itemValue="TRUE" />
+ </h:selectOneRadio>
- <h:outputText value="Drag switch:" />
- <h:selectBooleanCheckbox value="#{treeBean.dragOn}"
onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="Render facets:" />
- <h:selectBooleanCheckbox value="#{treeBean.renderFacets}"
onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:commandButton value="#{treeBean.commandButtonCaption}"
actionListener="#{treeBean.changeIcons}" />
+ <h:outputText value="adviseNodeSelected:" />
+ <h:selectOneRadio value="#{tTree.anSelected}"
onclick="submit();">
+ <f:selectItem itemLabel="null (default)" itemValue="null"
/>
+ <f:selectItem itemLabel="false (do not select)"
itemValue="FALSE" />
+ <f:selectItem itemLabel="true (select)" itemValue="TRUE"
/>
+ </h:selectOneRadio>
+ </h:panelGrid>
+ <rich:separator height="10" />
</h:panelGrid>
-
- <f:verbatim>
- <br />
- <br />
- </f:verbatim>
-
- <rich:tree id="testTree" var="_data" switchType="ajax"
ajaxSubmitSelection="true" preserveModel="none"
value="#{treeBean.data1}"
- nodeSelectListener="#{treeBean.onSelectInc}" nodeFace="node">
- <rich:treeNode type="node">
- <h:outputText value="#{_data}" />
- </rich:treeNode>
- </rich:tree>
- <rich:separator></rich:separator>
- <h:outputText value="Tree without treeNode:"></h:outputText>
- <rich:separator></rich:separator>
-
- <rich:tree switchType="client" style="width:300px"
value="#{pathwayBean.pathwayTree}" var="item"
nodeFace="#{item.type}">
- <rich:treeNode type="library">
- <h:outputText value="#{item.type}" />
- </rich:treeNode>
- <rich:treeNode type="pathway">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- <rich:treeNode type="organism">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- </rich:tree>
-
- <rich:spacer></rich:spacer>
- <!-- Drag and Drop API for rich:tree component -->
- <div style="FONT-WEIGHT: bold;">Drag and Drop example</div>
- <br />
-
- <rich:dragIndicator id="treeIndicator">
- <f:facet name="single">
- <f:verbatim>{marker} {nodeParam}({treeParam})</f:verbatim>
- </f:facet>
- </rich:dragIndicator>
-
- <h:panelGrid columns="2"
columnClasses="LeftTreePane,RightTreePane">
-
- <h:panelGroup id="leftContainer" layout="block"
- styleClass="TreeContainer">
- <h:outputText escape="false"
- value="Selected Node: #{treeDndBean.leftSelectedNodeTitle}"
- id="selectedNodeL" />
-
- <rich:tree id="leftTree" style="width:300px"
- nodeSelectListener="#{treeDndBean.processLSelection}"
- reRender="selectedNodeL" ajaxSubmitSelection="true"
- switchType="client" value="#{treeDndBean.treeNodeLeft}"
- changeExpandListener="#{treeDndBean.onExpand}"
- binding="#{treeDndBean.leftTree}"
- onselected="window.status='selectedNode: '+event.selectedNode;"
- onexpand="window.status='expandedNode: '+event.expandedNode"
- oncollapse="window.status='collapsedNode: '+event.collapsedNode"
- dropListener="#{treeDndBean.onDrop}"
- dragListener="#{treeDndBean.onDrag}"
dragIndicator="treeIndicator"
- acceptedTypes="treeNode" dragType="treeNode"
rowKeyVar="key"
- var="item" >
-
- <rich:dndParam name="treeParam" value="leftTree" />
- </rich:tree>
-
- </h:panelGroup>
-
- <h:panelGroup id="rightContainer" layout="block"
- styleClass="TreeContainer">
- <h:outputText escape="false"
- value="Selected Node: #{treeDndBean.rightSelectedNodeTitle}"
- id="selectedNodeR" />
-
- <rich:tree id="rightTree" style="width:300px"
- nodeSelectListener="#{treeDndBean.processRSelection}"
- reRender="selectedNodeR,rightContainer"
ajaxSubmitSelection="true"
- switchType="client" value="#{treeDndBean.treeNodeRight}"
- changeExpandListener="#{treeDndBean.onExpand}"
- binding="#{treeDndBean.rightTree}"
- onselected="window.status='selectedNode: '+event.selectedNode;"
- onexpand="window.status='expandedNode: '+event.expandedNode"
- oncollapse="window.status='collapsedNode: '+event.collapsedNode"
- rowKeyVar="key" dropListener="#{treeDndBean.onDrop}"
- dragListener="#{treeDndBean.onDrag}"
dragIndicator="treeIndicator"
- acceptedTypes="treeNode" dragType="treeNode"
var="item">
- <rich:dndParam name="treeParam" value="rightTree" />
- </rich:tree>
- </h:panelGroup>
-
- </h:panelGrid>
-
+ </a4j:outputPanel>
</f:subview>
Deleted: trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeDefault.xhtml
===================================================================
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml 2009-04-08
08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml 2009-04-08
09:51:49 UTC (rev 13420)
@@ -1,20 +1,30 @@
-
<f:subview
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:rich="http://richfaces.org/rich"
id="treePropertySubviewID">
- <br />
- <h:commandButton action="#{treeBean.add}" value="add test" />
- <br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <rich:column>
- <a4j:commandLink value="getAdviseNodeSelected"
reRender="findID"></a4j:commandLink>
- </rich:column>
- <rich:column id="findID">
- <h:outputText
- value="#{rich:findComponent('tree').adviseNodeSelected}" />
- </rich:column>
- </h:panelGrid>
+
xmlns:rich="http://richfaces.org/rich"
id="tTreePropertySubviewID">
+
+ <a4j:outputPanel id="tTreeNAPanelID">
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreePropertySubviewID}">
+ <h:outputText value="Tree with treeNodesAdaptor" style="color:
red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeNA.treeNA}"
var="project">
+ <rich:treeNode>
+ <h:outputText value="#{project.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor nodes="#{project.srcDirs}"
var="dir">
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor nodes="#{dir.packages}"
var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ </h:panelGrid>
+ </a4j:outputPanel>
</f:subview>
\ No newline at end of file
Copied: trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml
(from rev 13382,
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeDefault.xhtml)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml
(rev 0)
+++
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml 2009-04-08
09:51:49 UTC (rev 13420)
@@ -0,0 +1,117 @@
+<f:subview
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+ id="tTreeStraightforwardSubviewID">
+
+ <style type="text/css">
+.LeftTreePane {
+
+}
+
+.RightTreePane {
+
+}
+
+.TreeContainer {
+ overflow: auto;
+ height: 400px;
+ border: 3px inset gray;
+}
+</style>
+
+ <a4j:outputPanel id="tTreeRNAPanelID">
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor"
+ style="color: red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeRNA.treeRNAroots}"
var="root">
+ <rich:treeNode>
+ <h:outputText value="#{root.name}" />
+ </rich:treeNode>
+ <rich:recursiveTreeNodesAdaptor var="dir"
roots="#{root.dirs}"
+ nodes="#{dir.dirs}">
+ <rich:treeNodesAdaptor nodes="#{dir.packages}"
var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ </rich:recursiveTreeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ <rich:separator height="10" />
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel id="tTreeDNDPanelID">
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeDefaultSubviewID}">
+ <h:outputText value="Tree with Drag and Drop functionality"
+ style="color: red" />
+
+ <rich:dragIndicator id="treeIndicator">
+ <f:facet name="single">
+ <f:verbatim>{marker} {nodeParam}({treeParam})</f:verbatim>
+ </f:facet>
+ </rich:dragIndicator>
+
+ <h:panelGrid columns="2"
columnClasses="LeftTreePane,RightTreePane">
+
+ <h:panelGroup id="leftContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node:
+ #{tTreeDND.leftSelectedNodeTitle}"
+ id="selectedNodeL" />
+
+ <rich:tree id="leftTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processLSelection}"
+ reRender="selectedNodeL" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeLeft}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.leftTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ dropListener="#{tTreeDND.onDrop}"
+ dragListener="#{tTreeDND.onDrag}"
dragIndicator="treeIndicator"
+ acceptedTypes="treeNodeR" dragType="treeNodeL"
rowKeyVar="key"
+ var="item">
+
+ <rich:dndParam name="treeParam" value="leftTree" />
+ </rich:tree>
+ </h:panelGroup>
+
+ <h:panelGroup id="rightContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node:
+ #{tTreeDND.rightSelectedNodeTitle}"
+ id="selectedNodeR" />
+
+ <rich:tree id="rightTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processRSelection}"
+ reRender="selectedNodeR" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeRight}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.rightTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ rowKeyVar="key" dropListener="#{tTreeDND.onDrop}"
+ dragListener="#{tTreeDND.onDrag}"
dragIndicator="treeIndicator"
+ acceptedTypes="treeNodeL" dragType="treeNodeR"
var="item">
+
+ <rich:dndParam name="treeParam" value="rightTree" />
+ </rich:tree>
+ </h:panelGroup>
+ </h:panelGrid>
+ <rich:separator height="10" />
+ </h:panelGrid>
+ </a4j:outputPanel>
+</f:subview>
\ No newline at end of file