Author: dsvyatobatsko
Date: 2008-12-09 04:27:35 -0500 (Tue, 09 Dec 2008)
New Revision: 11658
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeAutoTest.xhtml
Log:
changed tree entity id generation method + lost commit
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java 2008-12-09
09:27:35 UTC (rev 11658)
@@ -0,0 +1,35 @@
+package org.ajax4jsf.bean.tree;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.ajax4jsf.bean.tree.rich.AudioLibrary;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.xmlrules.DigesterLoader;
+import org.xml.sax.SAXException;
+
+public class TreeBuilder {
+
+ private static long id = 1;
+
+ public static long nextId() {
+ return id++;
+ }
+
+ public static void main(String[] args) {
+ URL rulesUrl = TreeBuilder.class.getResource("/digester-rules.xml");
+ Digester digester = DigesterLoader.createDigester(rulesUrl);
+ AudioLibrary library = new AudioLibrary();
+ digester.push(library);
+
+ try {
+
digester.parse(TreeBuilder.class.getResourceAsStream("/audio-library.xml"));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-12-09
01:00:53 UTC (rev 11657)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/TreeTestBean.java 2008-12-09
09:27:35 UTC (rev 11658)
@@ -111,7 +111,7 @@
private TreeNode<Object> richRootNode = null;
- public TreeNode<Object> getRichTreeNode() {
+ public synchronized TreeNode<Object> getRichTreeNode() {
if (null == richRootNode) {
Digester digester =
DigesterLoader.createDigester(getClass().getResource("/rich-digester-rules.xml"));
AudioLibrary library = new AudioLibrary();
@@ -133,7 +133,7 @@
private javax.swing.tree.TreeNode swingRootNode = null;
- public javax.swing.tree.TreeNode getSwingTreeNode() {
+ public synchronized javax.swing.tree.TreeNode getSwingTreeNode() {
if (null == swingRootNode) {
Digester digester =
DigesterLoader.createDigester(getClass().getResource("/swing-digester-rules.xml"));
org.ajax4jsf.bean.tree.swing.AudioLibrary library = new
org.ajax4jsf.bean.tree.swing.AudioLibrary();
@@ -371,4 +371,10 @@
setAdvisor(null);
}
+ private static long id = 1;
+
+ public long nextId() {
+ return id++;
+ }
+
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java 2008-12-09
01:00:53 UTC (rev 11657)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Album.java 2008-12-09
09:27:35 UTC (rev 11658)
@@ -1,5 +1,7 @@
package org.ajax4jsf.bean.tree.rich;
+import static org.ajax4jsf.bean.tree.TreeBuilder.nextId;
+
import org.richfaces.model.TreeNodeImpl;
public class Album extends TreeNodeImpl<Object> {
@@ -14,7 +16,7 @@
private Integer year;
public Album() {
- setId(System.currentTimeMillis());
+ setId(nextId());
}
//
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java 2008-12-09
01:00:53 UTC (rev 11657)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Performer.java 2008-12-09
09:27:35 UTC (rev 11658)
@@ -1,5 +1,7 @@
package org.ajax4jsf.bean.tree.rich;
+import static org.ajax4jsf.bean.tree.TreeBuilder.nextId;
+
import org.richfaces.model.TreeNodeImpl;
public class Performer extends TreeNodeImpl<Object> {
@@ -13,7 +15,7 @@
private String name;
public Performer() {
- setId(System.currentTimeMillis());
+ setId(nextId());
}
//
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java 2008-12-09
01:00:53 UTC (rev 11657)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/tree/rich/Song.java 2008-12-09
09:27:35 UTC (rev 11658)
@@ -1,5 +1,7 @@
package org.ajax4jsf.bean.tree.rich;
+import static org.ajax4jsf.bean.tree.TreeBuilder.nextId;
+
import org.richfaces.model.TreeNode;
import org.richfaces.model.TreeNodeImpl;
@@ -14,7 +16,7 @@
private String title;
public Song() {
- setId(System.currentTimeMillis());
+ setId(nextId());
}
//
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeAutoTest.xhtml
===================================================================
(Binary files differ)
Show replies by date