JBoss Rich Faces SVN: r13632 - trunk/ui/tree/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-17 09:31:42 -0400 (Fri, 17 Apr 2009)
New Revision: 13632
Modified:
trunk/ui/tree/src/main/config/component/tree.xml
Log:
https://jira.jboss.org/jira/browse/RF-5648
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2009-04-17 12:28:48 UTC (rev 13631)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2009-04-17 13:31:42 UTC (rev 13632)
@@ -332,6 +332,10 @@
</property>
<property>
+ <name>ajaxKeys</name>
+ </property>
+
+ <property>
<name>ajaxNodeKeys</name>
<description>Keys of the nodes (without subtree) to be updated for ajax request risen by the node itself</description>
</property>
17 years
JBoss Rich Faces SVN: r13631 - in branches/examples-data/photoapp/images: default and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-04-17 08:28:48 -0400 (Fri, 17 Apr 2009)
New Revision: 13631
Added:
branches/examples-data/photoapp/images/default/
branches/examples-data/photoapp/images/default/noimage_medium.jpg
branches/examples-data/photoapp/images/default/noimage_small120.jpg
branches/examples-data/photoapp/images/default/noimage_small160.jpg
branches/examples-data/photoapp/images/default/noimage_small200.jpg
branches/examples-data/photoapp/images/default/noimage_small80.jpg
Log:
add default images
Added: branches/examples-data/photoapp/images/default/noimage_medium.jpg
===================================================================
(Binary files differ)
Property changes on: branches/examples-data/photoapp/images/default/noimage_medium.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/examples-data/photoapp/images/default/noimage_small120.jpg
===================================================================
(Binary files differ)
Property changes on: branches/examples-data/photoapp/images/default/noimage_small120.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/examples-data/photoapp/images/default/noimage_small160.jpg
===================================================================
(Binary files differ)
Property changes on: branches/examples-data/photoapp/images/default/noimage_small160.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/examples-data/photoapp/images/default/noimage_small200.jpg
===================================================================
(Binary files differ)
Property changes on: branches/examples-data/photoapp/images/default/noimage_small200.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/examples-data/photoapp/images/default/noimage_small80.jpg
===================================================================
(Binary files differ)
Property changes on: branches/examples-data/photoapp/images/default/noimage_small80.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years
JBoss Rich Faces SVN: r13630 - in trunk/test-applications/seamApp/web/src/main/webapp: TreeSwing and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-17 07:54:39 -0400 (Fri, 17 Apr 2009)
New Revision: 13630
Added:
trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/
trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwing.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml
Log:
+ TreeSwing pages
Added: trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwing.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwing.xhtml (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwing.xhtml 2009-04-17 11:54:39 UTC (rev 13630)
@@ -0,0 +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="treeSwingSubviewID">
+
+ <h3>Click tree node to delete it. Only leaf node could be deleted.</h3>
+ <rich:tree id="tree" switchType="#{treeSwing.switchType}"
+ value="#{treeSwing.top}" var="data"
+ showConnectingLines="#{treeSwing.showConnectingLines}"
+ nodeSelectListener="#{treeSwing.selectionListener}"
+ rendered="#{treeSwing.rendered}" binding="#{treeSwing.tree}"
+ ajaxSubmitSelection="true"
+ 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}" rowKeyVar="row"
+ onselected="return confirm('Do you want to delete the row you select?');"
+ oncontextmenu="#{event.oncontextmenu}"
+ disableKeyboardNavigation="#{treeSwing.disableKeyboardNavigation}">
+ </rich:tree>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml 2009-04-17 11:54:39 UTC (rev 13630)
@@ -0,0 +1,39 @@
+<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="treeSwingPropertySubviewID">
+
+ <h:commandButton id="focusID" action="#{treeSwing.add}"
+ value="add test" />
+ <h:panelGrid columns="2">
+ <f:facet name="header">
+ <h:outputText value="Tree Properties" />
+ </f:facet>
+
+ <h:outputText value="Change tree switchType:" />
+ <h:selectOneRadio value="#{treeSwing.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="rendered:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.rendered}"
+ onchange="submit();" />
+
+ <h:outputText value="disableKeyboardNavigation:" />
+ <h:selectBooleanCheckbox
+ value="#{treeSwing.disableKeyboardNavigation}" onchange="submit();" />
+
+ <h:outputText value="showConnectingLines:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.showConnectingLines}"
+ onchange="submit();" />
+
+ <h:outputText value="use custom icons:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.useCustomIcons}">
+ <a4j:support action="#{treeSwing.addCustomIcons}" event="onchange"
+ reRender="tree"></a4j:support>
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
17 years
JBoss Rich Faces SVN: r13629 - in trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain: treeSwing and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-17 07:52:34 -0400 (Fri, 17 Apr 2009)
New Revision: 13629
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/treeSwing/TreeSwing.java
Log:
+ TreeSwing pages
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-17 11:44:55 UTC (rev 13628)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2009-04-17 11:52:34 UTC (rev 13629)
@@ -57,6 +57,7 @@
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 [] {true, true, true}));
+ map.add("TreeSwing", add("/TreeSwing/TreeSwing", new boolean [] {true, true, false}));
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}));
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java 2009-04-17 11:44:55 UTC (rev 13628)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java 2009-04-17 11:52:34 UTC (rev 13629)
@@ -4,11 +4,16 @@
import javax.swing.tree.MutableTreeNode;
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.event.NodeSelectedEvent;
import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;;
+@Name("treeSwing")
+(a)Scope(ScopeType.SESSION)
public class TreeSwing {
MutableTreeNode top;
17 years
JBoss Rich Faces SVN: r13628 - in trunk/test-applications/seamApp/web/src/main: java/org/richfaces/helloworld/domain and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-17 07:44:55 -0400 (Fri, 17 Apr 2009)
New Revision: 13628
Added:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/PVisability.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTree.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeDND.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeNA.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeRNA.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/Car.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/CarProvider.java
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/tTree/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/util/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/util/data/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/util/data/cars.xml
Removed:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tree/
trunk/test-applications/seamApp/web/src/main/java/tTree/
trunk/test-applications/seamApp/web/src/main/resources/tTree/
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/skinning/Skinning.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Dir.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Package.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Project.java
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/skins/Skins.java
trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/web.xml
Log:
Make skinning workable
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2009-04-17 11:20:24 UTC (rev 13627)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -43,7 +43,7 @@
// value = "It's easy to make *emphasis*, |monospace|, ~deleted text~,
// super^scripts^ or _underlines_.";
// value = "This is a |<tag attribute=\"value\" />| example.";
- value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
+ value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the s:formattedText control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
width = "400";
height = "200";
theme = "simple";
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/skinning/Skinning.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/skinning/Skinning.java 2009-04-17 11:20:24 UTC (rev 13627)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/skinning/Skinning.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -3,9 +3,12 @@
import java.util.ArrayList;
import javax.faces.model.SelectItem;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
@Name("skinning")
+(a)Scope(ScopeType.SESSION)
public class Skinning {
private ArrayList<SelectItem> list = new ArrayList<SelectItem>();
private ArrayList<SelectItem> enableStyle = new ArrayList<SelectItem>();
Copied: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/PVisability.java (from rev 13519, trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/PVisability.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/PVisability.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,54 @@
+package org.richfaces.helloworld.domain.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;
+ }
+}
Copied: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTree.java (from rev 13519, trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTree.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTree.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,202 @@
+package org.richfaces.helloworld.domain.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
Copied: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeDND.java (from rev 13519, trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeDND.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeDND.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,254 @@
+package org.richfaces.helloworld.domain.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;
+ }
+}
Copied: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeNA.java (from rev 13519, trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeNA.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeNA.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,44 @@
+package org.richfaces.helloworld.domain.tTree;
+
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.helloworld.domain.tTree.data.Dir;
+import org.richfaces.helloworld.domain.tTree.data.Package;
+import org.richfaces.helloworld.domain.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;
+ }
+}
Copied: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeRNA.java (from rev 13519, trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeRNA.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/TTreeRNA.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,54 @@
+package org.richfaces.helloworld.domain.tTree;
+
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.helloworld.domain.tTree.data.Dir;
+import org.richfaces.helloworld.domain.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;
+ }
+}
Copied: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data (from rev 13519, trunk/test-applications/seamApp/web/src/main/java/tTree/data)
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Dir.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java 2009-04-13 10:26:15 UTC (rev 13519)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Dir.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -1,4 +1,4 @@
-package tTree.data;
+package org.richfaces.helloworld.domain.tTree.data;
import java.util.ArrayList;
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Package.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java 2009-04-13 10:26:15 UTC (rev 13519)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Package.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -1,4 +1,4 @@
-package tTree.data;
+package org.richfaces.helloworld.domain.tTree.data;
public class Package {
private String name;
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Project.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java 2009-04-13 10:26:15 UTC (rev 13519)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/tTree/data/Project.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -1,4 +1,4 @@
-package tTree.data;
+package org.richfaces.helloworld.domain.tTree.data;
import java.util.ArrayList;
Added: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/treeSwing/TreeSwing.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,155 @@
+package org.richfaces.helloworld.domain.treeSwing;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.component.UITree;
+import org.richfaces.event.NodeSelectedEvent;
+
+import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;;
+
+public class TreeSwing {
+
+ MutableTreeNode top;
+
+ UITree tree;
+
+ private String switchType = "ajax";
+
+ private boolean rendered = true;
+
+ private boolean showConnectingLines = false;
+
+ private boolean useCustomIcons = false;
+
+ private boolean disableKeyboardNavigation = false;
+
+ public TreeSwing() {
+ top = new DefaultMutableTreeNode("The Java Series");
+ createNodes(top);
+ }
+
+ public void selectionListener(NodeSelectedEvent e) {
+ UITree uiTree = (UITree) e.getComponent();
+ Object rowKey = uiTree.getRowKey();
+ MutableTreeNode node = (MutableTreeNode) uiTree.getRowData();
+ if (node.isLeaf()) {
+ uiTree.removeNode(rowKey);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ try {
+ ac.addComponentToAjaxRender(uiTree);
+ } catch (Exception exc) {
+ System.err.print(exc.getMessage());
+ }
+ }
+
+ private void createNodes(MutableTreeNode top) {
+ MutableTreeNode category = null;
+ MutableTreeNode book = null;
+
+ category = new DefaultMutableTreeNode("Books for Java Programmers");
+ top.insert(category, 0);
+
+ // original Tutorial
+ book = new DefaultMutableTreeNode(
+ "The Java Tutorial: A Short Course on the Basics");
+ category.insert(book, 0);
+
+ // Tutorial Continued
+ book = new DefaultMutableTreeNode(
+ "The Java Tutorial Continued: The Rest of the JDK");
+ category.insert(book, 1);
+
+ // JFC Swing Tutorial
+ book = new DefaultMutableTreeNode(
+ "The JFC Swing Tutorial: A Guide to Constructing GUIs");
+ category.insert(book, 2);
+
+ // ...add more books for programmers...
+ category = new DefaultMutableTreeNode("Books for Java Implementers");
+ top.insert(category, 1);
+
+ // VM
+ book = new DefaultMutableTreeNode(
+ "The Java Virtual Machine Specification");
+ category.insert(book, 0);
+
+ // Language Spec
+ book = new DefaultMutableTreeNode("The Java Language Specification");
+ category.insert(book, 1);
+ }
+
+ 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 MutableTreeNode getTop() {
+ return top;
+ }
+
+ public UITree getTree() {
+ return tree;
+ }
+
+ public void setTree(UITree tree) {
+ this.tree = tree;
+ }
+
+ public String getSwitchType() {
+ return switchType;
+ }
+
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
+ }
+
+ 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 isUseCustomIcons() {
+ return useCustomIcons;
+ }
+
+ public void setUseCustomIcons(boolean useCustomIcons) {
+ this.useCustomIcons = useCustomIcons;
+ }
+
+ public boolean isDisableKeyboardNavigation() {
+ return disableKeyboardNavigation;
+ }
+
+ public void setDisableKeyboardNavigation(boolean disableKeyboardNavigation) {
+ this.disableKeyboardNavigation = disableKeyboardNavigation;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/Car.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/Car.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/Car.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,76 @@
+package org.richfaces.helloworld.domain.util.data;
+
+public class Car {
+
+ private String make;
+
+ private String model;
+
+ private Integer price;
+
+ public Car() {
+ this.make = "";
+ this.model = "";
+ this.price = 0;
+ }
+
+ public Car(String mak, String mod, Integer pr) {
+ this.make = mak;
+ this.model = mod;
+ this.price = pr;
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public Integer getPrice() {
+ return price;
+ }
+
+ public void setPrice(Integer price) {
+ this.price = price;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((make == null) ? 0 : make.hashCode());
+ result = prime * result + ((model == null) ? 0 : model.hashCode());
+ result = prime * result + ((price == null) ? 0 : price.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Car) {
+ Car car = (Car) obj;
+ if (this.make.equals(car.make) && (this.model.equals(car.model))
+ && (this.price.equals(car.price))) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return this.make + ":" + this.model + ":" + this.price;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/CarProvider.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/CarProvider.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/data/CarProvider.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,111 @@
+package org.richfaces.helloworld.domain.util.data;
+
+import java.util.ArrayList;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class CarProvider extends DefaultHandler {
+
+ private ArrayList<Car> allCars = null;
+
+ public CarProvider() {
+ if (allCars == null) {
+ allCars = new ArrayList<Car>();
+ try {
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ SAXParser sp = spf.newSAXParser();
+ sp.parse(new InputSource(getClass().getResourceAsStream(
+ "cars.xml")), this);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public ArrayList<Car> getAllCars() {
+ return allCars;
+ }
+
+ private String element = "";
+ private String mak = "";
+ private String mod = "";
+ private Integer pr = 0;
+
+ public void startDocument() {
+ System.out.println("*** > Parser starts its work");
+ }
+
+ public void startElement(String namespaceURI, String localName,
+ String rawName, Attributes attrs) {
+ element = rawName;
+
+// System.out.print("<");
+// System.out.print(rawName);
+// if (attrs != null) {
+// int len = attrs.getLength();
+// for (int i = 0; i < len; i++) {
+// System.out.print(" ");
+// System.out.print(attrs.getQName(i));
+// System.out.print("=\"");
+// System.out.print(attrs.getValue(i));
+// System.out.print("\"");
+// }
+// }
+// System.out.print(">");
+ }
+
+ public void characters(char ch[], int start, int length) {
+ String text = new String(ch, start, length);
+// System.out.print(text);
+
+ if (element.equals("make")) {
+ element = "";
+ mak = text;
+ } else if (element.equals("model")) {
+ element = "";
+ mod = text;
+ } else if (element.equals("price")) {
+ try {
+ element = "";
+ Integer p = Integer.parseInt(text);
+ pr = p;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void endElement(String namespaceURI, String localName, String rawName) {
+// System.out.print("</");
+// System.out.print(rawName);
+// System.out.print(">");
+
+ if (rawName.equals("car")) {
+ allCars.add(new Car(mak, mod, pr));
+ }
+ }
+
+ public void endDocument() {
+ System.out.println("*** > Parser ends its work");
+ }
+
+ public void warning(SAXParseException ex) {
+ System.err.println("[Warning] : " + ex.getMessage());
+ }
+
+ public void error(SAXParseException ex) {
+ System.err.println("[Error] : " + ex.getMessage());
+ }
+
+ public void fatalError(SAXParseException ex) throws SAXException {
+ System.err.println("[Fatal Error] : " + ex.getMessage());
+ throw ex;
+ }
+}
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/skins/Skins.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/skins/Skins.java 2009-04-17 11:20:24 UTC (rev 13627)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/util/skins/Skins.java 2009-04-17 11:44:55 UTC (rev 13628)
@@ -28,8 +28,6 @@
private String defaultSkin = "deepMarine";
private String skin = defaultSkin;
- @In(required=false)
- public UIComponent skinComponent = null;
private UISelectOne createComponent() {
UISelectOne selectOne = new HtmlSelectOneRadio();
@@ -52,7 +50,7 @@
public String getSkin() {
return skin;
}
-
+
public UIComponent getSkinComponent() {
FacesContext facesContext = FacesContext.getCurrentInstance();
Map requestMap = facesContext.getExternalContext().getRequestMap();
@@ -61,12 +59,12 @@
return (UISelectOne) object;
}
- skinComponent = createComponent();
- requestMap.put("SkinBean", skinComponent);
- return skinComponent;
+ UISelectOne selectOne = createComponent();
+ requestMap.put("SkinBean", selectOne);
+ return selectOne;
}
- public void setComponent(UIComponent component) {
+ public void setSkinComponent(UIComponent component) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Map requestMap = facesContext.getExternalContext().getRequestMap();
requestMap.put("SkinBean", component);
@@ -77,8 +75,4 @@
skin = (String) selectOne.getValue();
return null;
}
-
- public void setSkinComponent(UIComponent skinComponent) {
- this.skinComponent = skinComponent;
- }
}
Copied: trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/tTree (from rev 13519, trunk/test-applications/seamApp/web/src/main/resources/tTree)
Added: trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/util/data/cars.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/util/data/cars.xml (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/helloworld/domain/util/data/cars.xml 2009-04-17 11:44:55 UTC (rev 13628)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shop>
+ <car>
+ <make>Audi</make>
+ <model>A6</model>
+ <price>40000</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q7</model>
+ <price>48500</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q5</model>
+ <price>36500</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q8</model>
+ <price>102500</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>760Li</model>
+ <price>115400</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>330i</model>
+ <price>38400</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>X6</model>
+ <price>55900</price>
+ </car>
+ <car>
+ <make>Bentley</make>
+ <model>Arnage</model>
+ <price>240000</price>
+ </car>
+ <car>
+ <make>Bugatti</make>
+ <model>Veyron</model>
+ <price>1340000</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>S63 AMG</model>
+ <price>154200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>SLR</model>
+ <price>854200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>E63AMG</model>
+ <price>120200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>R350</model>
+ <price>61200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>E300D</model>
+ <price>9800</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>3</model>
+ <price>17300</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>6</model>
+ <price>21300</price>
+ </car>
+ <car>
+ <make>Mazda</make>
+ <model>CX7</model>
+ <price>24300</price>
+ </car>
+ <car>
+ <make>Fiat</make>
+ <model>Punto</model>
+ <price>8200</price>
+ </car>
+ <car>
+ <make>Fiat</make>
+ <model>Multipla</model>
+ <price>9100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>GT-40</model>
+ <price>325100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Mondeo</model>
+ <price>23100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Fiesta</model>
+ <price>5100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Scorpio</model>
+ <price>4800</price>
+ </car>
+ <car>
+ <make>Ferrari</make>
+ <model>Enzo</model>
+ <price>950000</price>
+ </car>
+ <car>
+ <make>Jaguar</make>
+ <model>XJ</model>
+ <price>75400</price>
+ </car>
+</shop>
\ No newline at end of file
Modified: trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/faces-config.xml 2009-04-17 11:20:24 UTC (rev 13627)
+++ trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/faces-config.xml 2009-04-17 11:44:55 UTC (rev 13628)
@@ -38,20 +38,6 @@
org.richfaces.helloworld.domain.message.MessageValidator
</validator-class>
</validator>
- <managed-bean>
- <managed-bean-name>skinBean</managed-bean-name>
- <managed-bean-class>
- org.richfaces.helloworld.domain.util.skins.Skins
- </managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>skinning</managed-bean-name>
- <managed-bean-class>
- org.richfaces.helloworld.domain.skinning.Skinning
- </managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<locale-config>
Modified: trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/web.xml 2009-04-17 11:20:24 UTC (rev 13627)
+++ trunk/test-applications/seamApp/web/src/main/webapp/WEB-INF/web.xml 2009-04-17 11:44:55 UTC (rev 13628)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
- <!-- Ajax4jsf -->
+ <!-- Ajax4jsf
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
@@ -15,11 +15,26 @@
<filter-name>ajax4jsf</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
-
+ -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
- <param-value>blueSky</param-value>
- </context-param>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
+ <param-value>#{skinning.skinningClass}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING</param-name>
+ <param-value>#{skinning.skinning}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_LEVEL</param-name>
+ <param-value>extended</param-value>
+ </context-param>
<!-- Seam -->
17 years
JBoss Rich Faces SVN: r13627 - trunk/test-applications/richfaces-docs/web.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-04-17 07:20:24 -0400 (Fri, 17 Apr 2009)
New Revision: 13627
Modified:
trunk/test-applications/richfaces-docs/web/pom.xml
Log:
added dependencies
Modified: trunk/test-applications/richfaces-docs/web/pom.xml
===================================================================
--- trunk/test-applications/richfaces-docs/web/pom.xml 2009-04-17 11:09:02 UTC (rev 13626)
+++ trunk/test-applications/richfaces-docs/web/pom.xml 2009-04-17 11:20:24 UTC (rev 13627)
@@ -44,25 +44,14 @@
<dependency>
+
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.3.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- </dependency>
-
-
-
+
</dependencies>
<build>
<plugins>
17 years
JBoss Rich Faces SVN: r13626 - trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-04-17 07:09:02 -0400 (Fri, 17 Apr 2009)
New Revision: 13626
Modified:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
Log:
Unused imports have been removed.
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java 2009-04-17 11:04:11 UTC (rev 13625)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java 2009-04-17 11:09:02 UTC (rev 13626)
@@ -1,9 +1,5 @@
package org.richfaces.convert.seamtext.tags;
-import sun.security.action.GetBooleanAction;
-
-import com.sun.java_cup.internal.production;
-
class UnorderedListTag extends HtmlTag {
private static final long serialVersionUID = 1L;
17 years
JBoss Rich Faces SVN: r13625 - in trunk/test-applications/facelets/src/main: java/rich and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-17 07:04:11 -0400 (Fri, 17 Apr 2009)
New Revision: 13625
Added:
trunk/test-applications/facelets/src/main/java/treeSwing/
trunk/test-applications/facelets/src/main/java/treeSwing/TreeSwing.java
trunk/test-applications/facelets/src/main/webapp/TreeAll/
trunk/test-applications/facelets/src/main/webapp/TreeSwing/
trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwing.xhtml
trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml
Removed:
trunk/test-applications/facelets/src/main/webapp/tTree/
Modified:
trunk/test-applications/facelets/src/main/java/rich/RichBean.java
trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
Log:
1) Rename tTree pages to TreeAll pages
2) + TreeSwing pages with default example of tree with javax.swing.tree.MutableTreeNode
Modified: trunk/test-applications/facelets/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2009-04-17 10:51:59 UTC (rev 13624)
+++ trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2009-04-17 11:04:11 UTC (rev 13625)
@@ -76,7 +76,8 @@
map.add("ExtendedDataTable", add("/ExtendedDataTable/ExtendedDataTable", new boolean [] {false, true, false}));
map.add("Editor", add("/Editor/Editor", new boolean [] {true, true, false}));
map.add("Queue", add("/Queue/Queue", new boolean [] {false, true, true}));
- map.add("tTree", add("/tTree/tTree", new boolean [] {true, true, true}));
+ map.add("TreeAll", add("/TreeAll/tTree", new boolean [] {true, true, true}));
+ map.add("TreeSwing", add("/TreeSwing/TreeSwing", new boolean [] {true, true, false}));
map.add("ColorPicker", add("/ColorPicker/ColorPicker", new boolean [] {false, true, false}));
map.add("LayoutComponents", add("/LayoutComponents/LayoutComponents", new boolean [] {true, true, true}));
Iterator<String> iterator = map.getSet().iterator();
Added: trunk/test-applications/facelets/src/main/java/treeSwing/TreeSwing.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/treeSwing/TreeSwing.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/treeSwing/TreeSwing.java 2009-04-17 11:04:11 UTC (rev 13625)
@@ -0,0 +1,155 @@
+package treeSwing;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.component.UITree;
+import org.richfaces.event.NodeSelectedEvent;
+
+import util.componentInfo.ComponentInfo;
+
+public class TreeSwing {
+
+ MutableTreeNode top;
+
+ UITree tree;
+
+ private String switchType = "ajax";
+
+ private boolean rendered = true;
+
+ private boolean showConnectingLines = false;
+
+ private boolean useCustomIcons = false;
+
+ private boolean disableKeyboardNavigation = false;
+
+ public TreeSwing() {
+ top = new DefaultMutableTreeNode("The Java Series");
+ createNodes(top);
+ }
+
+ public void selectionListener(NodeSelectedEvent e) {
+ UITree uiTree = (UITree) e.getComponent();
+ Object rowKey = uiTree.getRowKey();
+ MutableTreeNode node = (MutableTreeNode) uiTree.getRowData();
+ if (node.isLeaf()) {
+ uiTree.removeNode(rowKey);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ try {
+ ac.addComponentToAjaxRender(uiTree);
+ } catch (Exception exc) {
+ System.err.print(exc.getMessage());
+ }
+ }
+
+ private void createNodes(MutableTreeNode top) {
+ MutableTreeNode category = null;
+ MutableTreeNode book = null;
+
+ category = new DefaultMutableTreeNode("Books for Java Programmers");
+ top.insert(category, 0);
+
+ // original Tutorial
+ book = new DefaultMutableTreeNode(
+ "The Java Tutorial: A Short Course on the Basics");
+ category.insert(book, 0);
+
+ // Tutorial Continued
+ book = new DefaultMutableTreeNode(
+ "The Java Tutorial Continued: The Rest of the JDK");
+ category.insert(book, 1);
+
+ // JFC Swing Tutorial
+ book = new DefaultMutableTreeNode(
+ "The JFC Swing Tutorial: A Guide to Constructing GUIs");
+ category.insert(book, 2);
+
+ // ...add more books for programmers...
+ category = new DefaultMutableTreeNode("Books for Java Implementers");
+ top.insert(category, 1);
+
+ // VM
+ book = new DefaultMutableTreeNode(
+ "The Java Virtual Machine Specification");
+ category.insert(book, 0);
+
+ // Language Spec
+ book = new DefaultMutableTreeNode("The Java Language Specification");
+ category.insert(book, 1);
+ }
+
+ 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 MutableTreeNode getTop() {
+ return top;
+ }
+
+ public UITree getTree() {
+ return tree;
+ }
+
+ public void setTree(UITree tree) {
+ this.tree = tree;
+ }
+
+ public String getSwitchType() {
+ return switchType;
+ }
+
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
+ }
+
+ 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 isUseCustomIcons() {
+ return useCustomIcons;
+ }
+
+ public void setUseCustomIcons(boolean useCustomIcons) {
+ this.useCustomIcons = useCustomIcons;
+ }
+
+ public boolean isDisableKeyboardNavigation() {
+ return disableKeyboardNavigation;
+ }
+
+ public void setDisableKeyboardNavigation(boolean disableKeyboardNavigation) {
+ this.disableKeyboardNavigation = disableKeyboardNavigation;
+ }
+}
\ No newline at end of file
Copied: trunk/test-applications/facelets/src/main/webapp/TreeAll (from rev 13519, trunk/test-applications/facelets/src/main/webapp/tTree)
Added: trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwing.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwing.xhtml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwing.xhtml 2009-04-17 11:04:11 UTC (rev 13625)
@@ -0,0 +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="treeSwingSubviewID">
+
+ <h3>Click tree node to delete it. Only leaf node could be deleted.</h3>
+ <rich:tree id="tree" switchType="#{treeSwing.switchType}"
+ value="#{treeSwing.top}" var="data"
+ showConnectingLines="#{treeSwing.showConnectingLines}"
+ nodeSelectListener="#{treeSwing.selectionListener}"
+ rendered="#{treeSwing.rendered}" binding="#{treeSwing.tree}"
+ ajaxSubmitSelection="true"
+ 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}" rowKeyVar="row"
+ onselected="return confirm('Do you want to delete the row you select?');"
+ oncontextmenu="#{event.oncontextmenu}"
+ disableKeyboardNavigation="#{treeSwing.disableKeyboardNavigation}">
+ </rich:tree>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/TreeSwing/TreeSwingProperty.xhtml 2009-04-17 11:04:11 UTC (rev 13625)
@@ -0,0 +1,39 @@
+<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="treeSwingPropertySubviewID">
+
+ <h:commandButton id="focusID" action="#{treeSwing.add}"
+ value="add test" />
+ <h:panelGrid columns="2">
+ <f:facet name="header">
+ <h:outputText value="Tree Properties" />
+ </f:facet>
+
+ <h:outputText value="Change tree switchType:" />
+ <h:selectOneRadio value="#{treeSwing.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="rendered:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.rendered}"
+ onchange="submit();" />
+
+ <h:outputText value="disableKeyboardNavigation:" />
+ <h:selectBooleanCheckbox
+ value="#{treeSwing.disableKeyboardNavigation}" onchange="submit();" />
+
+ <h:outputText value="showConnectingLines:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.showConnectingLines}"
+ onchange="submit();" />
+
+ <h:outputText value="use custom icons:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.useCustomIcons}">
+ <a4j:support action="#{treeSwing.addCustomIcons}" event="onchange"
+ reRender="tree"></a4j:support>
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml 2009-04-17 11:04:11 UTC (rev 13625)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>treeSwing</managed-bean-name>
+ <managed-bean-class>treeSwing.TreeSwing</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2009-04-17 10:51:59 UTC (rev 13624)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2009-04-17 11:04:11 UTC (rev 13625)
@@ -47,7 +47,7 @@
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
- /WEB-INF/faces-config-LayoutComponents.xml,/WEB-INF/faces-config-ColorPicker.xml,/WEB-INF/faces-config-tTree.xml,/WEB-INF/faces-config-Queue.xml,/WEB-INF/faces-config-Editor.xml,/WEB-INF/faces-config-ExtendedDataTable.xml,/WEB-INF/faces-config-DataGrid.xml,/WEB-INF/faces-config-Validator.xml,/WEB-INF/faces-config-ComponentInfo.xml,/WEB-INF/faces-config-HotKey.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-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,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Even!
t.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Opti
ons.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml
+ /WEB-INF/faces-config-TreeSwing.xml,/WEB-INF/faces-config-LayoutComponents.xml,/WEB-INF/faces-config-ColorPicker.xml,/WEB-INF/faces-config-tTree.xml,/WEB-INF/faces-config-Queue.xml,/WEB-INF/faces-config-Editor.xml,/WEB-INF/faces-config-ExtendedDataTable.xml,/WEB-INF/faces-config-DataGrid.xml,/WEB-INF/faces-config-Validator.xml,/WEB-INF/faces-config-ComponentInfo.xml,/WEB-INF/faces-config-HotKey.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-IN!
F/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-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,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComp!
onent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-Progre
ssBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml
</param-value>
</context-param>
<context-param>
@@ -55,6 +55,10 @@
<param-value>true</param-value>
</context-param>
<context-param>
+ <param-name>org.richfaces.LoadScriptStrategy</param-name>
+ <param-value>DEFAULT</param-value>
+ </context-param>
+ <context-param>
<param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
<param-value>NONE</param-value>
</context-param>
17 years
JBoss Rich Faces SVN: r13624 - trunk/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-17 06:51:59 -0400 (Fri, 17 Apr 2009)
New Revision: 13624
Modified:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
+ faces-config-TreeSwing to web.xml
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2009-04-17 10:49:40 UTC (rev 13623)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2009-04-17 10:51:59 UTC (rev 13624)
@@ -196,7 +196,7 @@
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
- /WEB-INF/faces-config-LayoutComponents.xml,/WEB-INF/faces-config-ColorPicker.xml,/WEB-INF/faces-config-tTree.xml,/WEB-INF/faces-config-Queue.xml,/WEB-INF/faces-config-Editor.xml,/WEB-INF/faces-config-ExtendedDataTable.xml,/WEB-INF/faces-config-DataGrid.xml,/WEB-INF/faces-config-Validator.xml,/WEB-INF/faces-config-ComponentInfo.xml,/WEB-INF/faces-config-HotKey.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-RichTest.xml,/WEB-INF/faces-config-ScrollableDataTable.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,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTCompo!
nent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-Progres
sBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml
+ /WEB-INF/faces-config-TreeSwing.xml,/WEB-INF/faces-config-LayoutComponents.xml,/WEB-INF/faces-config-ColorPicker.xml,/WEB-INF/faces-config-tTree.xml,/WEB-INF/faces-config-Queue.xml,/WEB-INF/faces-config-Editor.xml,/WEB-INF/faces-config-ExtendedDataTable.xml,/WEB-INF/faces-config-DataGrid.xml,/WEB-INF/faces-config-Validator.xml,/WEB-INF/faces-config-ComponentInfo.xml,/WEB-INF/faces-config-HotKey.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-IN!
F/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-RichTest.xml,/WEB-INF/faces-config-ScrollableDataTable.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,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combob!
ox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Eve
nt.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml
</param-value>
</context-param>
17 years
JBoss Rich Faces SVN: r13623 - in trunk/test-applications/jsp/src/main: java/rich and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-17 06:49:40 -0400 (Fri, 17 Apr 2009)
New Revision: 13623
Added:
trunk/test-applications/jsp/src/main/java/treeSwing/
trunk/test-applications/jsp/src/main/java/treeSwing/TreeSwing.java
trunk/test-applications/jsp/src/main/webapp/TreeAll/
trunk/test-applications/jsp/src/main/webapp/TreeSwing/
trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwing.jsp
trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwingProperty.jsp
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml
Removed:
trunk/test-applications/jsp/src/main/webapp/tTree/
Modified:
trunk/test-applications/jsp/src/main/java/rich/RichBean.java
trunk/test-applications/jsp/src/main/webapp/TreeAll/tTree.jsp
trunk/test-applications/jsp/src/main/webapp/TreeAll/tTreeStraightforward.jsp
Log:
1) + TreeSwing pages - default example of tree with javax.swing.tree.MutableTreeNode
2) Rename tTree to TreeAll
Modified: trunk/test-applications/jsp/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/rich/RichBean.java 2009-04-17 01:11:45 UTC (rev 13622)
+++ trunk/test-applications/jsp/src/main/java/rich/RichBean.java 2009-04-17 10:49:40 UTC (rev 13623)
@@ -75,7 +75,8 @@
map.add("DataGrid", add("/DataGrid/DataGrid", new boolean [] {false, true, false}));
map.add("ExtendedDataTable", add("/ExtendedDataTable/ExtendedDataTable", new boolean [] {false, true, false}));
map.add("Editor", add("/Editor/Editor", new boolean [] {true, true, false}));
- map.add("tTree", add("/tTree/tTree", new boolean [] {true, true, true}));
+ map.add("TreeAll", add("/TreeAll/tTree", new boolean [] {true, true, true}));
+ map.add("TreeSwing", add("/TreeSwing/TreeSwing", new boolean [] {true, true, false}));
map.add("Queue", add("/Queue/Queue", new boolean [] {false, true, true}));
map.add("LayoutComponents", add("/LayoutComponents/LayoutComponents", new boolean [] {true, true, true}));
Iterator<String> iterator = map.getSet().iterator();
Added: trunk/test-applications/jsp/src/main/java/treeSwing/TreeSwing.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/treeSwing/TreeSwing.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/treeSwing/TreeSwing.java 2009-04-17 10:49:40 UTC (rev 13623)
@@ -0,0 +1,155 @@
+package treeSwing;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.richfaces.component.UITree;
+import org.richfaces.event.NodeSelectedEvent;
+
+import util.componentInfo.ComponentInfo;
+
+public class TreeSwing {
+
+ MutableTreeNode top;
+
+ UITree tree;
+
+ private String switchType = "ajax";
+
+ private boolean rendered = true;
+
+ private boolean showConnectingLines = false;
+
+ private boolean useCustomIcons = false;
+
+ private boolean disableKeyboardNavigation = false;
+
+ public TreeSwing() {
+ top = new DefaultMutableTreeNode("The Java Series");
+ createNodes(top);
+ }
+
+ public void selectionListener(NodeSelectedEvent e) {
+ UITree uiTree = (UITree) e.getComponent();
+ Object rowKey = uiTree.getRowKey();
+ MutableTreeNode node = (MutableTreeNode) uiTree.getRowData();
+ if (node.isLeaf()) {
+ uiTree.removeNode(rowKey);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ try {
+ ac.addComponentToAjaxRender(uiTree);
+ } catch (Exception exc) {
+ System.err.print(exc.getMessage());
+ }
+ }
+
+ private void createNodes(MutableTreeNode top) {
+ MutableTreeNode category = null;
+ MutableTreeNode book = null;
+
+ category = new DefaultMutableTreeNode("Books for Java Programmers");
+ top.insert(category, 0);
+
+ // original Tutorial
+ book = new DefaultMutableTreeNode(
+ "The Java Tutorial: A Short Course on the Basics");
+ category.insert(book, 0);
+
+ // Tutorial Continued
+ book = new DefaultMutableTreeNode(
+ "The Java Tutorial Continued: The Rest of the JDK");
+ category.insert(book, 1);
+
+ // JFC Swing Tutorial
+ book = new DefaultMutableTreeNode(
+ "The JFC Swing Tutorial: A Guide to Constructing GUIs");
+ category.insert(book, 2);
+
+ // ...add more books for programmers...
+ category = new DefaultMutableTreeNode("Books for Java Implementers");
+ top.insert(category, 1);
+
+ // VM
+ book = new DefaultMutableTreeNode(
+ "The Java Virtual Machine Specification");
+ category.insert(book, 0);
+
+ // Language Spec
+ book = new DefaultMutableTreeNode("The Java Language Specification");
+ category.insert(book, 1);
+ }
+
+ 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 MutableTreeNode getTop() {
+ return top;
+ }
+
+ public UITree getTree() {
+ return tree;
+ }
+
+ public void setTree(UITree tree) {
+ this.tree = tree;
+ }
+
+ public String getSwitchType() {
+ return switchType;
+ }
+
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
+ }
+
+ 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 isUseCustomIcons() {
+ return useCustomIcons;
+ }
+
+ public void setUseCustomIcons(boolean useCustomIcons) {
+ this.useCustomIcons = useCustomIcons;
+ }
+
+ public boolean isDisableKeyboardNavigation() {
+ return disableKeyboardNavigation;
+ }
+
+ public void setDisableKeyboardNavigation(boolean disableKeyboardNavigation) {
+ this.disableKeyboardNavigation = disableKeyboardNavigation;
+ }
+}
\ No newline at end of file
Copied: trunk/test-applications/jsp/src/main/webapp/TreeAll (from rev 13519, trunk/test-applications/jsp/src/main/webapp/tTree)
Modified: trunk/test-applications/jsp/src/main/webapp/TreeAll/tTree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2009-04-13 10:26:15 UTC (rev 13519)
+++ trunk/test-applications/jsp/src/main/webapp/TreeAll/tTree.jsp 2009-04-17 10:49:40 UTC (rev 13623)
@@ -55,7 +55,7 @@
onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
- onselected="#{event.onselected}"
+ onselected="#{event.onselected}" oncontextmenu="#{event.oncontextmenu}"
disableKeyboardNavigation="#{tTree.disableKeyboardNavigation}">
<rich:treeNode type="input">
Modified: trunk/test-applications/jsp/src/main/webapp/TreeAll/tTreeStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp 2009-04-13 10:26:15 UTC (rev 13519)
+++ trunk/test-applications/jsp/src/main/webapp/TreeAll/tTreeStraightforward.jsp 2009-04-17 10:49:40 UTC (rev 13623)
@@ -46,7 +46,7 @@
<rich:separator height="10" />
</h:panelGrid>
</a4j:outputPanel>
-
+
<a4j:outputPanel id="tTreeDNDPanelID">
<h:panelGrid columns="1"
rendered="#{pVisability.tTreeDefaultSubviewID}">
@@ -79,7 +79,7 @@
dropListener="#{tTreeDND.onDrop}"
dragListener="#{tTreeDND.onDrag}" dragIndicator="treeIndicator"
acceptedTypes="treeNodeR" dragType="treeNodeL" rowKeyVar="key"
- var="item">
+ var="item" showConnectingLines="false">
<rich:dndParam name="treeParam" value="leftTree" />
</rich:tree>
Added: trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwing.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwing.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwing.jsp 2009-04-17 10:49:40 UTC (rev 13623)
@@ -0,0 +1,29 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="treeSwingSubviewID">
+ <h3>Click tree node to delete it. Only leaf node could be deleted. </h3>
+ <rich:tree id="tree" switchType="#{treeSwing.switchType}"
+ value="#{treeSwing.top}" var="data"
+ showConnectingLines="#{treeSwing.showConnectingLines}"
+ nodeSelectListener="#{treeSwing.selectionListener}"
+ rendered="#{treeSwing.rendered}" binding="#{treeSwing.tree}"
+ ajaxSubmitSelection="true"
+ 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}" rowKeyVar="row"
+ onselected="return confirm('Do you want to delete the row you select?');"
+ oncontextmenu="#{event.oncontextmenu}"
+ disableKeyboardNavigation="#{treeSwing.disableKeyboardNavigation}">
+ </rich:tree>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwingProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwingProperty.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/TreeSwing/TreeSwingProperty.jsp 2009-04-17 10:49:40 UTC (rev 13623)
@@ -0,0 +1,38 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="treeSwingPropertySubviewID">
+
+ <h:commandButton id="focusID" action="#{treeSwing.add}" value="add test" />
+ <h:panelGrid columns="2">
+ <f:facet name="header">
+ <h:outputText value="Tree Properties" />
+ </f:facet>
+
+ <h:outputText value="Change tree switchType:" />
+ <h:selectOneRadio value="#{treeSwing.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="rendered:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.rendered}"
+ onchange="submit();" />
+
+ <h:outputText value="disableKeyboardNavigation:" />
+ <h:selectBooleanCheckbox
+ value="#{treeSwing.disableKeyboardNavigation}" onchange="submit();" />
+
+ <h:outputText value="showConnectingLines:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.showConnectingLines}"
+ onchange="submit();" />
+
+ <h:outputText value="use custom icons:" />
+ <h:selectBooleanCheckbox value="#{treeSwing.useCustomIcons}">
+ <a4j:support action="#{treeSwing.addCustomIcons}" event="onchange"
+ reRender="tree"></a4j:support>
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-TreeSwing.xml 2009-04-17 10:49:40 UTC (rev 13623)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>treeSwing</managed-bean-name>
+ <managed-bean-class>treeSwing.TreeSwing</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
17 years