JBoss Rich Faces SVN: r11583 - trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-05 10:26:04 -0500 (Fri, 05 Dec 2008)
New Revision: 11583
Modified:
trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
Log:
https://jira.jboss.org/jira/browse/RF-5077
Modified: trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
--- trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-12-05 15:16:35 UTC (rev 11582)
+++ trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-12-05 15:26:04 UTC (rev 11583)
@@ -21,6 +21,7 @@
Richfaces.Editor.extCssSuffix = params.extCssSuffix;
this.synchronizeConfiguration();
+ this.setDialogType();
this.tinyMCE_editor = null;
this.onInitInstanceCallbackFunction = this.tinyparams.init_instance_callback;
@@ -52,6 +53,10 @@
this.tinyMCE_editor.remove();
}
this.onInitInstanceCallbackFunction = null;
+ this.onInitCallbackFunction = null;
+ this.onChangeCallbackFunction = null;
+ this.onSaveCallbackFunction = null;
+ this.onSetupCallbackFunction = null;
this.tinyMCE_editor = null;
},
@@ -84,7 +89,7 @@
this.invokeEvent("Setup", $A(arguments));
},
- synchronizeConfiguration: function(){
+ synchronizeConfiguration: function(){
if(this.params.useSeamText){
this.tinyparams.plugins = Richfaces.Editor.SeamTextConfiguration.plugins;
this.tinyparams.convert_fonts_to_spans = false;
@@ -121,6 +126,43 @@
LOG.warn("Exception: " + e.Message + "\n[on " + eventName + " ]");
}
return result;
+ },
+
+ setDialogType: function(){
+ var plugins = this.tinyparams.plugins;
+ if(this.tinyparams.dialog_type && this.tinyparams.dialog_type == 'modal'){
+ if(plugins && plugins.length > 0){
+ if(plugins.indexOf('inlinepopups') == -1){
+ plugins += ',inlinepopups';
+ }
+ }else{
+ plugins = 'inlinepopups';
+ }
+ }else if(this.tinyparams.dialog_type && this.tinyparams.dialog_type == 'window'){
+ if(plugins && plugins.length > 0 && plugins.indexOf('inlinepopups') != -1){
+ if(plugins.indexOf('inlinepopups') != -1){
+ var wordIndex = plugins.indexOf('inlinepopups');
+ var firstCommaIndex = -1;
+ var secondCommaIndex = -1;
+ if(wordIndex > 0){
+ firstCommaIndex = plugins.lastIndexOf(',', wordIndex);
+ }
+ if(wordIndex < plugins.length - 1){
+ secondCommaIndex = plugins.indexOf(',', wordIndex);
+ }
+
+ if(firstCommaIndex != -1 && secondCommaIndex != -1){
+ plugins = plugins.replace(plugins.substring(firstCommaIndex, secondCommaIndex + 1), ",");
+ }else if(firstCommaIndex != -1){
+ plugins = plugins.replace(plugins.substring(firstCommaIndex, wordIndex + 'inlinepopups'.length), "");
+ }else if(secondCommaIndex != -1){
+ plugins = plugins.replace(plugins.substring(wordIndex, secondCommaIndex + 1), "");
+ }
+
+ }
+ }
+ }
+ this.tinyparams.plugins = plugins;
}
});
16 years, 1 month
JBoss Rich Faces SVN: r11582 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-05 10:16:35 -0500 (Fri, 05 Dec 2008)
New Revision: 11582
Added:
trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGreeterApp.png
Log:
Copied: trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGreeterApp.png (from rev 11575, trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGtreeterApp.png)
===================================================================
(Binary files differ)
16 years, 1 month
JBoss Rich Faces SVN: r11581 - trunk/framework/impl/src/main/java/org/ajax4jsf/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-05 09:44:35 -0500 (Fri, 05 Dec 2008)
New Revision: 11581
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
Log:
https://jira.jboss.org/jira/browse/RF-4513
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-05 14:42:01 UTC (rev 11580)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-05 14:44:35 UTC (rev 11581)
@@ -44,8 +44,6 @@
import java.io.PushbackInputStream;
-
-
public class JSMin {
private static final int EOF = -1;
@@ -60,7 +58,7 @@
private int column;
public JSMin(InputStream in, OutputStream out) {
- this.in = new PushbackInputStream(in);
+ this.in = new PushbackInputStream(in,2);
this.out = out;
this.line = 0;
this.column = 0;
@@ -117,6 +115,10 @@
in.unread(lookaheadChar);
return lookaheadChar;
}
+
+ void back(int c) throws IOException {
+ in.unread(c);
+ }
/**
* next -- get the next character, excluding comments. peek() is used to see
@@ -133,20 +135,25 @@
return c;
}
}
-
case '*':
get();
- for (;;) {
- switch (get()) {
- case '*':
- if (peek() == '/') {
- get();
- return ' ';
+ if (peek()=='@') {
+ // TODO: add spaces skipping
+ back('*');
+ return c;
+ } else {
+ for (;;) {
+ switch (get()) {
+ case '*':
+ if (peek() == '/') {
+ get();
+ return ' ';
+ }
+ break;
+ case EOF:
+ throw new UnterminatedCommentException(line,column);
}
- break;
- case EOF:
- throw new UnterminatedCommentException(line,column);
- }
+ }
}
default:
16 years, 1 month
JBoss Rich Faces SVN: r11580 - trunk/test-applications/seamApp/web/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-05 09:42:01 -0500 (Fri, 05 Dec 2008)
New Revision: 11580
Modified:
trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml
Log:
Modified: trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-05 14:40:43 UTC (rev 11579)
+++ trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-05 14:42:01 UTC (rev 11580)
@@ -3,17 +3,7 @@
<rich:dataTable id="dataTableId" value="#{dataScroller.dataTable}" sortMode="#{dataScroller.sortMode}"
var="dT" cellpadding="5px" rows="5" border="1" reRender="dsID">
<f:facet name="header">
- </f:facet>
- <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}" filterEvent="onchange"
- selfSorted="#{dataScroller.selfSorted}" sortOrder="#{dataScroller.sortOrder}" filterValue="#{dataScroller.filterValue}">
- <h:outputText value="#{dT.str0}" />
- </rich:column>
- <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}" filterEvent="onchange"
- sortOrder="#{dataScroller.sortOrder}">
- <h:outputText value="#{dT.int0} " />
- </rich:column>
- </rich:dataTable>
- <rich:datascroller for="dataTableId" inactiveStyle="#{style.inactiveStyle}" inactiveStyleClass="#{style.inactiveStyleClass}"
+ <rich:datascroller inactiveStyle="#{style.inactiveStyle}" inactiveStyleClass="#{style.inactiveStyleClass}"
selectedStyle="#{style.selectedStyle}" selectedStyleClass="#{style.selectedStyleClass}" style="#{style.style}"
styleClass="#{style.styleClass}" tableStyle="#{style.tableStyle}" tableStyleClass="#{style.tableStyleClass}"
fastControls="#{dataScroller.fastControls}" action="#{dataScroller.act}" actionListener="#{dataScroller.actListener}"
@@ -30,6 +20,16 @@
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" id="dsID"
binding="#{dataScroller.htmlDatascroller}" reRender="dataTableId">
</rich:datascroller>
+ </f:facet>
+ <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}" filterEvent="onchange"
+ selfSorted="#{dataScroller.selfSorted}" sortOrder="#{dataScroller.sortOrder}" filterValue="#{dataScroller.filterValue}">
+ <h:outputText value="#{dT.str0}" />
+ </rich:column>
+ <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}" filterEvent="onchange"
+ sortOrder="#{dataScroller.sortOrder}">
+ <h:outputText value="#{dT.int0} " />
+ </rich:column>
+ </rich:dataTable>
<h:panelGrid id="dataScrollerActionID" columns="1">
<a4j:commandButton value="Show action" reRender="dataScrollerActionID" style=" width : 95px;"></a4j:commandButton>
<h:outputText value="#{dataScroller.action}" />
16 years, 1 month
JBoss Rich Faces SVN: r11579 - trunk/test-applications/seamApp/web/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-05 09:40:43 -0500 (Fri, 05 Dec 2008)
New Revision: 11579
Modified:
trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml
Log:
correction
Modified: trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-05 14:36:18 UTC (rev 11578)
+++ trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-05 14:40:43 UTC (rev 11579)
@@ -3,7 +3,17 @@
<rich:dataTable id="dataTableId" value="#{dataScroller.dataTable}" sortMode="#{dataScroller.sortMode}"
var="dT" cellpadding="5px" rows="5" border="1" reRender="dsID">
<f:facet name="header">
- <rich:datascroller inactiveStyle="#{style.inactiveStyle}" inactiveStyleClass="#{style.inactiveStyleClass}"
+ </f:facet>
+ <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}" filterEvent="onchange"
+ selfSorted="#{dataScroller.selfSorted}" sortOrder="#{dataScroller.sortOrder}" filterValue="#{dataScroller.filterValue}">
+ <h:outputText value="#{dT.str0}" />
+ </rich:column>
+ <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}" filterEvent="onchange"
+ sortOrder="#{dataScroller.sortOrder}">
+ <h:outputText value="#{dT.int0} " />
+ </rich:column>
+ </rich:dataTable>
+ <rich:datascroller for="dataTableId" inactiveStyle="#{style.inactiveStyle}" inactiveStyleClass="#{style.inactiveStyleClass}"
selectedStyle="#{style.selectedStyle}" selectedStyleClass="#{style.selectedStyleClass}" style="#{style.style}"
styleClass="#{style.styleClass}" tableStyle="#{style.tableStyle}" tableStyleClass="#{style.tableStyleClass}"
fastControls="#{dataScroller.fastControls}" action="#{dataScroller.act}" actionListener="#{dataScroller.actListener}"
@@ -20,16 +30,6 @@
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" id="dsID"
binding="#{dataScroller.htmlDatascroller}" reRender="dataTableId">
</rich:datascroller>
- </f:facet>
- <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}" filterEvent="onchange"
- selfSorted="#{dataScroller.selfSorted}" sortOrder="#{dataScroller.sortOrder}" filterValue="#{dataScroller.filterValue}">
- <h:outputText value="#{dT.str0}" />
- </rich:column>
- <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}" filterEvent="onchange"
- sortOrder="#{dataScroller.sortOrder}">
- <h:outputText value="#{dT.int0} " />
- </rich:column>
- </rich:dataTable>
<h:panelGrid id="dataScrollerActionID" columns="1">
<a4j:commandButton value="Show action" reRender="dataScrollerActionID" style=" width : 95px;"></a4j:commandButton>
<h:outputText value="#{dataScroller.action}" />
16 years, 1 month
JBoss Rich Faces SVN: r11578 - trunk/test-applications/seamApp/web/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-05 09:36:18 -0500 (Fri, 05 Dec 2008)
New Revision: 11578
Modified:
trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScrollerProperty.xhtml
Log:
correction
Modified: trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-05 14:29:14 UTC (rev 11577)
+++ trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-05 14:36:18 UTC (rev 11578)
@@ -18,16 +18,16 @@
onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" id="dsID"
- binding="#{dataScroller.htmlDatascroller}">
+ binding="#{dataScroller.htmlDatascroller}" reRender="dataTableId">
</rich:datascroller>
</f:facet>
- <rich:column sortBy="#{dT.data0}" filterBy="#{dT.data0}" filterEvent="onchange"
+ <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}" filterEvent="onchange"
selfSorted="#{dataScroller.selfSorted}" sortOrder="#{dataScroller.sortOrder}" filterValue="#{dataScroller.filterValue}">
- <h:outputText value="#{dT.data0}" />
+ <h:outputText value="#{dT.str0}" />
</rich:column>
- <rich:column sortBy="#{dT.data1}" filterBy="#{dT.data1}" filterEvent="onchange"
+ <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}" filterEvent="onchange"
sortOrder="#{dataScroller.sortOrder}">
- <h:outputText value="#{dT.data1} " />
+ <h:outputText value="#{dT.int0} " />
</rich:column>
</rich:dataTable>
<h:panelGrid id="dataScrollerActionID" columns="1">
Modified: trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScrollerProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScrollerProperty.xhtml 2008-12-05 14:29:14 UTC (rev 11577)
+++ trunk/test-applications/seamApp/web/src/main/webapp/DataScroller/DataScrollerProperty.xhtml 2008-12-05 14:36:18 UTC (rev 11578)
@@ -62,16 +62,5 @@
<h:selectBooleanCheckbox value="#{dataScroller.selfSorted}">
<a4j:support event="onchange" reRender="dataTableId,dsID"></a4j:support>
</h:selectBooleanCheckbox>
- </h:panelGrid>
- <br />
- <br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <rich:column>
- <a4j:commandLink value="getPage" reRender="findID"></a4j:commandLink>
- </rich:column>
- <rich:column>
- <h:outputText id="findID" value="#{rich:findComponent('dsID').page}" />
- </rich:column>
- </h:panelGrid>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file
16 years, 1 month
JBoss Rich Faces SVN: r11577 - trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-05 09:29:14 -0500 (Fri, 05 Dec 2008)
New Revision: 11577
Modified:
trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
Log:
https://jira.jboss.org/jira/browse/RF-5195
Modified: trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
--- trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-12-05 13:44:20 UTC (rev 11576)
+++ trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-12-05 14:29:14 UTC (rev 11577)
@@ -65,23 +65,23 @@
},
onChangeCallback: function(inst) {
- this.invokeEvent(this.onChangeCallbackFunction, $A(arguments));
+ this.invokeEvent("Change", $A(arguments));
},
onInitCallback: function() {
- this.invokeEvent(this.onInitCallbackFunction, $A(arguments));
+ this.invokeEvent("Init", $A(arguments));
},
onSaveCallback: function(element_id, html, body) {
if(this.onSaveCallbackFunction){
- return this.invokeEvent(this.onSaveCallbackFunction, $A(arguments));
+ return this.invokeEvent("Save", $A(arguments));
}else{
return html;
}
},
onSetupCallback: function(ed) {
- this.invokeEvent(this.onSetupCallbackFunction, $A(arguments));
+ this.invokeEvent("Setup", $A(arguments));
},
synchronizeConfiguration: function(){
@@ -99,7 +99,8 @@
}
},
- invokeEvent: function(callback, args){
+ invokeEvent: function(eventName, args){
+ callback = this["on"+eventName+"CallbackFunction"];
if (!callback) return;
var eventObj;
var result;
@@ -108,7 +109,7 @@
eventObj = document.createEventObject();
} else if( document.createEvent ) {
eventObj = document.createEvent('Events');
- eventObj.initEvent( callback + 'Event', true, false );
+ eventObj.initEvent( eventName, true, false );
}
eventObj.rich = {component:this, tinyMceInstance: this.tinyMCE_editor};
@@ -117,7 +118,7 @@
try {
result = callback.apply(this, args);
} catch (e) {
- LOG.warn("Exception: " + e.Message + "\n[on " + callback + " ]");
+ LOG.warn("Exception: " + e.Message + "\n[on " + eventName + " ]");
}
return result;
}
16 years, 1 month
JBoss Rich Faces SVN: r11576 - in trunk/test-applications/facelets/src/main: java/rich and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-05 08:44:20 -0500 (Fri, 05 Dec 2008)
New Revision: 11576
Added:
trunk/test-applications/facelets/src/main/java/tTree/
trunk/test-applications/facelets/src/main/java/tTree/PVisability.java
trunk/test-applications/facelets/src/main/java/tTree/TTree.java
trunk/test-applications/facelets/src/main/java/tTree/TTreeDND.java
trunk/test-applications/facelets/src/main/java/tTree/TTreeNA.java
trunk/test-applications/facelets/src/main/java/tTree/TTreeRNA.java
trunk/test-applications/facelets/src/main/java/tTree/data/
trunk/test-applications/facelets/src/main/java/tTree/data/Dir.java
trunk/test-applications/facelets/src/main/java/tTree/data/Package.java
trunk/test-applications/facelets/src/main/java/tTree/data/Project.java
trunk/test-applications/facelets/src/main/java/tTree/pom_sample.xml
trunk/test-applications/facelets/src/main/java/tTree/test.xml
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-tTree.xml
trunk/test-applications/facelets/src/main/webapp/tTree/
trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml
trunk/test-applications/facelets/src/main/webapp/tTree/tTreeProperty.xhtml
trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml
Modified:
trunk/test-applications/facelets/src/main/java/rich/RichBean.java
trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
Log:
+ tTree
Modified: trunk/test-applications/facelets/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2008-12-05 13:24:11 UTC (rev 11575)
+++ trunk/test-applications/facelets/src/main/java/rich/RichBean.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -76,6 +76,7 @@
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}));
Iterator<String> iterator = map.getSet().iterator();
while(iterator.hasNext()){
list.add(new SelectItem(iterator.next()));
Added: trunk/test-applications/facelets/src/main/java/tTree/PVisability.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/PVisability.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/PVisability.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,48 @@
+package tTree;
+
+public class PVisability {
+ private boolean tTreeSubviewID;
+ private boolean tTreePropertySubviewID;
+ private boolean tTreeStraightforwardSubviewID;
+ private boolean tTreeDefaultSubviewID;
+
+ public PVisability() {
+ tTreeSubviewID = false;
+ tTreePropertySubviewID = false;
+ tTreeStraightforwardSubviewID = false;
+ tTreeDefaultSubviewID = true;
+ }
+
+ public boolean istTreeDefaultSubviewID() {
+ return tTreeDefaultSubviewID;
+ }
+
+ public void settTreeDefaultSubviewID(boolean treeDefaultSubviewID) {
+ tTreeDefaultSubviewID = treeDefaultSubviewID;
+ }
+
+ public boolean istTreeSubviewID() {
+ return tTreeSubviewID;
+ }
+
+ public void settTreeSubviewID(boolean treeSubviewID) {
+ tTreeSubviewID = treeSubviewID;
+ }
+
+ public boolean istTreePropertySubviewID() {
+ return tTreePropertySubviewID;
+ }
+
+ public void settTreePropertySubviewID(boolean treePropertySubviewID) {
+ tTreePropertySubviewID = treePropertySubviewID;
+ }
+
+ public boolean istTreeStraightforwardSubviewID() {
+ return tTreeStraightforwardSubviewID;
+ }
+
+ public void settTreeStraightforwardSubviewID(
+ boolean treeStraightforwardSubviewID) {
+ tTreeStraightforwardSubviewID = treeStraightforwardSubviewID;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/TTree.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/TTree.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/TTree.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,61 @@
+package tTree;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import org.richfaces.component.UITree;
+import org.richfaces.component.xml.XmlTreeDataBuilder;
+import org.richfaces.model.TreeNode;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class TTree {
+ private String switchType = "server";
+ private TreeNode data;
+ private UITree tree;
+
+ 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 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;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/TTreeDND.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/TTreeDND.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/TTreeDND.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,249 @@
+package tTree;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.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;
+
+public class TTreeDND {
+ private static final String DATA_PATH = "org/richfaces/simpleTreeData.properties";
+
+ private TreeNode<String> treeNodeLeft;
+ private UITree leftTree;
+ private String leftSelectedNodeTitle;
+ private String rightSelectedNodeTitle;
+ private TreeNode<String> treeNodeRight;
+ private UITree rightTree;
+
+ private void addNodes(String path, TreeNode<String> node,
+ Properties properties) {
+ boolean end = false;
+ int counter = 1;
+ while (!end) {
+ String key = path != null ? path + '.' + counter : String
+ .valueOf(counter);
+ String value = properties.getProperty(key);
+ if (value != null) {
+ TreeNodeImpl<String> nodeImpl = new TreeNodeImpl<String>();
+ nodeImpl.setData(value);
+ node.addChild(new Integer(counter), nodeImpl);
+ addNodes(key, nodeImpl, properties);
+ counter++;
+ } else {
+ end = true;
+ }
+ }
+ }
+
+ private TreeNode<String> initPaneTree() {
+ TreeNode<String> rootNode = null;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+
+ InputStream dataStream = this.getClass().getClassLoader()
+ .getResourceAsStream(DATA_PATH);
+
+ try {
+ Properties properties = new Properties();
+ properties.load(dataStream);
+ rootNode = new TreeNodeImpl<String>();
+ addNodes(null, rootNode, properties);
+ } catch (IOException e) {
+
+ throw new FacesException(e.getMessage(), e);
+
+ } finally {
+ if (dataStream != null) {
+ try {
+ dataStream.close();
+ } catch (IOException e) {
+ externalContext.log(e.getMessage(), e);
+ }
+ }
+ }
+ return rootNode;
+ }
+
+ private Object getNewId(TreeNode parentNode) {
+ Map<Object, TreeNode> childs = new HashMap<Object, TreeNode>();
+ Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
+ while (iter != null && iter.hasNext()) {
+ Map.Entry<Object, TreeNode> entry = iter.next();
+ childs.put(entry.getKey(), entry.getValue());
+ }
+
+ Integer index = 1;
+ while (childs.containsKey(index)) {
+ index++;
+ }
+ return index;
+ }
+
+ public void onDrop(DropEvent dropEvent) {
+ System.out.println("onDrop occured.");
+ System.out.println("DragValue: " + dropEvent.getDragValue());
+ System.out.println("DropValue: " + dropEvent.getDropValue());
+
+ // resolve drag source attributes
+ UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent
+ .getDraggableSource()
+ : null;
+ UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
+ TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent
+ .getDragValue()
+ : null;
+
+ // resolve drag destination attributes
+ UITreeNode destNode = (dropEvent.getSource() instanceof UITreeNode) ? (UITreeNode) dropEvent
+ .getSource()
+ : null;
+ UITree destTree = destNode != null ? destNode.getUITree()
+ : (UITree) dropEvent.getComponent();
+ TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent
+ .getDropValue()
+ : null;
+
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ if (dropNodeKey != null) {
+ // add destination node for rerender
+ destTree.addRequestKey(dropNodeKey);
+
+ Object state = null;
+ TreeNode draggedNode = null;
+ if (dragNodeKey != null) { // Drag from this or other tree
+ draggedNode = srcTree.getModelTreeNode(dragNodeKey);
+
+ TreeNode parentNode = draggedNode.getParent();
+ // 1. remove node from tree
+ state = srcTree.removeNode(dragNodeKey);
+ // 2. add parent for rerender
+ Object rowKey = srcTree.getTreeNodeRowKey(parentNode);
+ srcTree.addRequestKey(rowKey);
+ } else if (dropEvent.getDragValue() != null) { // Drag from some
+ // drag source
+ draggedNode = new TreeNodeImpl<String>();
+ draggedNode.setData(dropEvent.getDragValue().toString());
+ }
+
+ // generate new node id
+ Object id = getNewId(destTree.getTreeNode(dropNodeKey));
+ destTree.addNode(dropNodeKey, draggedNode, id, state);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ // Add destination tree to reRender
+ try {
+ ac.addComponentToAjaxRender(destTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ // Add source tree to reRender
+ try {
+ ac.addComponentToAjaxRender(srcTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ System.out.println("+++++");
+ }
+
+ public void onExpand(NodeExpandedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ System.out.println("Tree ('" + tree.getId() + "') node "
+ + (tree.isExpanded() ? "expanded" : "collapsed") + " "
+ + tree.getRowKey());
+ }
+
+ public void onDrag(DragEvent dragEvent) {
+ System.out.println("onDrag occured.");
+ System.out.println("DragValue: " + dragEvent.getDragValue());
+ System.out.println("DropValue: " + dragEvent.getDropValue());
+ }
+
+ public void processLSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ leftSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public void processRSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ rightSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public TreeNode<String> getTreeNodeLeft() {
+ if (treeNodeLeft == null) {
+ treeNodeLeft = initPaneTree();
+ }
+ return treeNodeLeft;
+ }
+
+ public void setTreeNodeLeft(TreeNode<String> treeNodeLeft) {
+ this.treeNodeLeft = treeNodeLeft;
+ }
+
+ public UITree getLeftTree() {
+ return leftTree;
+ }
+
+ public void setLeftTree(UITree leftTree) {
+ this.leftTree = leftTree;
+ }
+
+ public String getRightSelectedNodeTitle() {
+ return rightSelectedNodeTitle;
+ }
+
+ public void setRightSelectedNodeTitle(String rightSelectedNodeTitle) {
+ this.rightSelectedNodeTitle = rightSelectedNodeTitle;
+ }
+
+ public String getLeftSelectedNodeTitle() {
+ return leftSelectedNodeTitle;
+ }
+
+ public void setLeftSelectedNodeTitle(String leftSelectedNodeTitle) {
+ this.leftSelectedNodeTitle = leftSelectedNodeTitle;
+ }
+
+ public UITree getRightTree() {
+ return rightTree;
+ }
+
+ public void setRightTree(UITree rightTree) {
+ this.rightTree = rightTree;
+ }
+
+ public TreeNode<String> getTreeNodeRight() {
+ if (treeNodeRight == null) {
+ treeNodeRight = initPaneTree();
+ }
+ return treeNodeRight;
+ }
+
+ public void setTreeNodeRight(TreeNode<String> treeNodeRight) {
+ this.treeNodeRight = treeNodeRight;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/TTreeNA.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/TTreeNA.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/TTreeNA.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,38 @@
+package tTree;
+
+import java.util.ArrayList;
+
+import tTree.data.Dir;
+import tTree.data.Package;
+import tTree.data.Project;
+
+public class TTreeNA {
+ private ArrayList<Project> treeNA;
+
+ public TTreeNA() {
+ treeNA = new ArrayList<Project>();
+ ArrayList<Dir> dirsArr = new ArrayList<Dir>();
+ ArrayList<Package> packArr = new ArrayList<Package>();
+
+ treeNA.clear();
+ for (int i = 0; i < 3; i++) {
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + i + " " + j + " " + k));
+ }
+ dirsArr.add(new Dir("dir #" + i + " " + j, new ArrayList<Package>(packArr)));
+ }
+ treeNA.add(new Project("project #" + i, new ArrayList<Dir>(dirsArr)));
+ }
+ }
+
+ public ArrayList<Project> getTreeNA() {
+ return treeNA;
+ }
+
+ public void setTreeNA(ArrayList<Project> treeNA) {
+ this.treeNA = treeNA;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/TTreeRNA.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/TTreeRNA.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/TTreeRNA.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,48 @@
+package tTree;
+
+import java.util.ArrayList;
+
+import tTree.data.Dir;
+import tTree.data.Package;
+
+public class TTreeRNA {
+ private ArrayList<Dir> treeRNAroots;
+
+ public TTreeRNA() {
+ treeRNAroots = new ArrayList<Dir>();
+ ArrayList<Dir> dirsArr = new ArrayList<Dir>();
+ ArrayList<Dir> subDirsArr = new ArrayList<Dir>();
+ ArrayList<Package> packArr = new ArrayList<Package>();
+ ArrayList<Package> subPackArr = new ArrayList<Package>();
+
+ treeRNAroots.clear();
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ subDirsArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + j + " " + k));
+ }
+ for (int f = 0; f < 4; f++) {
+ subPackArr.clear();
+ for (int l = 0; l < 5; l++) {
+ subPackArr.add(new Package("subPackage #" + j + " " + f
+ + " " + l));
+ }
+ subDirsArr.add(new Dir("subDir #" + j + " " + f,
+ new ArrayList<Package>(subPackArr)));
+ }
+ dirsArr.add(new Dir("dir #" + j, new ArrayList<Package>(packArr),
+ new ArrayList<Dir>(subDirsArr)));
+ }
+ treeRNAroots.add(new Dir("*** root ***", null, dirsArr));
+ }
+
+ public ArrayList<Dir> getTreeRNAroots() {
+ return treeRNAroots;
+ }
+
+ public void setTreeRNAroots(ArrayList<Dir> treeRNAroots) {
+ this.treeRNAroots = treeRNAroots;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/data/Dir.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/data/Dir.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/data/Dir.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,44 @@
+package tTree.data;
+
+import java.util.ArrayList;
+
+public class Dir {
+ private String name;
+ private ArrayList<Package> packages;
+ private ArrayList<Dir> dirs;
+
+ public Dir(String name, ArrayList<Package> packages) {
+ this.name = name;
+ this.packages = packages;
+ }
+
+ public Dir(String name, ArrayList<Package> packages, ArrayList<Dir> dirs) {
+ this.name = name;
+ this.packages = packages;
+ this.dirs = dirs;
+ }
+
+ public ArrayList<Dir> getDirs() {
+ return dirs;
+ }
+
+ public void setDirs(ArrayList<Dir> dirs) {
+ this.dirs = dirs;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ArrayList<Package> getPackages() {
+ return packages;
+ }
+
+ public void setPackages(ArrayList<Package> packages) {
+ this.packages = packages;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/data/Package.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/data/Package.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/data/Package.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,17 @@
+package tTree.data;
+
+public class Package {
+ private String name;
+
+ public Package(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/data/Project.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/data/Project.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/data/Project.java 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,29 @@
+package tTree.data;
+
+import java.util.ArrayList;
+
+public class Project {
+ private String name;
+ private ArrayList<Dir> srcDirs;
+
+ public Project(String name, ArrayList<Dir> srcDirs) {
+ this.name = name;
+ this.srcDirs = srcDirs;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ArrayList<Dir> getSrcDirs() {
+ return srcDirs;
+ }
+
+ public void setSrcDirs(ArrayList<Dir> srcDirs) {
+ this.srcDirs = srcDirs;
+ }
+}
Added: trunk/test-applications/facelets/src/main/java/tTree/pom_sample.xml
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/pom_sample.xml (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/pom_sample.xml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tree</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ajax4jsf.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>tree</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <id>maven2-snapshots.ajax4jsf.org</id>
+ <name>Ajax4jsf Repository for Maven Snapshots</name>
+ <url>https://ajax4jsf.dev.java.net/nonav/snapshots</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <id>maven2-snapshots.ajax4jsf.org</id>
+ <name>Ajax4jsf Repository for Maven Snapshots</name>
+ <url>https://ajax4jsf.dev.java.net/nonav/snapshots</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.1_02</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ajax4jsf</groupId>
+ <artifactId>framework</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/java/tTree/test.xml
===================================================================
--- trunk/test-applications/facelets/src/main/java/tTree/test.xml (rev 0)
+++ trunk/test-applications/facelets/src/main/java/tTree/test.xml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <description>RF Test-Application</description>
+ <display-name>test-application</display-name>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config-RichPanelsBean.xml,/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,
+ /WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,
+ /WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,
+ /WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,
+ /WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,
+ /WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,
+ /WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,
+ /WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,
+ /WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,
+ /WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,
+ /WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,
+ /WEB-INF/faces-config-RichTest.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,
+ /WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-tTree.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-tTree.xml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-tTree.xml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,30 @@
+<?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>tTree</managed-bean-name>
+ <managed-bean-class>tTree.TTree</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>pVisability</managed-bean-name>
+ <managed-bean-class>tTree.PVisability</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>tTreeNA</managed-bean-name>
+ <managed-bean-class>tTree.TTreeNA</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>tTreeRNA</managed-bean-name>
+ <managed-bean-class>tTree.TTreeRNA</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>tTreeDND</managed-bean-name>
+ <managed-bean-class>tTree.TTreeDND</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 2008-12-05 13:24:11 UTC (rev 11575)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -41,7 +41,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/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-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-S!
ortingAndFiltering.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>
+ <param-value>/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,/WE!
B-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-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Opt!
ions.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>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
Added: trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,54 @@
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich" id="tTreeSubviewID">
+
+ <h:panelGrid columns="2" border="1">
+ <f:facet name="header">
+ <h:outputText value="Select tree to show: " />
+ </f:facet>
+ <h:outputText value="default Tree: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreeSubviewID}"
+ onchange="submit();" />
+ <h:outputText value="Tree with treeNodesAdaptor: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreePropertySubviewID}"
+ onchange="submit();" />
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor: " />
+ <h:selectBooleanCheckbox
+ value="#{pVisability.tTreeStraightforwardSubviewID}"
+ onchange="submit();" />
+ <h:outputText value="Tree with Drag and Drop functionality: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreeDefaultSubviewID}"
+ onchange="submit();" />
+ </h:panelGrid>
+ <rich:spacer height="10" />
+
+ <h:panelGrid columns="1" rendered="#{pVisability.tTreeSubviewID}">
+ <h:outputText value="default Tree" style="color: red" />
+ <rich:tree id="dTree" switchType="#{tTree.switchType}"
+ value="#{tTree.data}" var="defTree" binding="#{tTree.tree}"
+ ajaxSubmitSelection="false" immediate="false">
+
+ <rich:treeNode>
+ <h:outputText value="#{defTree} : " />
+ <h:inputText value="#{defTree.name}" />
+ </rich:treeNode>
+
+ <rich:treeNode>
+ <h:outputText value="#{defTree}" />
+ </rich:treeNode>
+ </rich:tree>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Change tree switchType:" />
+ <h:selectOneRadio value="#{tTree.switchType}" onclick="submit();">
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <rich:spacer height="10" />
+</f:subview>
Added: trunk/test-applications/facelets/src/main/webapp/tTree/tTreeProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/tTree/tTreeProperty.xhtml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/tTree/tTreeProperty.xhtml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,27 @@
+<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="tTreePropertySubviewID"
+ rendered="#{pVisability.tTreePropertySubviewID}">
+
+ <h:outputText value="Tree with treeNodesAdaptor" style="color: red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeNA.treeNA}" var="project">
+ <rich:treeNode>
+ <h:outputText value="#{project.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor nodes="#{project.srcDirs}" var="dir">
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ <rich:spacer height="10" />
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml 2008-12-05 13:44:20 UTC (rev 11576)
@@ -0,0 +1,113 @@
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ id="tTreeStraightforwardSubviewID">
+
+ <style type="text/css">
+.LeftTreePane {
+
+}
+
+.RightTreePane {
+
+}
+
+.TreeContainer {
+ overflow: auto;
+ height: 400px;
+ border: 3px inset gray;
+}
+</style>
+
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor"
+ style="color: red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeRNA.treeRNAroots}" var="root">
+ <rich:treeNode>
+ <h:outputText value="#{root.name}" />
+ </rich:treeNode>
+ <rich:recursiveTreeNodesAdaptor var="dir" roots="#{root.dirs}"
+ nodes="#{dir.dirs}">
+ <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ </rich:recursiveTreeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ </h:panelGrid>
+ <rich:spacer height="10" />
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeDefaultSubviewID}">
+ <h:outputText value="Tree with Drag and Drop functionality"
+ style="color: red" />
+
+ <rich:dragIndicator id="treeIndicator">
+ <f:facet name="single">
+ <f:verbatim>{marker} {nodeParam}({treeParam})</f:verbatim>
+ </f:facet>
+ </rich:dragIndicator>
+
+ <h:panelGrid columns="2" columnClasses="LeftTreePane,RightTreePane">
+
+ <h:panelGroup id="leftContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node:
+ #{tTreeDND.leftSelectedNodeTitle}"
+ id="selectedNodeL" />
+
+ <rich:tree id="leftTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processLSelection}"
+ reRender="selectedNodeL, leftContainer" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeLeft}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.leftTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ dropListener="#{tTreeDND.onDrop}" dragListener="#{tTreeDND.onDrag}"
+ dragIndicator="treeIndicator" acceptedTypes="treeNodeR"
+ dragType="treeNodeL" rowKeyVar="key" var="item">
+
+ <rich:dndParam name="treeParam" value="leftTree" />
+ </rich:tree>
+ </h:panelGroup>
+
+ <h:panelGroup id="rightContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node:
+ #{tTreeDND.rightSelectedNodeTitle}"
+ id="selectedNodeR" />
+
+ <rich:tree id="rightTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processRSelection}"
+ reRender="selectedNodeR,rightContainer" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeRight}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.rightTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ rowKeyVar="key" dropListener="#{tTreeDND.onDrop}"
+ dragListener="#{tTreeDND.onDrag}" dragIndicator="treeIndicator"
+ acceptedTypes="treeNodeL" dragType="treeNodeR" var="item">
+
+ <rich:dndParam name="treeParam" value="rightTree" />
+ </rich:tree>
+ </h:panelGroup>
+
+ </h:panelGrid>
+ </h:panelGrid>
+ <rich:spacer height="10" />
+
+</f:subview>
\ No newline at end of file
16 years, 1 month
JBoss Rich Faces SVN: r11575 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-05 08:24:11 -0500 (Fri, 05 Dec 2008)
New Revision: 11575
Added:
trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGtreeterApp.png
Log:
UPD the image
Added: trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGtreeterApp.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/GettingStarted_RFGtreeterApp.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 1 month
JBoss Rich Faces SVN: r11574 - in trunk/ui/dataTable/src/main: java/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-05 07:06:35 -0500 (Fri, 05 Dec 2008)
New Revision: 11574
Modified:
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-2170
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-12-05 11:50:42 UTC (rev 11573)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-12-05 12:06:35 UTC (rev 11574)
@@ -186,6 +186,12 @@
<description>HTML: a script expression; a pointer is moved within of row
</description>
</property>
+ <property>
+ <name>onRowContextMenu</name>
+ <classname>java.lang.String</classname>
+ <description>JavaScript handler to be called on right click.
+ Returning false prevents default browser context menu from being displayed</description>
+ </property>
<property >
<name>reRender</name>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-12-05 11:50:42 UTC (rev 11573)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-12-05 12:06:35 UTC (rev 11574)
@@ -35,9 +35,11 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.Column;
import org.richfaces.component.Row;
@@ -753,4 +755,13 @@
}
}
}
+
+ @Override
+ protected void encodeRowEvents(FacesContext context, UIDataAdaptor table)
+ throws IOException {
+ super.encodeRowEvents(context, table);
+ RendererUtils utils2 = getUtils();
+ utils2.encodeAttribute(context, table, "onRowContextMenu", "oncontextmenu" );
+
+ }
}
\ No newline at end of file
16 years, 1 month