Author: bleathem
Date: 2011-11-17 00:03:02 -0500 (Thu, 17 Nov 2011)
New Revision: 22947
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage.java
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage_impl.java
Log:
Updated the tree component basic usage sample with working code
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage.java
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage.java 2011-11-17
03:19:09 UTC (rev 22946)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage.java 2011-11-17
05:03:02 UTC (rev 22947)
@@ -1,14 +1,20 @@
-private DataHolderTreeNodeImpl stationRoot = new DataHolderTreeNodeImpl();
-private DataHolderTreeNodeImpl stationNodes = new DataHolderTreeNodeImpl();
-private String[] kickRadioFeed = { "Hall & Oates - Kiss On My List",
- "David Bowie - Let's Dance",
- "Lyn Collins - Think (About It)",
- "Kim Carnes - Bette Davis Eyes",
- "KC & the Sunshine Band - Give It Up"
};
+private DataHolderTreeNodeImpl stationRoot;
+private DataHolderTreeNodeImpl rootNodes;
-stationRoot.setData("KickRadio");
-stationNodes.addChild(0, stationRoot);
-for (int i = 0; i < kickRadioFeed.length; i++){
- DataHolderTreeNodeImpl child = new DataHolderTreeNodeImpl(true, kickRadioFeed[i]);
- stationRoot.addChild(i, child);
+public DataHolderTreeNodeImpl getRootNodes() {
+ if (rootNodes == null) {
+ String[] kickRadioFeed = {"Hall & Oates - Kiss On My List",
+ "David Bowie - Let's Dance",
+ "Lyn Collins - Think (About It)",
+ "Kim Carnes - Bette Davis Eyes",
+ "KC & the Sunshine Band - Give It Up"};
+ stationRoot = new DataHolderTreeNodeImpl(false, "KickRadio");
+ for (int i = 0; i<kickRadioFeed.length; i++) {
+ DataHolderTreeNodeImpl child = new DataHolderTreeNodeImpl(true,
kickRadioFeed[i]);
+ stationRoot.addChild(i, child);
+ }
+ rootNodes = new DataHolderTreeNodeImpl();
+ rootNodes.addChild(0, stationRoot);
+ }
+ return rootNodes;
}
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage_impl.java
===================================================================
---
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage_impl.java 2011-11-17
03:19:09 UTC (rev 22946)
+++
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Basic_usage_impl.java 2011-11-17
05:03:02 UTC (rev 22947)
@@ -3,6 +3,10 @@
public class DataHolderTreeNodeImpl extends TreeNodeImpl {
private Object data;
+ public DataHolderTreeNodeImpl() {
+ super();
+ }
+
public DataHolderTreeNodeImpl(boolean leaf, Object data) {
super(leaf);
this.data = data;
Show replies by date