Author: tkuprevich
Date: 2009-03-20 10:24:15 -0400 (Fri, 20 Mar 2009)
New Revision: 13058
Modified:
trunk/test-applications/facelets/src/main/java/tree/Bean.java
Log:
Modified: trunk/test-applications/facelets/src/main/java/tree/Bean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tree/Bean.java 2009-03-20 13:54:01 UTC
(rev 13057)
+++ trunk/test-applications/facelets/src/main/java/tree/Bean.java 2009-03-20 14:24:15 UTC
(rev 13058)
@@ -26,7 +26,7 @@
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
-import util.componentInfo.ComponentInfo;
+import util.componentInfo.*;
public class Bean {
private String switchType = "client";
@@ -49,10 +49,10 @@
public Bean() {
try {
FacesContext context = FacesContext.getCurrentInstance();
- data = XmlTreeDataBuilder
- .build(new InputSource(getClass().getResourceAsStream("test.xml")));
- TreeNode pomData = XmlTreeDataBuilder.build(new InputSource(getClass()
- .getResourceAsStream("pom_sample.xml")));
+ 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();
@@ -77,7 +77,7 @@
child.setData("Node: " + id);
data1.addChild(id, child);
}
- //initData();
+ // initData();
}
private void initData() {
@@ -87,18 +87,21 @@
int i = 0;
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
- selectedNodeChildren
- .put(((TreeNode) entry.getValue()).getData(), Integer.toString(i++));
+ selectedNodeChildren.put(((TreeNode) entry.getValue())
+ .getData(), Integer.toString(i++));
}
}
}
- public String add(){
+ /*
+ * FIXME
+ public String add() {
ComponentInfo info = ComponentInfo.getInstance();
info.addField(tree);
return null;
}
-
+ */
+
public String getIcon() {
return icon;
}
@@ -188,26 +191,28 @@
tree.setRowKey(null);
// Force more than one node to update here:
for (int i = 0; i < 5; i++) {
- ListRowKey dirtyKey = new ListRowKey(Integer.toString(i));
+ ListRowKey dirtyKey = new ListRowKey(null, Integer.toString(i));
keys.add(dirtyKey);
tree.setRowKey(dirtyKey);
- ajaxCtx.addComponentToAjaxRender(tree.getParent(), tree.getClientId(fctx));
+ ajaxCtx.addComponentToAjaxRender(tree.getParent(), tree
+ .getClientId(fctx));
}
tree.setRowKey(key);
}
public void onExpand(NodeExpandedEvent event) {
UITree tree = getTree(event);
- System.out.println("Node " + (tree.isExpanded() ? "expanded" :
"collapsed") + " "
+ System.out.println("Node "
+ + (tree.isExpanded() ? "expanded" : "collapsed") + " "
+ tree.getRowKey());
}
public String expand() {
if (expandPath != null && expandPath.length() != 0) {
try {
- tree.queueNodeExpand(new ListRowKey(expandPath));
+ tree.queueNodeExpand(new ListRowKey(null, expandPath));
} catch (IOException e) {
-
+
e.printStackTrace();
}
}
@@ -240,7 +245,7 @@
try {
this.tree.queueExpandAll();
} catch (IOException e) {
-
+
e.printStackTrace();
}
return null;
@@ -310,7 +315,8 @@
String pathToExpand = getPathToExpand();
if (pathToExpand != null && pathToExpand.trim().length() != 0) {
try {
- ((UITree) getTree()).queueNodeExpand(new ListRowKey(pathToExpand));
+ ((UITree) getTree()).queueNodeExpand(new ListRowKey(null,
+ pathToExpand));
} catch (IOException e) {
throw new FacesException(e);
}
@@ -342,4 +348,5 @@
public void setRenderFacets(boolean renderFacets) {
this.renderFacets = renderFacets;
}
+
}
Show replies by date