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, 10 months
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, 10 months
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, 10 months
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, 10 months
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, 10 months
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, 10 months
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, 10 months
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, 10 months
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, 10 months
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, 10 months
JBoss Rich Faces SVN: r11573 - trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-05 06:50:42 -0500 (Fri, 05 Dec 2008)
New Revision: 11573
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
Log:
Fix nonsense catch handler
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-12-05 06:24:39 UTC (rev 11572)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/AbstractProgressBarRenderer.java 2008-12-05 11:50:42 UTC (rev 11573)
@@ -54,6 +54,8 @@
import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.CountingOutputWriter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.richfaces.component.UIProgressBar;
/**
@@ -63,6 +65,8 @@
*
*/
public class AbstractProgressBarRenderer extends TemplateEncoderRendererBase {
+
+ private static final Log log = LogFactory.getLog(AbstractProgressBarRenderer.class);
/** Ajax function performing polling */
private static final String AJAX_POLL_FUNCTION = "A4J.AJAX.Poll";
@@ -123,7 +127,7 @@
* @return
*/
public StringBuffer getMarkup(FacesContext context, UIComponent component) {
- StringBuffer result = null;
+ StringBuffer result = new StringBuffer();
CountingOutputWriter customWriter = new CountingOutputWriter();
try {
if (hasChildren(component)) {
@@ -161,7 +165,7 @@
result = customWriter.getContent();
}
} catch (Exception e) {
- e.getMessage();
+ log.error("Error occurred during rendering of progress bar label. It switched to empty string", e);
}
return result;
16 years, 10 months
JBoss Rich Faces SVN: r11572 - trunk/ui/tree/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-05 01:24:39 -0500 (Fri, 05 Dec 2008)
New Revision: 11572
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
Log:
https://jira.jboss.org/jira/browse/RF-4557
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2008-12-05 05:12:04 UTC (rev 11571)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2008-12-05 06:24:39 UTC (rev 11572)
@@ -934,6 +934,8 @@
}
};
+ component.getAttributes().put("escape", Boolean.TRUE);
+
return component;
}
16 years, 10 months
JBoss Rich Faces SVN: r11571 - trunk/ui/beanValidator/src/main/java/org/richfaces/validator.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-05 00:12:04 -0500 (Fri, 05 Dec 2008)
New Revision: 11571
Modified:
trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
Log:
https://jira.jboss.org/jira/browse/RF-4847
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2008-12-05 03:00:30 UTC (rev 11570)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2008-12-05 05:12:04 UTC (rev 11571)
@@ -284,7 +284,16 @@
if (null == appBundle || null == locale) {
return null;
}
- ResourceBundle bundle = ResourceBundle.getBundle(appBundle, locale);
+
+ ResourceBundle bundle;
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ if (classLoader != null) {
+ bundle = ResourceBundle.getBundle(appBundle, locale, classLoader);
+ } else {
+ bundle = ResourceBundle.getBundle(appBundle, locale);
+ }
+
return bundle;
}
16 years, 10 months
JBoss Rich Faces SVN: r11570 - trunk/framework/impl/src/main/javascript/ajaxjsf.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 22:00:30 -0500 (Thu, 04 Dec 2008)
New Revision: 11570
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
https://jira.jboss.org/jira/browse/RF-2776
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-04 20:41:46 UTC (rev 11569)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-12-05 03:00:30 UTC (rev 11570)
@@ -1313,7 +1313,7 @@
},
radio : function(control){
- this._check_query(control);
+ this._radio_query(control);
},
checkbox : function(control){
@@ -1492,6 +1492,12 @@
}
},
+ _radio_query : function(control) {
+ if( control.checked ) {
+ this.appendParameter(control.name, control.value?control.value:"");
+ }
+ },
+
// Append parameter to query. if name exist, append to array of parameters
appendParameter: function(cname,value){
if( ! this._query[cname] ){
16 years, 10 months
JBoss Rich Faces SVN: r11569 - trunk/ui/tree/src/main/java/org/richfaces/component/events.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 15:41:46 -0500 (Thu, 04 Dec 2008)
New Revision: 11569
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java
Log:
DnD Events refactoring
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java 2008-12-04 19:02:04 UTC (rev 11568)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java 2008-12-04 20:41:46 UTC (rev 11569)
@@ -65,13 +65,9 @@
} else if (event instanceof NodeSelectedEvent) {
binding = eventsProducer.getNodeSelectListener();
} else if (event instanceof DropEvent) {
- if (((DropEvent) event).isValid()) {
- binding = eventsProducer.getDropListener();
- }
+ binding = eventsProducer.getDropListener();
} else if (event instanceof DragEvent) {
- if (((DragEvent) event).isValid()) {
- binding = eventsProducer.getDragListener();
- }
+ binding = eventsProducer.getDragListener();
}
if (binding != null) {
16 years, 10 months
JBoss Rich Faces SVN: r11568 - trunk/samples/dragDropDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 14:02:04 -0500 (Thu, 04 Dec 2008)
New Revision: 11568
Modified:
trunk/samples/dragDropDemo/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-961
Modified: trunk/samples/dragDropDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/dragDropDemo/src/main/webapp/pages/index.jsp 2008-12-04 18:52:08 UTC (rev 11567)
+++ trunk/samples/dragDropDemo/src/main/webapp/pages/index.jsp 2008-12-04 19:02:04 UTC (rev 11568)
@@ -33,48 +33,160 @@
<h:form id="form">
<h:selectOneRadio binding="#{skinBean.component}" />
<h:commandLink action="#{skinBean.change}" value="set skin" />
-
- <h:panelGroup id="dragValueText">
- <h:outputText value="#{bean.dragValue}" />
- </h:panelGroup>
-
- <h:panelGrid columns="3">
- <h:dataTable var="type" value="#{bean.types}">
- <h:column>
- <h:panelGrid styleClass="dropzoneDecoration" id="drop1">
- <h:outputText value="#{type} - drop" />
+ </h:form>
+ <h:panelGrid columns="3">
+ <h:form>
+ <fieldset>
+ <legend>Tables</legend>
+
+ <h:panelGroup id="dragValueText">
+ <h:outputText value="#{bean.dragValue}" />
+ </h:panelGroup>
- <dnd:dropSupport reRender="dragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
- <a4j:actionparam value="#{type} - test drop param" assignTo="#{bean.testParam}" />
- </dnd:dropSupport>
- </h:panelGrid>
- </h:column>
- </h:dataTable>
-
- <h:dataTable var="type" value="#{bean.types}">
- <h:column>
- <h:panelGrid styleClass="dropzoneDecoration" id="drag1">
- <h:outputText value="#{type} - drag" />
+ <h:panelGrid columns="3">
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drop1A">
+ <h:outputText value="#{type} - drop" />
+
+ <dnd:dropSupport reRender="dragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ <a4j:actionparam value="#{type} - test drop param" assignTo="#{bean.testParam}" />
+ </dnd:dropSupport>
+ </h:panelGrid>
+ </h:column>
+ </h:dataTable>
+
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drag1">
+ <h:outputText value="#{type} - drag" />
+
+ <dnd:dragSupport dragType="#{type}" dragValue="#{type} - value" action="#{bean.dragAction}" dragListener="#{bean.processDrag}">
+ <a4j:actionparam value="#{type} - test drag param" assignTo="#{bean.testParam}" />
+ </dnd:dragSupport>
+ </h:panelGrid>
+ </h:column>
+ </h:dataTable>
- <dnd:dragSupport dragType="#{type}" dragValue="#{type} - value" action="#{bean.dragAction}" dragListener="#{bean.processDrag}">
- <a4j:actionparam value="#{type} - test drag param" assignTo="#{bean.testParam}" />
- </dnd:dragSupport>
- </h:panelGrid>
- </h:column>
- </h:dataTable>
-
- <h:dataTable var="type" value="#{bean.types}">
- <h:column>
- <h:panelGrid styleClass="dropzoneDecoration" id="drop2">
- <h:outputText value="#{type} - drop" />
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drop1B">
+ <h:outputText value="#{type} - drop" />
+
+ <dnd:dropSupport reRender="dragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ </dnd:dropSupport>
+ </h:panelGrid>
+ </h:column>
+ </h:dataTable>
+ </h:panelGrid>
+ </fieldset>
+ </h:form>
+ <h:form>
+ <fieldset>
+ <legend>Regions</legend>
+
+ <h:panelGroup id="regionsDragValueText">
+ <h:outputText value="#{bean.dragValue}" />
+ </h:panelGroup>
+ <h:panelGrid columns="3">
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <a4j:region>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drop2A">
+ <h:outputText value="#{type} - drop" />
+
+ <dnd:dropSupport ajaxSingle="true" reRender="regionsDragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ <a4j:actionparam value="#{type} - test drop param" assignTo="#{bean.testParam}" />
+ </dnd:dropSupport>
+ </h:panelGrid>
+ </a4j:region>
+ </h:column>
+ </h:dataTable>
+
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <a4j:region>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drag2">
+ <h:outputText value="#{type} - drag" />
+
+ <dnd:dragSupport ajaxSingle="true" dragType="#{type}" dragValue="#{type} - value" action="#{bean.dragAction}" dragListener="#{bean.processDrag}">
+ <a4j:actionparam value="#{type} - test drag param" assignTo="#{bean.testParam}" />
+ </dnd:dragSupport>
+ </h:panelGrid>
+ </a4j:region>
+ </h:column>
+ </h:dataTable>
- <dnd:dropSupport reRender="dragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
- </dnd:dropSupport>
- </h:panelGrid>
- </h:column>
- </h:dataTable>
- </h:panelGrid>
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <a4j:region>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drop2B">
+ <h:outputText value="#{type} - drop" />
+
+ <dnd:dropSupport ajaxSingle="true" reRender="regionsDragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ </dnd:dropSupport>
+ </h:panelGrid>
+ </a4j:region>
+ </h:column>
+ </h:dataTable>
+ </h:panelGrid>
+ </fieldset>
+ </h:form>
+
+ <h:panelGroup>
+ <fieldset>
+ <legend>Forms</legend>
+
+ <h:panelGroup id="formsDragValueText">
+ <h:outputText value="#{bean.dragValue}" />
+ </h:panelGroup>
+ <h:panelGrid columns="3">
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <h:form>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drag3A">
+ <h:outputText value="#{type} - drop" />
+
+ <dnd:dropSupport ajaxSingle="true" reRender="formsDragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ <a4j:actionparam value="#{type} - test drop param" assignTo="#{bean.testParam}" />
+ </dnd:dropSupport>
+ </h:panelGrid>
+ </h:form>
+ </h:column>
+ </h:dataTable>
+
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <h:form>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drag3">
+ <h:outputText value="#{type} - drag" />
+
+ <dnd:dragSupport ajaxSingle="true" dragType="#{type}" dragValue="#{type} - value" action="#{bean.dragAction}" dragListener="#{bean.processDrag}">
+ <a4j:actionparam value="#{type} - test drag param" assignTo="#{bean.testParam}" />
+ </dnd:dragSupport>
+ </h:panelGrid>
+ </h:form>
+ </h:column>
+ </h:dataTable>
+
+ <h:dataTable var="type" value="#{bean.types}">
+ <h:column>
+ <h:form>
+ <h:panelGrid styleClass="dropzoneDecoration" id="drop3B">
+ <h:outputText value="#{type} - drop" />
+
+ <dnd:dropSupport ajaxSingle="true" reRender="formsDragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ </dnd:dropSupport>
+ </h:panelGrid>
+ </h:form>
+ </h:column>
+ </h:dataTable>
+ </h:panelGrid>
+ </fieldset>
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:form id="form2">
<dnd:dragIndicator id="indicator" acceptClass="accept" rejectClass="reject" style="width: 500px;">
<f:facet name="single">
<f:verbatim>
16 years, 10 months
JBoss Rich Faces SVN: r11567 - in trunk/ui/drag-drop/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 13:52:08 -0500 (Thu, 04 Dec 2008)
New Revision: 11567
Removed:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
Log:
https://jira.jboss.org/jira/browse/RF-961
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2008-12-04 18:47:19 UTC (rev 11566)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2008-12-04 18:52:08 UTC (rev 11567)
@@ -59,15 +59,13 @@
super.broadcast(event);
if (event instanceof DragEvent) {
DragEvent dragEvent = (DragEvent) event;
- if (dragEvent.isValid()) {
- MethodBinding binding = getDragListener();
- if (binding != null) {
- binding.invoke(getFacesContext(), new Object[] {event});
- }
-
- new AjaxEvent(this).queue();
- new ActionEvent(this).queue();
+ MethodBinding binding = getDragListener();
+ if (binding != null) {
+ binding.invoke(getFacesContext(), new Object[] {event});
}
+
+ new AjaxEvent(this).queue();
+ new ActionEvent(this).queue();
}
}
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2008-12-04 18:47:19 UTC (rev 11566)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2008-12-04 18:52:08 UTC (rev 11567)
@@ -57,15 +57,13 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
if (event instanceof DropEvent) {
- if (((DropEvent) event).isValid()) {
- MethodBinding binding = getDropListener();
- if (binding != null) {
- binding.invoke(getFacesContext(), new Object[] {event});
- }
-
- new AjaxEvent(this).queue();
- new ActionEvent(this).queue();
+ MethodBinding binding = getDropListener();
+ if (binding != null) {
+ binding.invoke(getFacesContext(), new Object[] {event});
}
+
+ new AjaxEvent(this).queue();
+ new ActionEvent(this).queue();
}
}
Deleted: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2008-12-04 18:47:19 UTC (rev 11566)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2008-12-04 18:52:08 UTC (rev 11567)
@@ -1,183 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.faces.component.ContextCallback;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.apache.commons.collections.MultiHashMap;
-import org.richfaces.component.Draggable;
-import org.richfaces.component.Dropzone;
-import org.richfaces.event.DnDEvent;
-
-/**
- * @author Nick Belaevski - nbelaevski(a)exadel.com
- * created 27.12.2006
- *
- */
-final class DnDEventsExchangeMailer {
- private DnDEventsExchangeMailer() {
-
- }
-
- private static class EventInfoStructure {
- private DnDEvent dndEvent;
- private EventCallback eventCallback;
-
- private Object type;
- private Object value;
-
- public EventInfoStructure(DnDEvent dndEvent,
- EventCallback eventCallback, Object type, Object value) {
- super();
- this.dndEvent = dndEvent;
- this.eventCallback = eventCallback;
- this.type = type;
- this.value = value;
- }
-
- }
-
- static abstract class EventCallback {
- abstract void processEvent(DnDEvent dndEvent, UIComponent source, FacesContext facesContext, Object type, Object value);
- }
-
- static DnDEventsExchangeMailer getInstance(FacesContext facesContext) {
- synchronized (facesContext) {
- Map requestMap = facesContext.getExternalContext().getRequestMap();
-
- String attrName = DnDEventsExchangeMailer.class.getName();
- DnDEventsExchangeMailer instance;
- if ((instance = (DnDEventsExchangeMailer) requestMap.get(attrName)) == null) {
- instance = new DnDEventsExchangeMailer();
-
- requestMap.put(attrName, instance);
- }
-
- return instance;
- }
- }
-
- private Map<String, EventInfoStructure> queuedMap = new HashMap<String, EventInfoStructure>();
-
- private Map<String, UIComponent> components = new HashMap<String, UIComponent>();
-
- private void processEvent(UIComponent source, FacesContext facesContext, DnDEvent dndEvent, EventCallback callback, Object type, Object value) {
- if (callback != null) {
- callback.processEvent(dndEvent, source, facesContext, type, value);
- }
- }
-
- /**
- * Decode drag & drop events. Collect pairs of correspondent drag & drop events and send them
- * together where OnDrag becomes always before OnDrop.
- *
- * @param sourceId Id of element event come from
- * @param target component that receive event
- * @param facesContext Faces context
- * @param dndEvent drag & drop event descriptor
- * @param callback call back method
- * @param type type of dragged/dropped value
- * @param value dragged/dropped value
- * @param isDraggable whether the event related draggable component or dropzone one.
- */
- public void mailEvent(String sourceId, UIComponent target, FacesContext facesContext, final DnDEvent dndEvent,
- final EventCallback callback, final Object type, final Object value, boolean isDraggable) {
-
- final UIComponent component = components.get(sourceId);
- String targetId = target.getClientId(facesContext);
-
- if (component == null) {
- //component with that sourceId have never mailed anything before - wait
- if (queuedMap.containsKey(sourceId)) {
- throw new IllegalStateException("Drag source with id '" + sourceId + "' already specified.");
- }
- queuedMap.put(sourceId, new EventInfoStructure(dndEvent, callback, type, value));
- components.put(targetId, target);
- } else {
- //check queued mail lists for current component
- final EventInfoStructure eventInfo = (EventInfoStructure) queuedMap.get(targetId);
- if (eventInfo != null) {
- Draggable draggable;
- Dropzone dropzone;
-
- final EventInfoStructure dragEventInfo = isDraggable ? eventInfo : new EventInfoStructure(dndEvent, callback, type, value);
- final EventInfoStructure dropEventInfo = isDraggable ? new EventInfoStructure(dndEvent, callback, type, value) : eventInfo;
-
- Object acceptedTypes;
- Object dragType;
-
- if (isDraggable) {
- draggable = (Draggable) target;
- dropzone = (Dropzone) component;
-
- acceptedTypes = eventInfo.type;
- dragType = type;
- } else {
- draggable = (Draggable) component;
- dropzone = (Dropzone) target;
-
- acceptedTypes = type;
- dragType = eventInfo.type;
- }
-
- if (DnDValidator.validateAcceptTypes(facesContext,
- draggable, dropzone,
- dragType, acceptedTypes)) {
-
- // Make sure that we will have OnDrag event occur first
- facesContext.getViewRoot().invokeOnComponent(facesContext, isDraggable ? targetId : sourceId, new ContextCallback() {
- public void invokeContextCallback(FacesContext fc,
- UIComponent targetComponent) {
-
- processEvent(targetComponent, fc, dragEventInfo.dndEvent, dragEventInfo.eventCallback,
- dropEventInfo.type, dropEventInfo.value);
-
- dropEventInfo.dndEvent.queue();
- }
- });
-
- facesContext.getViewRoot().invokeOnComponent(facesContext, isDraggable ? sourceId : targetId, new ContextCallback() {
- public void invokeContextCallback(FacesContext fc,
- UIComponent targetComponent) {
-
- processEvent(targetComponent, fc, dropEventInfo.dndEvent, dropEventInfo.eventCallback,
- dragEventInfo.type, dragEventInfo.value);
-
- dragEventInfo.dndEvent.queue();
- }
- });
- }
-
- queuedMap.remove(targetId);
- }
- }
- }
-
-}
-
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java 2008-12-04 18:47:19 UTC (rev 11566)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java 2008-12-04 18:52:08 UTC (rev 11567)
@@ -41,8 +41,8 @@
class DnDValidator {
private final static String MESSAGE_FORMAT = "Dropzone [{0}] with accepted types {1} cannot accept Draggable [{2}] with dragType [{3}]";
- static boolean validateAcceptTypes(FacesContext context, Draggable draggable, Dropzone dropzone, Object dragType, Object acceptedTypes) {
- Set set = AjaxRendererUtils.asSet(acceptedTypes);
+ static boolean validateAcceptTypes(FacesContext context, Draggable draggable, Dropzone dropzone, String dragType, Object acceptedTypes) {
+ Set<String> set = AjaxRendererUtils.asSet(acceptedTypes);
if (set == null || !set.contains(dragType)) {
UIComponent component = (UIComponent) dropzone;
String text = MessageFormat.format(
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2008-12-04 18:47:19 UTC (rev 11566)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2008-12-04 18:52:08 UTC (rev 11567)
@@ -32,10 +32,6 @@
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.Draggable;
-import org.richfaces.component.Dropzone;
-import org.richfaces.event.DnDEvent;
-import org.richfaces.event.DragEvent;
-import org.richfaces.renderkit.DnDEventsExchangeMailer.EventCallback;
/**
* @author shura
@@ -45,18 +41,6 @@
public final static String DRAG_SOURCE_ID = "dragSourceId";
- private static final EventCallback dragEventsCallback = new EventCallback() {
-
- void processEvent(DnDEvent dndEvent, UIComponent source,
- FacesContext facesContext, Object type, Object value) {
-
- DragEvent dragEvent = (DragEvent) dndEvent;
- dragEvent.setDropTarget((Dropzone) source);
- dragEvent.setDropValue(value);
- dragEvent.setAcceptedTypes(type);
- }
- };
-
private static DraggableRendererContributor instance;
private DraggableRendererContributor() {
@@ -96,23 +80,7 @@
}
public void decode(FacesContext context, UIComponent component, CompositeRenderer compositeRenderer) {
- DnDEventsExchangeMailer eventsExchanger = DnDEventsExchangeMailer.getInstance(context);
- String clientId = component.getClientId(context);
- Map paramMap = context.getExternalContext().getRequestParameterMap();
-
- if(clientId.equals(paramMap.get(DRAG_SOURCE_ID))){
- String dropTargetId = (String) paramMap.get(DropzoneRendererContributor.DROP_TARGET_ID);
-
- if (compositeRenderer != null) {
- compositeRenderer.contributorDecodeCallback(component, context, this, dropTargetId);
- }
-
- Draggable draggable = (Draggable) component;
-
- eventsExchanger.mailEvent(dropTargetId, component,
- context, new DragEvent(component), dragEventsCallback, draggable.getDragType(),
- draggable.getDragValue(), true);
- }
+ //decoding is done solely by dropzone
}
public String[] getStyleDependencies() {
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2008-12-04 18:47:19 UTC (rev 11566)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2008-12-04 18:52:08 UTC (rev 11567)
@@ -24,9 +24,11 @@
import java.util.Map;
import javax.faces.FacesException;
+import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.component.ContextCallbackWrapper;
import org.ajax4jsf.javascript.DnDScript;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
@@ -36,12 +38,11 @@
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.component.Draggable;
import org.richfaces.component.Dropzone;
-import org.richfaces.event.DnDEvent;
+import org.richfaces.event.DragEvent;
import org.richfaces.event.DropEvent;
import org.richfaces.json.JSONCollection;
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
-import org.richfaces.renderkit.DnDEventsExchangeMailer.EventCallback;
/**
* @author shura
@@ -51,21 +52,6 @@
public static final String DROP_TARGET_ID = "dropTargetId";
- private static final EventCallback dropEventsCallback = new EventCallback() {
-
- void processEvent(DnDEvent dndEvent, UIComponent source,
- FacesContext facesContext, Object type, Object value) {
-
- DropEvent dropEvent = (DropEvent) dndEvent;
- Draggable draggable = (Draggable) source;
- dropEvent.setDraggableSource(draggable);
-
- dropEvent.setDragType((String) type);
- dropEvent.setDragValue(value);
-
- }
- };
-
private DropzoneRendererContributor() {
super();
}
@@ -153,26 +139,58 @@
return null;
}
+ private static final class DraggableDecoderContextCallback implements ContextCallback {
+
+ private Dropzone dropzone;
+
+ public DraggableDecoderContextCallback(Dropzone dropzone) {
+ super();
+
+ this.dropzone = dropzone;
+ }
+
+ public void invokeContextCallback(FacesContext context,
+ UIComponent target) {
+
+ Draggable draggable = (Draggable) target;
+
+ String dragType = draggable.getDragType();
+ Object acceptedTypes = dropzone.getAcceptedTypes();
+
+ if (DnDValidator.validateAcceptTypes(context,
+ draggable, dropzone,
+ dragType, acceptedTypes)) {
+
+ DragEvent dragEvent = new DragEvent((UIComponent) draggable);
+ dragEvent.setDropTarget(dropzone);
+ dragEvent.setAcceptedTypes(acceptedTypes);
+ dragEvent.setDropValue(dropzone.getDropValue());
+
+ DropEvent dropEvent = new DropEvent((UIComponent) dropzone);
+ dropEvent.setDraggableSource(draggable);
+ dropEvent.setDragType(dragType);
+ dropEvent.setDragValue(draggable.getDragValue());
+
+ dragEvent.queue();
+ dropEvent.queue();
+ }
+ }
+ }
+
public void decode(FacesContext context, UIComponent component, CompositeRenderer compositeRenderer) {
- DnDEventsExchangeMailer eventsExchanger = DnDEventsExchangeMailer.getInstance(context);
-
String clientId = component.getClientId(context);
- Map paramMap = context.getExternalContext().getRequestParameterMap();
+ Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();
if(clientId.equals(paramMap.get(DROP_TARGET_ID))){
String dragSourceId = (String) paramMap.get(DraggableRendererContributor.DRAG_SOURCE_ID);
-
- if (compositeRenderer != null) {
- compositeRenderer.contributorDecodeCallback(component, context, this, dragSourceId);
+
+ if (dragSourceId != null && dragSourceId.length() != 0) {
+ DraggableDecoderContextCallback draggableDecoderContextCallback =
+ new DraggableDecoderContextCallback((Dropzone) component);
+
+ context.getViewRoot().invokeOnComponent(context, dragSourceId,
+ new ContextCallbackWrapper(draggableDecoderContextCallback));
}
-
- Dropzone dropzone = (Dropzone) component;
-
- eventsExchanger.mailEvent(dragSourceId, component,
- context, new DropEvent(component), dropEventsCallback,
- dropzone.getAcceptedTypes(),
- dropzone.getDropValue(), false
- );
}
}
@@ -189,7 +207,7 @@
definition.addToBody("var options = ").addToBody(ScriptUtils.toScript(requestOpts)).addToBody(";");
definition.addToBody("options.parameters['" + DROP_TARGET_ID + "'] = '" + component.getClientId(context) + "';");
//TODO nick - remove as legacy
- definition.addToBody("Object.extend(options.parameters,drag.getParameters());");
+ definition.addToBody("Richfaces.mergeObjects(options.parameters, drag.getParameters());");
definition.addToBody("var dzOptions = this.getDropzoneOptions(); if (dzOptions.ondrop) { if (!dzOptions.ondrop.call(this, event)) return; };");
JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
16 years, 10 months
JBoss Rich Faces SVN: r11566 - in trunk/framework: impl/src/main/java/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 13:47:19 -0500 (Thu, 04 Dec 2008)
New Revision: 11566
Modified:
trunk/framework/api/src/main/java/org/richfaces/event/DnDEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/DragEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/DropEvent.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
Log:
DnD event and related classes refactored
Modified: trunk/framework/api/src/main/java/org/richfaces/event/DnDEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/DnDEvent.java 2008-12-04 18:37:08 UTC (rev 11565)
+++ trunk/framework/api/src/main/java/org/richfaces/event/DnDEvent.java 2008-12-04 18:47:19 UTC (rev 11566)
@@ -23,7 +23,6 @@
import javax.faces.component.UIComponent;
import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
/**
*
@@ -44,25 +43,4 @@
super(component);
}
- protected Object value;
-
- private boolean valid = true;
-
- public boolean isAppropriateListener(FacesListener listener) {
- return valid;
- }
-
- public void invalidate() {
- valid = false;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- public void processListener(FacesListener listener) {
- if (!valid) {
- throw new IllegalStateException();
- }
- }
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/DragEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2008-12-04 18:37:08 UTC (rev 11565)
+++ trunk/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2008-12-04 18:47:19 UTC (rev 11566)
@@ -36,6 +36,7 @@
private Dropzone dropTarget;
private Object acceptedTypes;
+ private Object dropValue;
/**
*
*/
@@ -49,14 +50,13 @@
* @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
*/
public boolean isAppropriateListener(FacesListener faceslistener) {
- return super.isAppropriateListener(faceslistener) && faceslistener instanceof DragListener;
+ return faceslistener instanceof DragListener;
}
/* (non-Javadoc)
* @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
*/
public void processListener(FacesListener faceslistener) {
- super.processListener(faceslistener);
((DragListener) faceslistener).processDrag(this);
}
@@ -93,10 +93,10 @@
}
public Object getDropValue() {
- return value;
+ return dropValue;
}
public void setDropValue(Object dropValue) {
- this.value = dropValue;
+ this.dropValue = dropValue;
}
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2008-12-04 18:37:08 UTC (rev 11565)
+++ trunk/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2008-12-04 18:47:19 UTC (rev 11566)
@@ -40,6 +40,7 @@
private Draggable draggableSource;
private String dragType;
+ private Object dragValue;
public DropEvent(UIComponent component) {
super(component);
@@ -49,14 +50,13 @@
* @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
*/
public boolean isAppropriateListener(FacesListener listener) {
- return super.isAppropriateListener(listener) && listener instanceof DropListener;
+ return listener instanceof DropListener;
}
/* (non-Javadoc)
* @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
*/
public void processListener(FacesListener listener) {
- super.processListener(listener);
((DropListener) listener).processDrop(this);
}
@@ -98,10 +98,10 @@
}
public Object getDragValue() {
- return value;
+ return dragValue;
}
public void setDragValue(Object dragValue) {
- this.value = dragValue;
+ this.dragValue = dragValue;
}
}
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-12-04 18:37:08 UTC (rev 11565)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-12-04 18:47:19 UTC (rev 11566)
@@ -219,11 +219,6 @@
return (RendererContributor[]) renderers.toArray(new RendererContributor[renderers.size()]);
}
- public void contributorDecodeCallback(UIComponent component, FacesContext context, RendererContributor contributor,
- Object argument) {
-
- }
-
protected void addParameterEncoder(AttributeParametersEncoder encoder) {
parameterEncoders.add(encoder);
}
16 years, 10 months
JBoss Rich Faces SVN: r11565 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 13:37:08 -0500 (Thu, 04 Dec 2008)
New Revision: 11565
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 18:03:41 UTC (rev 11564)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 18:37:08 UTC (rev 11565)
@@ -141,31 +141,6 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
- String[] paths = {"/usr/lib/firefox-1.0.4/firefox",
- "/usr/lib/firefox-1.5.0.10/firefox",
- "/usr/lib/firefox-1.5.0.12/firefox",
- "/usr/lib64/firefox-1.5.0.12/firefox",
- "/usr/lib/firefox-3.0b5/firefox",
- "/usr/lib64/firefox-3.0b5/firefox",
- "/usr/lib/firefox-3.0.1/firefox",
- "/usr/lib64/firefox-3.0.1/firefox",
- "/usr/lib/firefox/firefox",
- "/opt/MozillaFirefox/lib/firefox"
- };
- if ("*firefox".equals(browser)) {
- for (int i = 0; i < paths.length && "*firefox".equals(browser); i++) {
- String path = paths[i] + "-bin";
- File file = new File(path);
- if (file.isFile()) {
- browser += " " + path;
- } /*else {
- file = new File(path + "-bin");
- if (file.isFile()) {
- browser += " " + path + "-bin";
- }
- }*/
- }
- }
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
16 years, 10 months
JBoss Rich Faces SVN: r11564 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 13:03:41 -0500 (Thu, 04 Dec 2008)
New Revision: 11564
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 18:02:17 UTC (rev 11563)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 18:03:41 UTC (rev 11564)
@@ -154,16 +154,16 @@
};
if ("*firefox".equals(browser)) {
for (int i = 0; i < paths.length && "*firefox".equals(browser); i++) {
- String path = paths[i];
+ String path = paths[i] + "-bin";
File file = new File(path);
if (file.isFile()) {
browser += " " + path;
- } else {
+ } /*else {
file = new File(path + "-bin");
if (file.isFile()) {
browser += " " + path + "-bin";
}
- }
+ }*/
}
}
synchronized (MUTEX) {
16 years, 10 months
JBoss Rich Faces SVN: r11563 - in trunk/test-applications/jsp/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-04 13:02:17 -0500 (Thu, 04 Dec 2008)
New Revision: 11563
Added:
trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java
Modified:
trunk/test-applications/jsp/src/main/java/tTree/PVisability.java
trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml
trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp
trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp
Log:
+ to tTree
Modified: trunk/test-applications/jsp/src/main/java/tTree/PVisability.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/PVisability.java 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/java/tTree/PVisability.java 2008-12-04 18:02:17 UTC (rev 11563)
@@ -4,13 +4,23 @@
private boolean tTreeSubviewID;
private boolean tTreePropertySubviewID;
private boolean tTreeStraightforwardSubviewID;
+ private boolean tTreeDefaultSubviewID;
public PVisability() {
- tTreeSubviewID = true;
+ 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;
}
Added: trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTreeDND.java 2008-12-04 18:02:17 UTC (rev 11563)
@@ -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;
+ }
+}
Modified: trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java 2008-12-04 18:02:17 UTC (rev 11563)
@@ -16,25 +16,26 @@
ArrayList<Package> subPackArr = new ArrayList<Package>();
treeRNAroots.clear();
- for (int i = 0; i < 3; i++) {
- 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 #" + i + " " + j + " " + k));
+ 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));
}
- for (int f = 0; f < 4; f++) {
- subPackArr.clear();
- for (int l = 0; l < 5; l++) {
- subPackArr.add(new Package("subPackage #" + i + " " + j + " "+ f + " " + l));
- }
- subDirsArr.add(new Dir("subDir #" + i + " " + j + " " + f, new ArrayList<Package>(subPackArr)));
- }
- dirsArr.add(new Dir("dir #" + i + " " + j, new ArrayList<Package>(packArr), new ArrayList<Dir>(subDirsArr)));
+ 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.addAll(dirsArr);
+ treeRNAroots.add(new Dir("*** root ***", null, dirsArr));
}
public ArrayList<Dir> getTreeRNAroots() {
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml 2008-12-04 18:02:17 UTC (rev 11563)
@@ -22,4 +22,9 @@
<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/jsp/src/main/webapp/tTree/tTree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-04 18:02:17 UTC (rev 11563)
@@ -18,10 +18,15 @@
<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">
@@ -45,4 +50,6 @@
</h:selectOneRadio>
</h:panelGrid>
</h:panelGrid>
+
+ <rich:spacer height="10" />
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp 2008-12-04 18:02:17 UTC (rev 11563)
@@ -6,6 +6,7 @@
<f:subview 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>
@@ -23,4 +24,5 @@
</rich:treeNodesAdaptor>
</rich:treeNodesAdaptor>
</rich:tree>
+ <rich:spacer height="10" />
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp 2008-12-04 17:52:59 UTC (rev 11562)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp 2008-12-04 18:02:17 UTC (rev 11563)
@@ -3,20 +3,108 @@
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
-<f:subview id="tTreeStraightforwardSubviewID"
- rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+<f:subview id="tTreeStraightforwardSubviewID">
+<style type="text/css">
+.LeftTreePane {
+
+}
- <rich:tree>
- <rich:recursiveTreeNodesAdaptor var="dir" roots="#{tTreeRNA.treeRNAroots}"
- nodes="#{dir.dirs}">
- <rich:treeNode>
- <h:outputText value="#{dir.name}" />
- </rich:treeNode>
- <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+.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="#{package.name}" />
+ <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:recursiveTreeNodesAdaptor>
- </rich:tree>
+ </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: <b>#{tTreeDND.leftSelectedNodeTitle}</b>"
+ 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: <b>#{tTreeDND.rightSelectedNodeTitle}</b>"
+ 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, 10 months
JBoss Rich Faces SVN: r11562 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 12:52:59 -0500 (Thu, 04 Dec 2008)
New Revision: 11562
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Richfaces.mergeObjects function added
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-04 17:47:30 UTC (rev 11561)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-04 17:52:59 UTC (rev 11562)
@@ -442,4 +442,20 @@
element.removeAttributeNode(node);
}
}
+};
+
+Richfaces.mergeObjects = function() {
+ var target = arguments[0];
+ if (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+ if (source) {
+ for (var name in source) {
+ if (!target[name]) {
+ target[name] = source[name];
+ }
+ }
+ }
+ }
+ }
};
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r11561 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 12:47:30 -0500 (Thu, 04 Dec 2008)
New Revision: 11561
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 17:42:52 UTC (rev 11560)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 17:47:30 UTC (rev 11561)
@@ -141,6 +141,31 @@
@BeforeClass
@Parameters({"browser", "filterPrefix"})
public void startSelenium(String browser, String filterPrefix) {
+ String[] paths = {"/usr/lib/firefox-1.0.4/firefox",
+ "/usr/lib/firefox-1.5.0.10/firefox",
+ "/usr/lib/firefox-1.5.0.12/firefox",
+ "/usr/lib64/firefox-1.5.0.12/firefox",
+ "/usr/lib/firefox-3.0b5/firefox",
+ "/usr/lib64/firefox-3.0b5/firefox",
+ "/usr/lib/firefox-3.0.1/firefox",
+ "/usr/lib64/firefox-3.0.1/firefox",
+ "/usr/lib/firefox/firefox",
+ "/opt/MozillaFirefox/lib/firefox"
+ };
+ if ("*firefox".equals(browser)) {
+ for (int i = 0; i < paths.length && "*firefox".equals(browser); i++) {
+ String path = paths[i];
+ File file = new File(path);
+ if (file.isFile()) {
+ browser += " " + path;
+ } else {
+ file = new File(path + "-bin");
+ if (file.isFile()) {
+ browser += " " + path + "-bin";
+ }
+ }
+ }
+ }
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
16 years, 10 months
JBoss Rich Faces SVN: r11560 - trunk/framework/impl/src/main/java/org/ajax4jsf/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 12:42:52 -0500 (Thu, 04 Dec 2008)
New Revision: 11560
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java
Log:
https://jira.jboss.org/jira/browse/RF-5241
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-04 17:38:23 UTC (rev 11559)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-04 17:42:52 UTC (rev 11560)
@@ -42,9 +42,10 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PushbackInputStream;
-import org.ajax4jsf.io.FastBufferOutputStream;
+
+
public class JSMin {
private static final int EOF = -1;
@@ -59,7 +60,7 @@
private int column;
public JSMin(InputStream in, OutputStream out) {
- this.in = new PushbackInputStream(in,2);
+ this.in = new PushbackInputStream(in);
this.out = out;
this.line = 0;
this.column = 0;
@@ -116,10 +117,6 @@
in.unread(lookaheadChar);
return lookaheadChar;
}
-
- void back(byte[] b) throws IOException {
- in.unread(b);
- }
/**
* next -- get the next character, excluding comments. peek() is used to see
@@ -136,6 +133,7 @@
return c;
}
}
+
case '*':
get();
for (;;) {
@@ -146,14 +144,6 @@
return ' ';
}
break;
- case '@':
- // TODO: add spaces skipping
- FastBufferOutputStream bs = new FastBufferOutputStream();
- bs.write('*');
- bs.write('@');
- back(bs.toByteArray());
- bs.close();
- return c;
case EOF:
throw new UnterminatedCommentException(line,column);
}
16 years, 10 months
JBoss Rich Faces SVN: r11559 - trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-04 12:38:23 -0500 (Thu, 04 Dec 2008)
New Revision: 11559
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
https://jira.jboss.org/jira/browse/RF-4487
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-04 17:12:26 UTC (rev 11558)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-04 17:38:23 UTC (rev 11559)
@@ -1147,6 +1147,7 @@
_flashSetComponent: function() {
var flashId = this.id+":flashContainer";
this.flashComponent = (document[flashId]) ? document[flashId] : (window[flashId] ? window[flashId] : $(flashId));
+ this.flashComponent.style.display = 'none';
this.flashComponent.setProperties({
acceptedTypes: this.acceptedTypes,
noDuplicate: this.options.noDuplicate,
16 years, 10 months
JBoss Rich Faces SVN: r11558 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 12:12:26 -0500 (Thu, 04 Dec 2008)
New Revision: 11558
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-04 17:06:54 UTC (rev 11557)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-04 17:12:26 UTC (rev 11558)
@@ -108,13 +108,13 @@
<artifactId>selenium-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<executions>
- <execution>
+ <!--execution>
<id>xvfb</id>
<phase>pre-integration-test</phase>
<goals>
<goal>xvfb</goal>
</goals>
- </execution>
+ </execution-->
<execution>
<phase>pre-integration-test</phase>
16 years, 10 months
JBoss Rich Faces SVN: r11557 - in trunk/test-applications/seleniumTest: richfaces/src/test/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 12:06:54 -0500 (Thu, 04 Dec 2008)
New Revision: 11557
Modified:
trunk/test-applications/seleniumTest/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-04 16:54:58 UTC (rev 11556)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-04 17:06:54 UTC (rev 11557)
@@ -15,7 +15,7 @@
<version>3.3.0-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<properties>
- <http.port>8080</http.port>
+ <http.port>8085</http.port>
</properties>
<repositories>
<repository>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 16:54:58 UTC (rev 11556)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 17:06:54 UTC (rev 11557)
@@ -59,7 +59,7 @@
/** Specifies the time to wait for ajax processing */
protected static final int ajaxCompletionTime = 3000;
- protected static final String serverPort = "8080";
+ protected static final String serverPort = "8085";
protected static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
16 years, 10 months
JBoss Rich Faces SVN: r11556 - trunk/ui/message/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-04 11:54:58 -0500 (Thu, 04 Dec 2008)
New Revision: 11556
Modified:
trunk/ui/message/src/main/config/component/message.xml
Log:
https://jira.jboss.org/jira/browse/RF-696 default values of 2 attributes area changed
Modified: trunk/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/ui/message/src/main/config/component/message.xml 2008-12-04 16:53:40 UTC (rev 11555)
+++ trunk/ui/message/src/main/config/component/message.xml 2008-12-04 16:54:58 UTC (rev 11556)
@@ -68,18 +68,18 @@
<property>
<name>showDetail</name>
<classname>boolean</classname>
- <defaultvalue>true</defaultvalue>
+ <defaultvalue>false</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "true".
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "false".
</description>
</property>
<property>
<name>showSummary</name>
<classname>boolean</classname>
- <defaultvalue>false</defaultvalue>
+ <defaultvalue>true</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "false".
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "true".
</description>
</property>
@@ -341,18 +341,18 @@
<property>
<name>showDetail</name>
<classname>boolean</classname>
- <defaultvalue>true</defaultvalue>
+ <defaultvalue>false</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "true"
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "false"
</description>
</property>
<property>
<name>showSummary</name>
<classname>boolean</classname>
- <defaultvalue>false</defaultvalue>
+ <defaultvalue>true</defaultvalue>
<description> Flag indicating whether the summary portion of displayed
- messages should be included. Default value is "false" </description>
+ messages should be included. Default value is "true" </description>
</property>
<property>
<name>title</name>
16 years, 10 months
JBoss Rich Faces SVN: r11555 - management/design/message/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-04 11:53:40 -0500 (Thu, 04 Dec 2008)
New Revision: 11555
Modified:
management/design/message/funcspec/FuncSpec - RF Message Component.doc
management/design/message/funcspec/FuncSpec - RF Messages Component.doc
Log:
https://jira.jboss.org/jira/browse/RF-696 default values of 2 attributes area changed in spec
Modified: management/design/message/funcspec/FuncSpec - RF Message Component.doc
===================================================================
(Binary files differ)
Modified: management/design/message/funcspec/FuncSpec - RF Messages Component.doc
===================================================================
(Binary files differ)
16 years, 10 months
JBoss Rich Faces SVN: r11554 - in trunk/samples/orderingListDemo/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 11:43:07 -0500 (Thu, 04 Dec 2008)
New Revision: 11554
Added:
trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java
trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java
Modified:
trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-4539
Modified: trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2008-12-04 16:12:22 UTC (rev 11553)
+++ trunk/samples/orderingListDemo/src/main/java/org/richfaces/Bean.java 2008-12-04 16:43:07 UTC (rev 11554)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Random;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
@@ -37,6 +36,9 @@
*/
public class Bean {
private List lists = new ArrayList();
+
+ private List<ConvertableDemoBean> genericLists = new ArrayList<ConvertableDemoBean>();
+
private String [] simpleItems = new String [] {
"First", "Second", "Third", "Fourth"
};
@@ -48,6 +50,10 @@
lists.add(new OrderingListDemoBean());
}
+ for (int i = 0; i < 10; i++) {
+ genericLists.add(new ConvertableDemoBean("#" + i, i));
+ }
+
for (int i = 0; i < 6; i++) {
zebraItems.add(String.valueOf(i));
}
@@ -61,6 +67,14 @@
this.lists = lists;
}
+ public List<ConvertableDemoBean> getGenericList() {
+ return this.genericLists;
+ }
+
+ public void setGenericList(List<ConvertableDemoBean> list) {
+ this.genericLists = list;
+ }
+
public String[] getSimpleItems() {
return simpleItems;
}
Added: trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java
===================================================================
--- trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java (rev 0)
+++ trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBean.java 2008-12-04 16:43:07 UTC (rev 11554)
@@ -0,0 +1,96 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces;
+
+import java.io.Serializable;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ConvertableDemoBean implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6202523836189784862L;
+
+ private String name;
+
+ private int value;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the value
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + value;
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ConvertableDemoBean other = (ConvertableDemoBean) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (value != other.value)
+ return false;
+ return true;
+ }
+
+ public ConvertableDemoBean(String name, int value) {
+ super();
+ this.name = name;
+ this.value = value;
+ }
+
+}
Added: trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java
===================================================================
--- trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java (rev 0)
+++ trunk/samples/orderingListDemo/src/main/java/org/richfaces/ConvertableDemoBeanConverter.java 2008-12-04 16:43:07 UTC (rev 11554)
@@ -0,0 +1,58 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.richfaces;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ConvertableDemoBeanConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+
+ if (value == null || value.length() == 0) {
+ return null;
+ }
+
+ String[] split = value.split(":");
+
+ return new ConvertableDemoBean(split[0], Integer.valueOf(split[1]));
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+
+ if (value == null) {
+ return "";
+ }
+
+ ConvertableDemoBean convertableDemoBean = (ConvertableDemoBean) value;
+ return convertableDemoBean.getName() + ":" + convertableDemoBean.getValue();
+ }
+
+}
Modified: trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-04 16:12:22 UTC (rev 11553)
+++ trunk/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-04 16:43:07 UTC (rev 11554)
@@ -26,5 +26,10 @@
<managed-bean-name>converter</managed-bean-name>
<managed-bean-class>org.richfaces.OptionItemConverter</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
+
+ <converter>
+ <converter-for-class>org.richfaces.ConvertableDemoBean</converter-for-class>
+ <converter-class>org.richfaces.ConvertableDemoBeanConverter</converter-class>
+ </converter>
</faces-config>
Modified: trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2008-12-04 16:12:22 UTC (rev 11553)
+++ trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2008-12-04 16:43:07 UTC (rev 11554)
@@ -227,6 +227,13 @@
</h:column>
</ol:orderingList>
</h:panelGroup>
+
+ <h:panelGroup>
+ <ol:orderingList value="#{bean.genericList}" var="var">
+ <h:column><h:outputText value="#{var.name}" /></h:column>
+ <h:column><h:outputText value="#{var.value}" /></h:column>
+ </ol:orderingList>
+ </h:panelGroup>
</h:panelGrid>
<a4j:commandButton value="Ajax Submit" reRender="orderingList1" />
<h:commandButton value="Add item" action="#{demoBean.addItem}" />
16 years, 10 months
JBoss Rich Faces SVN: r11553 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-04 11:12:22 -0500 (Thu, 04 Dec 2008)
New Revision: 11553
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5155
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-04 15:50:54 UTC (rev 11552)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-04 16:12:22 UTC (rev 11553)
@@ -92,6 +92,10 @@
String currentDateHeaderXpath;
+ String popupButtonId;
+
+ String inputDateId;
+
void initIds(String parentId) {
calendarId = parentId + FORM_ID + "calendar";
calendarHeaderId = calendarId + "Header";
@@ -116,6 +120,8 @@
timeZoneId = parentId + CONTROLS_FORM_ID + "timeZone";
localeId = parentId + CONTROLS_FORM_ID + "locale";
currentDateHeaderXpath = "//td[@id='"+calendarHeaderId+"']/table/tbody/tr/td[3]/div";
+ popupButtonId = calendarId + "PopupButton";
+ inputDateId = calendarId + "InputDate";
}
String getStatus() {
@@ -370,14 +376,53 @@
Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
}
-// @Test
-// public void testValueAndCurrentDateOfCalendarInCaseOfPopupTrue(Template template) {
-// renderPage(template);
-// //1. value != null + curr_date != null
-// //2. value != null + curr_date == null
-// //3. value == null + curr_date == null
-// }
+ @Test
+ public void testValueAndCurrentDateOfCalendarInCaseOfPopupTrue(Template template) {
+ renderPage(template);
+ initIds(getParentId());
+ String expectedSelectedDate = "03/03/2007 11:00";
+ String expectedCurrentDate = "04/04/2008 13:00";
+ setPopup(true);
+ writeStatus("Check that in popup mode currentDate attribute is ignored in all cases");
+
+ //1. value != null + curr_date != null
+ setValueById(selectedDateId, expectedSelectedDate);
+ setValueById(currentDateId, expectedCurrentDate);
+ setup();
+
+ showPopup();
+ writeStatus("Check calendar popup is shown up");
+ Assert.assertTrue(isVisible(calendarId), "Calendar popup is not visible");
+
+ writeStatus("Check selected date");
+ AssertValueEquals(inputDateId, expectedSelectedDate, "Calendar shows wrong date");
+
+ writeStatus("Check current month and year. Remind! Current date has to be ignored. Value date is used instead");
+ String currentDate = selenium.getText(currentDateHeaderXpath);
+ Assert.assertEquals(currentDate, "March, 2007", "Calendar shows wrong current date");
+
+ //2. value == null + curr_date != null
+ setValueById(selectedDateId, "");
+ setValueById(currentDateId, expectedCurrentDate);
+ setup();
+
+ showPopup();
+ writeStatus("Check selected date is empty");
+ AssertValueEquals(inputDateId, "", "Calendar value must be empty");
+
+ writeStatus("Check current month and year. Remind! Current date has to be ignored as before. Value date is empty, present date is used");
+ currentDate = selenium.getText(currentDateHeaderXpath);
+
+ Locale locale = new Locale(selenium.getText(localeId));
+ Date presentTime = Calendar.getInstance(locale).getTime();
+ String month = DateUtils.month(presentTime, locale);
+ int year = DateUtils.year(presentTime);
+ String month_year = month + ", " + year;
+
+ Assert.assertEquals(currentDate, month_year, "Calendar shows wrong current date");
+ }
+
@Test
public void testValueAndCurrentDateOfCalendarWithPopupFalse(Template template) {
renderPage(template, null);
@@ -390,7 +435,7 @@
writeStatus("Check whether the component is present and up to the mark if value and currentDate are defined");
setValueById(selectedDateId, expectedSelectedDate);
setValueById(currentDateId, expectedCurrentDate);
- clickCommandAndWait(setupActionId);
+ setup();
writeStatus("Check calendar panel has been rendered");
Assert.assertTrue(isVisible(calendarId), "Calendar panel is not visible");
@@ -410,7 +455,7 @@
setValueById(selectedDateId, expectedSelectedDate);
setValueById(currentDateId, "");
- clickCommandAndWait(setupActionId);
+ setup();
writeStatus("Check selected date");
date = selenium.getText(dateSelectionXpath);
@@ -426,7 +471,7 @@
writeStatus("Check whether the component is present and up to the mark if value and currentDate are not defined");
setValueById(selectedDateId, "");
setValueById(currentDateId, "");
- clickCommandAndWait(setupActionId);
+ setup();
writeStatus("Selected date is null. Selected value panel is not visible");
Assert.assertFalse(isVisible(dateSelectionXpath), "Footer with selected date has to be invisible");
@@ -448,6 +493,15 @@
runScript("$('" + isPopupId + "').checked=" + isPopup);
}
+ private void setup() {
+ clickCommandAndWait(setupActionId);
+ }
+
+ private void showPopup() {
+ writeStatus("Show popup");
+ clickById(popupButtonId);
+ }
+
public String getTestUrl() {
return "pages/calendar/calendarTest.xhtml";
}
16 years, 10 months
JBoss Rich Faces SVN: r11552 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 10:50:54 -0500 (Thu, 04 Dec 2008)
New Revision: 11552
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-04 15:48:40 UTC (rev 11551)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-04 15:50:54 UTC (rev 11552)
@@ -15,7 +15,7 @@
<version>3.3.0-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<properties>
- <http.port>8085</http.port>
+ <http.port>8080</http.port>
</properties>
<repositories>
<repository>
16 years, 10 months
JBoss Rich Faces SVN: r11551 - in trunk/ui/editor/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-04 10:48:40 -0500 (Thu, 04 Dec 2008)
New Revision: 11551
Modified:
trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
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/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-04 15:43:48 UTC (rev 11550)
+++ trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-04 15:48:40 UTC (rev 11551)
@@ -326,23 +326,23 @@
+ ";\n", null);
}
if (component.getOninit() != null && component.getOninit().length() > 0) {
- writer.writeText("tinyMceParams.oninit = function () {\n"
+ writer.writeText("tinyMceParams.oninit = function (event) {\n"
+ component.getOninit() + "\n" + "};\n", null);
}
if (component.getOnsave() != null && component.getOnsave().length() > 0) {
writer.writeText(
- "tinyMceParams.save_callback = function (element_id, html, body) {\n"
+ "tinyMceParams.save_callback = function (event, element_id, html, body) {\n"
+ component.getOnsave() + "\n" + "};\n", null);
}
if (component.getOnchange() != null
&& component.getOnchange().length() > 0) {
writer.writeText(
- "tinyMceParams.onchange_callback = function (inst) {\n"
+ "tinyMceParams.onchange_callback = function (event, inst) {\n"
+ component.getOnchange() + "\n" + "};\n", null);
}
if (component.getOnsetup() != null
&& component.getOnsetup().length() > 0) {
- writer.writeText("tinyMceParams.setup = function (ed) {\n"
+ writer.writeText("tinyMceParams.setup = function (event, ed) {\n"
+ component.getOnsetup() + "\n" + "};\n", null);
}
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-04 15:43:48 UTC (rev 11550)
+++ trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-12-04 15:48:40 UTC (rev 11551)
@@ -23,13 +23,21 @@
this.synchronizeConfiguration();
this.tinyMCE_editor = null;
- this.onInitInstanceCallbackFunction = this.tinyparams.onInitInstanceCallback;
-
+ this.onInitInstanceCallbackFunction = this.tinyparams.init_instance_callback;
+ this.onChangeCallbackFunction = this.tinyparams.onchange_callback;
+ this.onInitCallbackFunction = this.tinyparams.oninit;
+ this.onSaveCallbackFunction = this.tinyparams.save_callback;
+ this.onSetupCallbackFunction = this.tinyparams.setup;
+
this.tinyparams.mode = 'exact';
this.tinyparams.elements = this.editorTextAreaId;
this.tinyparams.editor_selector = null;
this.tinyparams.editor_deselector = null;
this.tinyparams.init_instance_callback = this.onInitInstanceCallback.bind(this);
+ this.tinyparams.onchange_callback = this.onChangeCallback.bind(this);
+ this.tinyparams.oninit = this.onInitCallback.bind(this);
+ this.tinyparams.save_callback = this.onSaveCallback.bind(this);
+ this.tinyparams.setup = this.onSetupCallback.bind(this);
tinyMCE.init(this.tinyparams);
@@ -56,6 +64,26 @@
if (this.onInitInstanceCallbackFunction) this.onInitInstanceCallbackFunction.call(this, inst);
},
+ onChangeCallback: function(inst) {
+ this.invokeEvent(this.onChangeCallbackFunction, $A(arguments));
+ },
+
+ onInitCallback: function() {
+ this.invokeEvent(this.onInitCallbackFunction, $A(arguments));
+ },
+
+ onSaveCallback: function(element_id, html, body) {
+ if(this.onSaveCallbackFunction){
+ return this.invokeEvent(this.onSaveCallbackFunction, $A(arguments));
+ }else{
+ return html;
+ }
+ },
+
+ onSetupCallback: function(ed) {
+ this.invokeEvent(this.onSetupCallbackFunction, $A(arguments));
+ },
+
synchronizeConfiguration: function(){
if(this.params.useSeamText){
this.tinyparams.plugins = Richfaces.Editor.SeamTextConfiguration.plugins;
@@ -69,9 +97,30 @@
//this.tinyparams.theme_advanced_buttons3 = Richfaces.Editor.SeamTextConfiguration.theme_advanced_buttons3;
//this.tinyparams.theme_advanced_buttons4 = Richfaces.Editor.SeamTextConfiguration.theme_advanced_buttons4;
}
+ },
+
+ invokeEvent: function(callback, args){
+ if (!callback) return;
+ var eventObj;
+ var result;
+
+ if( document.createEventObject ) {
+ eventObj = document.createEventObject();
+ } else if( document.createEvent ) {
+ eventObj = document.createEvent('Events');
+ eventObj.initEvent( callback + 'Event', true, false );
+ }
+
+ eventObj.rich = {component:this, tinyMceInstance: this.tinyMCE_editor};
+ args.unshift(eventObj);
+
+ try {
+ result = callback.apply(this, args);
+ } catch (e) {
+ LOG.warn("Exception: " + e.Message + "\n[on " + callback + " ]");
+ }
+ return result;
}
-
-
});
Richfaces.Editor.SeamTextConfiguration = {
16 years, 10 months
JBoss Rich Faces SVN: r11550 - in trunk/test-applications/jsp/src/main: java/rich and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-04 10:43:48 -0500 (Thu, 04 Dec 2008)
New Revision: 11550
Added:
trunk/test-applications/jsp/src/main/java/tTree/
trunk/test-applications/jsp/src/main/java/tTree/PVisability.java
trunk/test-applications/jsp/src/main/java/tTree/TTree.java
trunk/test-applications/jsp/src/main/java/tTree/TTreeNA.java
trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java
trunk/test-applications/jsp/src/main/java/tTree/data/
trunk/test-applications/jsp/src/main/java/tTree/data/Dir.java
trunk/test-applications/jsp/src/main/java/tTree/data/Package.java
trunk/test-applications/jsp/src/main/java/tTree/data/Project.java
trunk/test-applications/jsp/src/main/java/tTree/pom_sample.xml
trunk/test-applications/jsp/src/main/java/tTree/test.xml
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml
trunk/test-applications/jsp/src/main/webapp/tTree/
trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp
trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp
Modified:
trunk/test-applications/jsp/src/main/java/rich/RichBean.java
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
Modified: trunk/test-applications/jsp/src/main/java/rich/RichBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/rich/RichBean.java 2008-12-04 15:36:47 UTC (rev 11549)
+++ trunk/test-applications/jsp/src/main/java/rich/RichBean.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -74,6 +74,7 @@
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("Queue", add("/Queue/Queue", new boolean [] {false, true, true}));
Iterator<String> iterator = map.getSet().iterator();
while(iterator.hasNext()){
Added: trunk/test-applications/jsp/src/main/java/tTree/PVisability.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/PVisability.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/PVisability.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -0,0 +1,38 @@
+package tTree;
+
+public class PVisability {
+ private boolean tTreeSubviewID;
+ private boolean tTreePropertySubviewID;
+ private boolean tTreeStraightforwardSubviewID;
+
+ public PVisability() {
+ tTreeSubviewID = true;
+ tTreePropertySubviewID = false;
+ tTreeStraightforwardSubviewID = false;
+ }
+
+ 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/jsp/src/main/java/tTree/TTree.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTree.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTree.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/java/tTree/TTreeNA.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTreeNA.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTreeNA.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/java/tTree/TTreeRNA.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/TTreeRNA.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -0,0 +1,47 @@
+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();
+ for (int i = 0; i < 3; i++) {
+ 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 #" + i + " " + j + " " + k));
+ }
+ for (int f = 0; f < 4; f++) {
+ subPackArr.clear();
+ for (int l = 0; l < 5; l++) {
+ subPackArr.add(new Package("subPackage #" + i + " " + j + " "+ f + " " + l));
+ }
+ subDirsArr.add(new Dir("subDir #" + i + " " + j + " " + f, new ArrayList<Package>(subPackArr)));
+ }
+ dirsArr.add(new Dir("dir #" + i + " " + j, new ArrayList<Package>(packArr), new ArrayList<Dir>(subDirsArr)));
+ }
+ }
+ treeRNAroots.addAll(dirsArr);
+ }
+
+ public ArrayList<Dir> getTreeRNAroots() {
+ return treeRNAroots;
+ }
+
+ public void setTreeRNAroots(ArrayList<Dir> treeRNAroots) {
+ this.treeRNAroots = treeRNAroots;
+ }
+}
Added: trunk/test-applications/jsp/src/main/java/tTree/data/Dir.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/data/Dir.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/data/Dir.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/java/tTree/data/Package.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/data/Package.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/data/Package.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/java/tTree/data/Project.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/data/Project.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/data/Project.java 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/java/tTree/pom_sample.xml
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/pom_sample.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/pom_sample.xml 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/java/tTree/test.xml
===================================================================
--- trunk/test-applications/jsp/src/main/java/tTree/test.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/java/tTree/test.xml 2008-12-04 15:43:48 UTC (rev 11550)
@@ -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/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-tTree.xml 2008-12-04 15:43:48 UTC (rev 11550)
@@ -0,0 +1,25 @@
+<?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>
+</faces-config>
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-12-04 15:36:47 UTC (rev 11549)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-12-04 15:43:48 UTC (rev 11550)
@@ -197,7 +197,7 @@
<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/fa!
ces-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-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,!
/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-St
yle.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-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-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/W!
EB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFilter
ing.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>
Added: trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-04 15:43:48 UTC (rev 11550)
@@ -0,0 +1,48 @@
+<%@ 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/rich" prefix="rich"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+
+<f:subview 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:panelGrid>
+ <rich:spacer height="10" />
+
+ <h:panelGrid columns="1" rendered="#{pVisability.tTreeSubviewID}">
+ <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>
+</f:subview>
Added: trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTreeProperty.jsp 2008-12-04 15:43:48 UTC (rev 11550)
@@ -0,0 +1,26 @@
+<%@ 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="tTreePropertySubviewID"
+ rendered="#{pVisability.tTreePropertySubviewID}">
+
+ <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>
+</f:subview>
Added: trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTreeStraightforward.jsp 2008-12-04 15:43:48 UTC (rev 11550)
@@ -0,0 +1,22 @@
+<%@ 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="tTreeStraightforwardSubviewID"
+ rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+
+ <rich:tree>
+ <rich:recursiveTreeNodesAdaptor var="dir" roots="#{tTreeRNA.treeRNAroots}"
+ nodes="#{dir.dirs}">
+ <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:recursiveTreeNodesAdaptor>
+ </rich:tree>
+</f:subview>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r11549 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 10:36:47 -0500 (Thu, 04 Dec 2008)
New Revision: 11549
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 14:42:26 UTC (rev 11548)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-04 15:36:47 UTC (rev 11549)
@@ -59,7 +59,7 @@
/** Specifies the time to wait for ajax processing */
protected static final int ajaxCompletionTime = 3000;
- protected static final String serverPort = "8085";
+ protected static final String serverPort = "8080";
protected static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
16 years, 10 months
JBoss Rich Faces SVN: r11548 - trunk/ui/orderingList/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-04 09:42:26 -0500 (Thu, 04 Dec 2008)
New Revision: 11548
Modified:
trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
Log:
NPE in UIOrderingBaseComponent fixed
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-12-04 14:41:35 UTC (rev 11547)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-12-04 14:42:26 UTC (rev 11548)
@@ -20,7 +20,6 @@
*/
package org.richfaces.component;
-import java.beans.FeatureDescriptor;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
@@ -30,8 +29,6 @@
import java.util.List;
import java.util.Map;
-import javax.el.ELContext;
-import javax.el.ELResolver;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.Application;
@@ -601,14 +598,19 @@
};
public Converter getConverterForValue(FacesContext context) {
+ Converter converter = null;
ValueExpression expression = this.getValueExpression("value");
- Class<?> containerClass = ELUtils.getContainerClass(context, expression);
-
- Converter converter = getConverterForType(context, containerClass);
- if (converter == null && String.class.equals(containerClass)) {
- converter = noOpConverter;
+
+ if (expression != null) {
+ Class<?> containerClass = ELUtils.getContainerClass(context, expression);
+
+ converter = getConverterForType(context, containerClass);
+ if (converter == null && String.class.equals(containerClass)) {
+ converter = noOpConverter;
+ }
}
+
return converter;
}
}
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r11547 - trunk/test-applications/seleniumTest/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-04 09:41:35 -0500 (Thu, 04 Dec 2008)
New Revision: 11547
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
Log:
avoid test running twice
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-04 14:12:13 UTC (rev 11546)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-04 14:41:35 UTC (rev 11547)
@@ -75,7 +75,7 @@
<execution>
<phase>integration-test</phase>
<goals>
- <goal>test</goal>
+ <!--goal>test</goal-->
</goals>
<configuration>
<skip>false</skip>
16 years, 10 months
JBoss Rich Faces SVN: r11546 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-04 09:12:13 -0500 (Thu, 04 Dec 2008)
New Revision: 11546
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
Sub-task RF-5151
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java 2008-12-04 13:38:46 UTC (rev 11545)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java 2008-12-04 14:12:13 UTC (rev 11546)
@@ -40,13 +40,15 @@
int day;
Object data;
+ Calendar calendar;
public CalendarDataModelItemImpl(Date date) {
Map<String, String> data = new HashMap<String, String>();
Calendar c = Calendar.getInstance();
c.setTime(date);
day = c.get(Calendar.DAY_OF_MONTH);
- this.data = data;
+ this.data = data;
+ this.calendar = c;
}
public Object getData() {
@@ -58,7 +60,7 @@
}
public String getStyleClass() {
- return null;
+ return "styleClass" + this.calendar.get(Calendar.MONTH) + day;
}
public Object getToolTip() {
@@ -70,7 +72,7 @@
}
public boolean isEnabled() {
- return true;
+ return day != 13;
}
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-04 13:38:46 UTC (rev 11545)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-04 14:12:13 UTC (rev 11546)
@@ -42,7 +42,7 @@
public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
- public static final Locale LOCALE = new Locale("US");
+ public static final Locale LOCALE = Locale.US;
public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT+2");
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-04 13:38:46 UTC (rev 11545)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-04 14:12:13 UTC (rev 11546)
@@ -33,6 +33,8 @@
import org.testng.Assert;
import org.testng.annotations.Test;
+import com.thoughtworks.selenium.SeleniumException;
+
public class CalendarTest extends SeleniumTestBase {
static final String RESET_METHOD = "#{calendarBean.reset}";
@@ -41,6 +43,8 @@
static final String CONTROLS_FORM_ID = "_controls:";
static final String availableDayCellClass = "rich-calendar-cell-size rich-calendar-cell rich-calendar-btn";
+
+ static final String disabledDayCellClass = "rich-calendar-cell-size rich-calendar-cell rich-calendar-boundary-dates";
String calendarId;
@@ -140,7 +144,7 @@
void changeDate() {
String weekNumId = calendarId + "WeekNum2";
- selenium.click("//tr[@id='" + weekNumId + "']/td[@class='" + availableDayCellClass + "']");
+ selenium.click("//tr[@id='" + weekNumId + "']/td[starts-with(@class, '" + availableDayCellClass + "')]");
}
void changeCurrentDate(boolean wait4ajax) {
@@ -162,7 +166,49 @@
selenium.click(timeSelectionXpath);
}
+ void _testModelDataAppliedToClient() {
+ String currentDate = selenium.getText(dateSelectionXpath);
+ selenium.click("//table[@id='"+calendarId+"']/tbody/tr/td[text() = '13']");
+
+ if (!selenium.getText(dateSelectionXpath).equals(currentDate)) {
+ Assert.fail("Enabled attribute of data model was not applied for client data. 13th day should disabled and should force date change after click.");
+ }
+
+ Calendar c = Calendar.getInstance();
+ c.setTime(new Date());
+ int currentMonth = c.get(Calendar.MONTH);
+
+ String cellDay7StyleClass = selenium.getAttribute("//table[@id='"+calendarId+"']/tbody/tr/td[text() = '7']/@class");
+ String cellDay7ModelClass = "styleClass"+currentMonth+"7";
+ if (cellDay7StyleClass == null || cellDay7StyleClass.indexOf(cellDay7ModelClass) == -1) {
+ Assert.fail("Style class was not applied from data model to cell days. Style class for 7th day should contain [" + cellDay7ModelClass + "]. But has only + [" + cellDay7StyleClass +"]");
+ }
+
+ String cellDay5StyleClass = selenium.getAttribute("//table[@id='"+calendarId+"']/tbody/tr/td[text() = '5']/@class");
+ String cellDay5ModelClass = "styleClass"+currentMonth+"5";
+ if (cellDay5StyleClass == null || cellDay5StyleClass.indexOf(cellDay5ModelClass) == -1) {
+ Assert.fail("Style class was not applied from data model to cell days. Style class for 5th day should contain [" + cellDay5ModelClass + "]. But has only + [" + cellDay5StyleClass +"]");
+ }
+ }
+
@Test
+ public void testDataModelAttribute(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+
+ _testModelDataAppliedToClient();
+
+ try {
+ changeCurrentDate(true);
+ }catch (SeleniumException exception) {
+ Assert.fail("Celendar in ajax mode does not request for the next portion of data after current date has been changed");
+ }
+
+ _testModelDataAppliedToClient();
+
+ }
+
+ @Test
public void testTimeSelection(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -210,7 +256,7 @@
}
- //@Test
+ @Test
public void testListenersInAjaxMode(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -229,7 +275,7 @@
}
- //@Test
+ @Test
public void testListenersInClientMode(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -250,9 +296,9 @@
}
- // @Test
+ //@Test
public void testCalendarComponent(Template template) {
- renderPage(template);
+ renderPage(template);
String containerId = getParentId() + "_form:";
String calendarOpenedId = containerId + "calendar";
16 years, 10 months
JBoss Rich Faces SVN: r11545 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-04 08:38:46 -0500 (Thu, 04 Dec 2008)
New Revision: 11545
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
https://jira.jboss.org/jira/browse/RF-3670
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-12-04 13:08:40 UTC (rev 11544)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-12-04 13:38:46 UTC (rev 11545)
@@ -394,17 +394,17 @@
}
},
- rExpFormElements : /^(?:a|input|select|button|textarea)$/i,
- rExpHidden : /^hidden$/,
+ formElements: "|a|input|select|button|textarea|",
processAllFocusElements: function(root, callback) {
- if (root.focus &&
- // Many not visible elements have focus method, we is had to avoid processing them.
- this.rExpFormElements.test(root.tagName) &&
- !root.disabled && !this.rExpHidden.test(root.type) &&
- root.style.display != 'none') {
-
- callback.call(this, root);
+ if (root.nodeType==1) {
+ var tagName = root.tagName.toLowerCase();
+ if (root.focus &&
+ // Many not visible elements have focus method, we is had to avoid processing them.
+ this.formElements.indexOf(tagName)!=-1 &&
+ !root.disabled && root.type!="hidden") {
+ callback.call(this, root);
+ }
} else {
if (root != this.id) {
var child = root.firstChild;
@@ -419,7 +419,7 @@
},
processTabindexes: function(input) {
- if (!this.firstOutside && !(/^select$/i.test(input.tagName) && ModalPanel.disableSelects)) {
+ if (!this.firstOutside && !(input.tagName.toLowerCase()=="select" && ModalPanel.disableSelects)) {
this.firstOutside = input;
}
this.lastOutside = input;
@@ -880,7 +880,7 @@
var target = Event.element(e);
if (e && target) {
// Concret input but not entire form is a target element for onsubmit in FF
- while (target && !/^form$/i.test(target.tagName)) {
+ while (target && target.tagName.toLowerCase()!="form") {
target = target.parentNode;
}
16 years, 10 months
JBoss Rich Faces SVN: r11544 - trunk/ui/editor/src/main/antlr.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-04 08:08:40 -0500 (Thu, 04 Dec 2008)
New Revision: 11544
Modified:
trunk/ui/editor/src/main/antlr/html-seamtext.g
Log:
https://jira.jboss.org/jira/browse/RF-5108
Modified: trunk/ui/editor/src/main/antlr/html-seamtext.g
===================================================================
--- trunk/ui/editor/src/main/antlr/html-seamtext.g 2008-12-04 12:55:58 UTC (rev 11543)
+++ trunk/ui/editor/src/main/antlr/html-seamtext.g 2008-12-04 13:08:40 UTC (rev 11544)
@@ -456,7 +456,7 @@
| gt:ESCAPED_GT {append(escapeSeamText(gt, preformatted));}
| amp:ESCAPED_AMP {append(escapeSeamText(amp, preformatted));}
| qout:ESCAPED_QOUT {append(escapeSeamText(qout, preformatted));}
- | nbsp:ESCAPED_NBSP {append(nbsp.getText());}
+ | nbsp:ESCAPED_NBSP {append(" ");}
;
eof: EOF;
16 years, 10 months
JBoss Rich Faces SVN: r11543 - trunk/ui/jQuery/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-04 07:55:58 -0500 (Thu, 04 Dec 2008)
New Revision: 11543
Modified:
trunk/ui/jQuery/src/main/templates/jQuery.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4810
Modified: trunk/ui/jQuery/src/main/templates/jQuery.jspx
===================================================================
--- trunk/ui/jQuery/src/main/templates/jQuery.jspx 2008-12-04 12:52:37 UTC (rev 11542)
+++ trunk/ui/jQuery/src/main/templates/jQuery.jspx 2008-12-04 12:55:58 UTC (rev 11543)
@@ -52,7 +52,7 @@
{
var selector = "#{selector}";
try {
- selector = eval("selector}");
+ selector = eval("#{selector}");
} catch (e) {}
jQuery(selector).#{query};
}
16 years, 10 months
JBoss Rich Faces SVN: r11542 - trunk/test-applications/seleniumTest/richfaces/src/test/testng/win.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-04 07:52:37 -0500 (Thu, 04 Dec 2008)
New Revision: 11542
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-12-04 11:24:31 UTC (rev 11541)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-12-04 12:52:37 UTC (rev 11542)
@@ -6,11 +6,7 @@
<parameter name="loadScriptStrategy" value="DEFAULT"/>
<parameter name="filterPrefix" value="/faces/NONE/"/>
<classes>
- <class name="org.richfaces.testng.MessageTest">
- <methods>
- <include name="testHTMLAttributes" />
- </methods>
- </class>
+ <class name="org.richfaces.testng.MessageTest" />
</classes>
</test>
</suite>
16 years, 10 months
JBoss Rich Faces SVN: r11541 - in trunk/ui/hotKey/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-04 06:24:31 -0500 (Thu, 04 Dec 2008)
New Revision: 11541
Modified:
trunk/ui/hotKey/src/main/config/component/hotKey.xml
trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4811
Modified: trunk/ui/hotKey/src/main/config/component/hotKey.xml
===================================================================
--- trunk/ui/hotKey/src/main/config/component/hotKey.xml 2008-12-04 10:37:18 UTC (rev 11540)
+++ trunk/ui/hotKey/src/main/config/component/hotKey.xml 2008-12-04 11:24:31 UTC (rev 11541)
@@ -89,7 +89,6 @@
<name>disableInInputTypes</name>
<classname>java.lang.String</classname>
<description>Defines the types of the inputs not to be influenced with hotKey component. Possible values: buttons, texts and all (default). By default it is empty and this means ALL the types.</description>
- <defaultvalue>"all"</defaultvalue>
</property>
</component>
</components>
Modified: trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
===================================================================
--- trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-12-04 10:37:18 UTC (rev 11540)
+++ trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-12-04 11:24:31 UTC (rev 11541)
@@ -74,6 +74,11 @@
org.richfaces.component.util.MessageUtil.getLabel(context, component) +
"', because value of disableInInput attribute is not 'true'");
}
+ }else if (Boolean.TRUE.equals(disableInInput)) {
+ options.append(",disableInInputTypes:");
+ options.append('\'');
+ options.append(getUtils().escapeJavaScript("all"));
+ options.append('\'');
}
Boolean checkParent = (Boolean) attributes.get("checkParent");
16 years, 10 months
JBoss Rich Faces SVN: r11540 - trunk/samples/editorSeam-sample/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-04 05:37:18 -0500 (Thu, 04 Dec 2008)
New Revision: 11540
Modified:
trunk/samples/editorSeam-sample/src/main/webapp/WEB-INF/web.xml
Log:
use jsf impls from the war bundle
Modified: trunk/samples/editorSeam-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/editorSeam-sample/src/main/webapp/WEB-INF/web.xml 2008-12-04 10:15:51 UTC (rev 11539)
+++ trunk/samples/editorSeam-sample/src/main/webapp/WEB-INF/web.xml 2008-12-04 10:37:18 UTC (rev 11540)
@@ -11,6 +11,10 @@
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
+ <context-param>
+ <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>true</param-value>
+ </context-param>
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
16 years, 10 months
JBoss Rich Faces SVN: r11539 - trunk/framework/impl/src/main/java/org/ajax4jsf/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-04 05:15:51 -0500 (Thu, 04 Dec 2008)
New Revision: 11539
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-04 10:01:06 UTC (rev 11538)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/javascript/JSMin.java 2008-12-04 10:15:51 UTC (rev 11539)
@@ -42,10 +42,9 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PushbackInputStream;
+import org.ajax4jsf.io.FastBufferOutputStream;
-
-
public class JSMin {
private static final int EOF = -1;
@@ -60,7 +59,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 +116,10 @@
in.unread(lookaheadChar);
return lookaheadChar;
}
+
+ void back(byte[] b) throws IOException {
+ in.unread(b);
+ }
/**
* next -- get the next character, excluding comments. peek() is used to see
@@ -133,7 +136,6 @@
return c;
}
}
-
case '*':
get();
for (;;) {
@@ -144,6 +146,14 @@
return ' ';
}
break;
+ case '@':
+ // TODO: add spaces skipping
+ FastBufferOutputStream bs = new FastBufferOutputStream();
+ bs.write('*');
+ bs.write('@');
+ back(bs.toByteArray());
+ bs.close();
+ return c;
case EOF:
throw new UnterminatedCommentException(line,column);
}
16 years, 10 months
JBoss Rich Faces SVN: r11538 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-04 05:01:06 -0500 (Thu, 04 Dec 2008)
New Revision: 11538
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
fixed typos and some stuff added
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-03 22:31:51 UTC (rev 11537)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-04 10:01:06 UTC (rev 11538)
@@ -203,6 +203,7 @@
mode = UICalendar.AJAX_MODE;
status = "";
selectedDate = new Date();
+ isPopup = false;
}
public String resetAction() {
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-03 22:31:51 UTC (rev 11537)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-04 10:01:06 UTC (rev 11538)
@@ -84,7 +84,7 @@
String timeZoneId;
- String localId;
+ String localeId;
String currentDateHeaderXpath;
@@ -110,7 +110,7 @@
isPopupId = parentId + CONTROLS_FORM_ID + "isPopup";
datePatternId = parentId + CONTROLS_FORM_ID + "datePattern";
timeZoneId = parentId + CONTROLS_FORM_ID + "timeZone";
- localId = parentId + CONTROLS_FORM_ID + "local";
+ localeId = parentId + CONTROLS_FORM_ID + "locale";
currentDateHeaderXpath = "//td[@id='"+calendarHeaderId+"']/table/tbody/tr/td[3]/div";
}
@@ -334,10 +334,11 @@
@Test
public void testValueAndCurrentDateOfCalendarWithPopupFalse(Template template) {
- renderPage(template, RESET_METHOD);
+ renderPage(template, null);
initIds(getParentId());
String expectedSelectedDate = "03/03/2007 11:00";
String expectedCurrentDate = "04/04/2008 13:00";
+ setPopup(false);
//1. value != null + curr_date != null
writeStatus("Check whether the component is present and up to the mark if value and currentDate are defined");
@@ -345,6 +346,9 @@
setValueById(currentDateId, expectedCurrentDate);
clickCommandAndWait(setupActionId);
+ writeStatus("Check calendar panel has been rendered");
+ Assert.assertTrue(isVisible(calendarId), "Calendar panel is not visible");
+
writeStatus("Check selected date");
String date = selenium.getText(dateSelectionXpath);
String time = selenium.getText(timeSelectionXpath);
@@ -385,15 +389,19 @@
writeStatus("Check current month and year. Current date and value are not defined. Present (do not mix with current time 8))");
currentDate = selenium.getText(currentDateHeaderXpath);
- Locale locale = new Locale(selenium.getText(localId));
+ Locale locale = new Locale(selenium.getText(localeId));
Date presentTime = Calendar.getInstance(locale).getTime();
String month = DateUtils.month(presentTime, locale);
int year = DateUtils.year(presentTime);
String month_year = month + ", " + year;
- Assert.assertEquals(currentDate, month_year, "Calendar shows wrong current date");
+ Assert.assertEquals(currentDate, month_year, "Calendar shows wrong current date");
}
+ private void setPopup(boolean isPopup) {
+ runScript("$('" + isPopupId + "').checked=" + isPopup);
+ }
+
public String getTestUrl() {
return "pages/calendar/calendarTest.xhtml";
}
16 years, 10 months
JBoss Rich Faces SVN: r11537 - trunk/framework/impl/src/test/java/org/richfaces/json.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-03 17:31:51 -0500 (Wed, 03 Dec 2008)
New Revision: 11537
Added:
trunk/framework/impl/src/test/java/org/richfaces/json/SerializationTest.java
Log:
RF-5040
Added: trunk/framework/impl/src/test/java/org/richfaces/json/SerializationTest.java
===================================================================
--- trunk/framework/impl/src/test/java/org/richfaces/json/SerializationTest.java (rev 0)
+++ trunk/framework/impl/src/test/java/org/richfaces/json/SerializationTest.java 2008-12-03 22:31:51 UTC (rev 11537)
@@ -0,0 +1,111 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.json;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class SerializationTest extends TestCase {
+
+ private <T> T saveRestore(T t) throws IOException, ClassNotFoundException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(t);
+ oos.close();
+
+ ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
+ T restoredT = (T) t.getClass().cast(ois.readObject());
+
+ return restoredT;
+ }
+
+ public void testJSONObject() throws Exception {
+ JSONObject restoredObject = saveRestore(
+ new JSONObject("{a:null, b:'abc', c: {d: 'e', f: 'g'}, h: ['i', 'j']}"));
+
+ assertSame(JSONObject.NULL, restoredObject.get("a"));
+ assertEquals("abc", restoredObject.get("b"));
+
+ JSONObject nestedObject = (JSONObject) restoredObject.get("c");
+ assertEquals("e", nestedObject.get("d"));
+ assertEquals("g", nestedObject.get("f"));
+
+ JSONArray array = (JSONArray) restoredObject.get("h");
+ assertEquals(2, array.length());
+ assertEquals("i", array.get(0));
+ assertEquals("j", array.get(1));
+
+ }
+
+ public void testJSONCollection() throws Exception {
+ JSONCollection restored = saveRestore(new JSONCollection("[1, '2', null, [3, 4], {a: 'b', c: 'd'}]"));
+ Iterator iterator = restored.iterator();
+
+ assertEquals(Integer.valueOf(1), iterator.next());
+ assertEquals("2", iterator.next());
+ assertSame(JSONObject.NULL, iterator.next());
+
+ JSONCollection nestedCollection = (JSONCollection) iterator.next();
+ Iterator nestedIterator = nestedCollection.iterator();
+ assertEquals(Integer.valueOf(3), nestedIterator.next());
+ assertEquals(Integer.valueOf(4), nestedIterator.next());
+ assertFalse(nestedIterator.hasNext());
+
+ JSONMap nestedMap = (JSONMap) iterator.next();
+ assertEquals("b", nestedMap.get("a"));
+ assertEquals("d", nestedMap.get("c"));
+ assertEquals(2, nestedMap.size());
+
+ assertFalse(iterator.hasNext());
+ }
+
+ public void testJSONMap() throws Exception {
+ JSONMap restored = saveRestore(new JSONMap("{a: 'b', c: 3, d: null, e: [5, 'v'], f: {x: 'y', z: 2}}"));
+ assertEquals("b", restored.get("a"));
+ assertEquals(Integer.valueOf(3), restored.get("c"));
+ assertSame(JSONObject.NULL, restored.get("d"));
+
+ JSONCollection nestedCollection = (JSONCollection) restored.get("e");
+ Iterator nestedIterator = nestedCollection.iterator();
+ assertEquals(Integer.valueOf(5), nestedIterator.next());
+ assertEquals("v", nestedIterator.next());
+ assertFalse(nestedIterator.hasNext());
+
+ JSONMap nestedObject = (JSONMap) restored.get("f");
+ assertEquals("y", nestedObject.get("x"));
+ assertEquals(Integer.valueOf(2), nestedObject.get("z"));
+ assertEquals(2, nestedObject.size());
+
+ assertEquals(5, restored.size());
+ }
+}
16 years, 10 months
JBoss Rich Faces SVN: r11536 - in trunk/framework/impl/src/main/java/org: ajax4jsf/el and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-03 17:30:09 -0500 (Wed, 03 Dec 2008)
New Revision: 11536
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/el/
trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java
trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java
trunk/framework/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java
trunk/framework/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/util/ELUtils.java
trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java
Log:
RF-4540
Copied: trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java (from rev 11455, trunk/ui/beanValidator/src/main/java/org/richfaces/validator/ELContextWrapper.java)
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java 2008-12-03 22:30:09 UTC (rev 11536)
@@ -0,0 +1,98 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.el;
+
+import java.util.Locale;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.VariableMapper;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ELContextWrapper extends ELContext {
+
+ private final ELContext parent;
+
+ private final ELResolver resolver;
+
+ /**
+ * @param parent
+ */
+ public ELContextWrapper(ELContext parent,ELResolver resolver) {
+ super();
+ this.resolver = resolver;
+ this.parent = parent;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELContext#getELResolver()
+ */
+ @Override
+ public ELResolver getELResolver() {
+ return resolver;
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getFunctionMapper()
+ */
+ public FunctionMapper getFunctionMapper() {
+ return parent.getFunctionMapper();
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getVariableMapper()
+ */
+ public VariableMapper getVariableMapper() {
+ return parent.getVariableMapper();
+ }
+
+ /**
+ * @param key
+ * @return
+ * @see javax.el.ELContext#getContext(java.lang.Class)
+ */
+ public Object getContext(Class key) {
+ return parent.getContext(key);
+ }
+
+ /**
+ * @param key
+ * @param contextObject
+ * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
+ */
+ public void putContext(Class key, Object contextObject) {
+ parent.putContext(key, contextObject);
+ }
+
+ public Locale getLocale() {
+ return parent.getLocale();
+ }
+
+ public void setLocale(Locale locale) {
+ parent.setLocale(locale);
+ }
+}
Property changes on: trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELContextWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:mergeinfo
+
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/el/ELResolverWrapper.java 2008-12-03 22:30:09 UTC (rev 11536)
@@ -0,0 +1,109 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.Iterator;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class ELResolverWrapper extends ELResolver {
+
+ public ELResolverWrapper(ELResolver resolver) {
+ super();
+ this.resolver = resolver;
+ }
+
+ private ELResolver resolver;
+
+ /**
+ * @param context
+ * @param base
+ * @return
+ * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
+ */
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ return resolver.getCommonPropertyType(context, base);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @return
+ * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
+ */
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
+ Object base) {
+ return resolver.getFeatureDescriptors(context, base);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ return resolver.getType(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ public Object getValue(ELContext context, Object base, Object property) {
+ return resolver.getValue(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ return resolver.isReadOnly(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @param value
+ * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ public void setValue(ELContext context, Object base, Object property,
+ Object value) {
+ resolver.setValue(context, base, property, value);
+ }
+}
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/CapturingELResolver.java 2008-12-03 22:30:09 UTC (rev 11536)
@@ -0,0 +1,71 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.util;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+
+import org.ajax4jsf.el.ELResolverWrapper;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+class CapturingELResolver extends ELResolverWrapper {
+
+ private Object base;
+
+ private Object property;
+
+ public CapturingELResolver(ELResolver resolver) {
+ super(resolver);
+ }
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property) {
+ if (base != null && property != null) {
+ this.base = base;
+ this.property = property;
+ }
+
+ return super.getValue(context, base, property);
+ }
+
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ if (base != null && property != null) {
+ this.base = base;
+ this.property = property;
+ }
+
+ return super.getType(context, base, property);
+ }
+
+ public Object getBase() {
+ return base;
+ }
+
+ public Object getProperty() {
+ return property;
+ }
+}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/util/ELUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/ELUtils.java 2008-12-03 22:29:10 UTC (rev 11535)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/ELUtils.java 2008-12-03 22:30:09 UTC (rev 11536)
@@ -20,6 +20,25 @@
*/
package org.ajax4jsf.util;
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.ref.SoftReference;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collection;
+import java.util.HashMap;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.el.ELContextWrapper;
+import org.ajax4jsf.util.GenericsIntrospectionCache.GenericsCacheEntry;
+
/**
* @author asmirnov
*
@@ -54,4 +73,98 @@
return false;
}
+ private static Class<?> resolveType(Type type) {
+ Class<?> result = Object.class;
+
+ if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ Type[] types = parameterizedType.getActualTypeArguments();
+ if (types != null && types.length != 0) {
+ Type actualType = types[0];
+ if (actualType instanceof Class) {
+ result = (Class<?>) actualType;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private static BeanInfo getBeanInfo(Class<?> beanClass, GenericsCacheEntry entry) {
+ BeanInfo beanInfo = null;
+
+ SoftReference<BeanInfo> beanInfoReference = entry.beanInfoReference;
+ if (beanInfoReference != null) {
+ beanInfo = beanInfoReference.get();
+ }
+
+ if (beanInfo == null) {
+ try {
+ beanInfo = Introspector.getBeanInfo(beanClass);
+ entry.beanInfoReference = new SoftReference<BeanInfo>(beanInfo);
+ } catch (IntrospectionException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ return beanInfo;
+ }
+
+ private static Class<?> getGenericCollectionType(FacesContext context, Object base, String propertyName) {
+ Class<?> genericPropertyClass = null;
+
+ GenericsIntrospectionCache introspectionCache = GenericsIntrospectionCache.getInstance(context);
+ if (base != null && propertyName != null) {
+ Class<? extends Object> beanClass = base.getClass();
+
+ synchronized (introspectionCache) {
+ GenericsCacheEntry cacheEntry = introspectionCache.getGenericCacheEntry(beanClass);
+
+ if (cacheEntry.genericPropertiesClasses == null) {
+ cacheEntry.genericPropertiesClasses = new HashMap<String, Class<?>>();
+ } else {
+ genericPropertyClass = cacheEntry.genericPropertiesClasses.get(propertyName);
+ }
+
+ if (genericPropertyClass == null) {
+ BeanInfo beanInfo = getBeanInfo(beanClass, cacheEntry);
+
+ PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
+ for (PropertyDescriptor pd : descriptors) {
+ if (propertyName.equals(pd.getName())) {
+ Method readMethod = pd.getReadMethod();
+
+ genericPropertyClass = resolveType(readMethod.getGenericReturnType());
+ break;
+ }
+ }
+
+ cacheEntry.genericPropertiesClasses.put(propertyName, genericPropertyClass);
+ }
+ }
+ }
+
+ return genericPropertyClass;
+ }
+
+ public static Class<?> getContainerClass(FacesContext facesContext, ValueExpression expression) {
+ ELContext initialELContext = facesContext.getELContext();
+
+ CapturingELResolver capturingELResolver = new CapturingELResolver(initialELContext.getELResolver());
+ Class<?> type = expression.getType(new ELContextWrapper(initialELContext, capturingELResolver));
+
+ Class<?> containerType = type.getComponentType();
+ if (containerType == null && type != null) {
+ if (Collection.class.isAssignableFrom(type)) {
+ Object base = capturingELResolver.getBase();
+ Object property = capturingELResolver.getProperty();
+
+ if (base != null && property != null) {
+ containerType = getGenericCollectionType(facesContext, base, property.toString());
+ }
+ }
+ }
+
+ return containerType;
+ }
}
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java 2008-12-03 22:30:09 UTC (rev 11536)
@@ -0,0 +1,101 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.util;
+
+import java.beans.BeanInfo;
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.Map;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.util.ReferenceMap;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+class GenericsIntrospectionCache {
+
+ private static final String INSTANCE_ATTRIBUTE_NAME = GenericsIntrospectionCache.class.getName();
+
+ private static final String CACHE_SIZE_PARAMETER = "org.richfaces.GenericsIntrospectionCacheSize";
+
+ private static final int DEFAULT_CACHE_SIZE = 256;
+
+ static final class GenericsCacheEntry {
+ SoftReference<BeanInfo> beanInfoReference;
+ Map<String, Class<?>> genericPropertiesClasses;
+ };
+
+ private Map<Class<?>, GenericsCacheEntry> genericsCache;
+
+ private static int getSize(ExternalContext externalContext) {
+ int cacheSize = DEFAULT_CACHE_SIZE;
+
+ String cacheSizeParameter = externalContext.getInitParameter(CACHE_SIZE_PARAMETER);
+ if (cacheSizeParameter != null && cacheSizeParameter.length() != 0) {
+ try {
+ cacheSize = Integer.valueOf(cacheSizeParameter);
+ } catch (NumberFormatException e) {
+ externalContext.log("Error converting " + CACHE_SIZE_PARAMETER + " init parameter to int: " + e.getMessage(),
+ e);
+ }
+ }
+
+ return cacheSize;
+ }
+
+ private GenericsIntrospectionCache(int cacheSize) {
+ genericsCache = new ReferenceMap<Class<?>, GenericsCacheEntry>(
+ new LRUMap<Class<?>, Reference<GenericsCacheEntry>>(cacheSize));
+ }
+
+ public GenericsCacheEntry getGenericCacheEntry(Class<?> beanClass) {
+ GenericsCacheEntry cacheEntry = genericsCache.get(beanClass);
+ if (cacheEntry == null) {
+ cacheEntry = new GenericsCacheEntry();
+ genericsCache.put(beanClass, cacheEntry);
+ }
+
+ return cacheEntry;
+ }
+
+ static GenericsIntrospectionCache getInstance(FacesContext facesContext) {
+ ExternalContext externalContext = facesContext.getExternalContext();
+ Map<String, Object> applicationMap = externalContext.getApplicationMap();
+
+ GenericsIntrospectionCache instance;
+ synchronized (applicationMap) {
+ instance = (GenericsIntrospectionCache) applicationMap.get(INSTANCE_ATTRIBUTE_NAME);
+ if (instance == null) {
+ instance = new GenericsIntrospectionCache(getSize(externalContext));
+ applicationMap.put(INSTANCE_ATTRIBUTE_NAME, instance);
+ }
+ }
+
+ return instance;
+ }
+
+}
Modified: trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2008-12-03 22:29:10 UTC (rev 11535)
+++ trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2008-12-03 22:30:09 UTC (rev 11536)
@@ -37,123 +37,138 @@
public class ReferenceMap<K, V> implements Map<K, V> {
- private Map<K, ReferenceMapSoftReference<K, V>> map = new HashMap<K, ReferenceMapSoftReference<K, V>>();
+ private Map<K, Reference<V>> map;
- private ReferenceQueue<V> queue = new ReferenceQueue<V>();
-
- private void purge() {
- Reference<? extends V> reference = null;
- while ((reference = queue.poll()) != null) {
- ReferenceMapSoftReference<?, ?> entry = (ReferenceMapSoftReference<?, ?>) reference;
- entry.clear();
- map.remove(entry.getKey());
+ private ReferenceQueue<V> queue = new ReferenceQueue<V>();
+
+ protected static class ReferenceMapSoftReference<K, V> extends SoftReference<V> {
+ private K key;
+
+ public K getKey() {
+ return key;
+ }
+
+ public ReferenceMapSoftReference(K key, V value, ReferenceQueue<? super V> queue) {
+ super(value, queue);
+ this.key = key;
+ }
+ }
+
+ public ReferenceMap() {
+ this(new HashMap<K, Reference<V>>());
}
- }
-
- public void clear() {
- map.clear();
- while (queue.poll() != null) {
- //release queue entries
+
+ public ReferenceMap(Map<K, Reference<V>> map) {
+ super();
+
+ this.map = map;
}
- }
-
- public boolean containsKey(Object key) {
- purge();
- return map.containsKey(key);
- }
+ private void purge() {
+ Reference<? extends V> reference = null;
+ while ((reference = queue.poll()) != null) {
+ ReferenceMapSoftReference<?, ?> entry = (ReferenceMapSoftReference<?, ?>) reference;
+ entry.clear();
+ map.remove(entry.getKey());
+ }
+ }
- public boolean containsValue(Object value) {
- throw new UnsupportedOperationException();
- }
+ public void clear() {
+ map.clear();
+
+ Reference<? extends V> reference = null;
+ while ((reference = queue.poll()) != null) {
+ //release queue entries
+ reference.clear();
+ }
+ }
- public Set<java.util.Map.Entry<K, V>> entrySet() {
- throw new UnsupportedOperationException();
- }
+ public boolean containsKey(Object key) {
+ purge();
- public V get(Object key) {
- purge();
-
- ReferenceMapSoftReference<K,V> reference = map.get(key);
- if (reference != null) {
- return reference.get();
+ return map.containsKey(key);
}
-
- return null;
- }
- public boolean isEmpty() {
- purge();
-
- return map.isEmpty();
- }
+ public boolean containsValue(Object value) {
+ throw new UnsupportedOperationException();
+ }
- public Set<K> keySet() {
- purge();
-
- return map.keySet();
- }
+ public Set<java.util.Map.Entry<K, V>> entrySet() {
+ throw new UnsupportedOperationException();
+ }
- private V doPut(K key, V value) {
- ReferenceMapSoftReference<K,V> reference = map.put(key,
- new ReferenceMapSoftReference<K, V>(key, value, queue));
-
- if (reference != null) {
- return reference.get();
+ public V get(Object key) {
+ purge();
+
+ Reference<V> reference = map.get(key);
+ if (reference != null) {
+ return reference.get();
+ }
+
+ return null;
}
-
- return null;
- }
-
- public V put(K key, V value) {
- purge();
-
- return doPut(key, value);
- }
- public void putAll(Map<? extends K, ? extends V> t) {
- purge();
-
- for (Map.Entry<? extends K, ? extends V> entry: t.entrySet()) {
- doPut(entry.getKey(), entry.getValue());
+ public boolean isEmpty() {
+ purge();
+
+ return map.isEmpty();
}
- }
- public V remove(Object key) {
- purge();
-
- ReferenceMapSoftReference<K,V> reference = map.remove(key);
- if (reference != null) {
- return reference.get();
+ public Set<K> keySet() {
+ purge();
+
+ return map.keySet();
}
- return null;
- }
+ private V doPut(K key, V value) {
+ Reference<V> reference = map.put(key, new ReferenceMapSoftReference<K, V>(key, value, queue));
- public int size() {
- purge();
+ if (reference != null) {
+ return reference.get();
+ }
+
+ return null;
+ }
+
+ public V put(K key, V value) {
+ purge();
+
+ V v = doPut(key, value);
- return map.size();
- }
+ purge();
+
+ return v;
+ }
- public Collection<V> values() {
- throw new UnsupportedOperationException();
- }
-}
+ public void putAll(Map<? extends K, ? extends V> t) {
+ purge();
-class ReferenceMapSoftReference<K, V> extends SoftReference<V> {
- private K key;
+ for (Map.Entry<? extends K, ? extends V> entry: t.entrySet()) {
+ doPut(entry.getKey(), entry.getValue());
+ }
+
+ purge();
+ }
- public K getKey() {
- return key;
- }
+ public V remove(Object key) {
+ purge();
- public ReferenceMapSoftReference(K key, V value) {
- this(key, value, null);
- }
+ Reference<V> reference = map.remove(key);
+ if (reference != null) {
+ return reference.get();
+ }
- public ReferenceMapSoftReference(K key, V value, ReferenceQueue<? super V> queue) {
- super(value, queue);
- this.key = key;
- }
+ return null;
+ }
+
+ public int size() {
+ purge();
+
+ return map.size();
+ }
+
+ public Collection<V> values() {
+ throw new UnsupportedOperationException();
+ }
+
}
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r11535 - in trunk/ui: listShuttle/src/main/java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-03 17:29:10 -0500 (Wed, 03 Dec 2008)
New Revision: 11535
Removed:
trunk/ui/beanValidator/src/main/java/org/richfaces/validator/ELContextWrapper.java
Modified:
trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
Log:
RF-4540
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -36,6 +36,7 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.el.ELContextWrapper;
import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.InvalidValue;
Deleted: trunk/ui/beanValidator/src/main/java/org/richfaces/validator/ELContextWrapper.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/validator/ELContextWrapper.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/validator/ELContextWrapper.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -1,98 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.validator;
-
-import java.util.Locale;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.el.FunctionMapper;
-import javax.el.VariableMapper;
-
-/**
- * @author asmirnov
- *
- */
-public class ELContextWrapper extends ELContext {
-
- private final ELContext parent;
-
- private final ELResolver resolver;
-
- /**
- * @param parent
- */
- public ELContextWrapper(ELContext parent,ELResolver resolver) {
- super();
- this.resolver = resolver;
- this.parent = parent;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELContext#getELResolver()
- */
- @Override
- public ELResolver getELResolver() {
- return resolver;
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getFunctionMapper()
- */
- public FunctionMapper getFunctionMapper() {
- return parent.getFunctionMapper();
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getVariableMapper()
- */
- public VariableMapper getVariableMapper() {
- return parent.getVariableMapper();
- }
-
- /**
- * @param key
- * @return
- * @see javax.el.ELContext#getContext(java.lang.Class)
- */
- public Object getContext(Class key) {
- return parent.getContext(key);
- }
-
- /**
- * @param key
- * @param contextObject
- * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
- */
- public void putContext(Class key, Object contextObject) {
- parent.putContext(key, contextObject);
- }
-
- public Locale getLocale() {
- return parent.getLocale();
- }
-
- public void setLocale(Locale locale) {
- parent.setLocale(locale);
- }
-}
Modified: trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -30,6 +30,7 @@
import java.util.Set;
import java.util.Map.Entry;
+import javax.el.ValueExpression;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
@@ -793,6 +794,15 @@
return super.getValueBinding(name);
}
+ @Override
+ public ValueExpression getValueExpression(String name) {
+ if ("value".equals(name)) {
+ return super.getValueExpression("sourceValue");
+ }
+
+ return super.getValueExpression(name);
+ }
+
public void setValue(Object value) {
this.valueHolder = (ValueHolder) value;
}
Modified: trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
===================================================================
--- trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -113,7 +113,7 @@
ResponseWriter writer = context.getResponseWriter();
StringWriter stringWriter = new StringWriter();
context.setResponseWriter(writer.cloneWithWriter(stringWriter));
- encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, getConverter(context, shuttle), source));
+ encodeRows(context, shuttle, new ListShuttleRendererTableHolder(shuttle, getConverter(context, shuttle, true), source));
context.getResponseWriter().flush();
context.setResponseWriter(writer);
@@ -322,7 +322,7 @@
boolean facadeSource = true;
- Converter converter = getConverter(context, listShuttle);
+ Converter converter = getConverter(context, listShuttle, false);
for (int i = 0; i < strings.length; i++) {
String string = strings[i];
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -20,6 +20,7 @@
*/
package org.richfaces.component;
+import java.beans.FeatureDescriptor;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
@@ -29,6 +30,9 @@
import java.util.List;
import java.util.Map;
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
@@ -41,7 +45,6 @@
import javax.faces.convert.ConverterException;
import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
import javax.faces.model.ArrayDataModel;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
@@ -51,6 +54,7 @@
import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.model.DataComponentState;
import org.ajax4jsf.model.RepeatState;
+import org.ajax4jsf.util.ELUtils;
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.iterators.EmptyIterator;
import org.apache.commons.collections.iterators.FilterIterator;
@@ -584,21 +588,27 @@
return null;
}
+ private static final Converter noOpConverter = new Converter() {
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ return value;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ return (String) value;
+ }
+ };
+
public Converter getConverterForValue(FacesContext context) {
- ValueBinding binding = this.getValueBinding("value");
- if (binding != null) {
- Class type = binding.getType(context);
- if (type != null) {
- Class componentType = type.getComponentType();
- if (componentType != null) {
- return getConverterForType(context, componentType);
- } else {
- //support for generics introspection
- }
- }
+ ValueExpression expression = this.getValueExpression("value");
+ Class<?> containerClass = ELUtils.getContainerClass(context, expression);
+
+ Converter converter = getConverterForType(context, containerClass);
+ if (converter == null && String.class.equals(containerClass)) {
+ converter = noOpConverter;
}
- return null;
+ return converter;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingComponentRendererBase.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -45,6 +45,7 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIOrderingBaseComponent;
import org.richfaces.component.UIOrderingBaseComponent.ItemState;
+import org.richfaces.component.util.MessageUtil;
/**
* @author Nick Belaevski
@@ -566,7 +567,7 @@
}
protected Converter getConverter(FacesContext context,
- UIOrderingBaseComponent component) {
+ UIOrderingBaseComponent component, boolean warnOnDefaultConverter) {
Converter converter = component.getConverter();
if (converter == null) {
@@ -575,6 +576,13 @@
if (converter == null) {
converter = DEFAULT_CONVERTER;
+
+ if (warnOnDefaultConverter) {
+ Object componentLabel = MessageUtil.getLabel(context, component);
+ context.getExternalContext().log("Converter for component [" + componentLabel +
+ "] cannot be discovered, so default implementation of converter will be used." +
+ " Component items will be converted to String on decoding.");
+ }
}
return converter;
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2008-12-03 18:59:50 UTC (rev 11534)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2008-12-03 22:29:10 UTC (rev 11535)
@@ -128,8 +128,10 @@
public void encodeRows(FacesContext context, UIComponent component)
throws IOException {
- super.encodeRows(context, component, new OrderingListRendererTableHolder((UIDataAdaptor) component,
- getConverter(context, (UIOrderingBaseComponent) component)));
+ UIOrderingBaseComponent orderingBaseComponent = (UIOrderingBaseComponent) component;
+
+ super.encodeRows(context, component, new OrderingListRendererTableHolder(orderingBaseComponent,
+ getConverter(context, orderingBaseComponent, true)));
}
public void encodeOneRow(FacesContext context, TableHolder holder)
@@ -255,7 +257,7 @@
Object activeItem = null;
String[] strings = (String[]) externalContext.getRequestParameterValuesMap().get(clientId);
Map map = new LinkedHashMap();
- Converter converter = getConverter(context, orderingList);
+ Converter converter = getConverter(context, orderingList, false);
for (int i = 0; i < strings.length; i++) {
String string = strings[i];
int idx = string.indexOf(':');
16 years, 10 months
JBoss Rich Faces SVN: r11534 - in trunk/test-applications/seleniumTest/richfaces/src: main/java/org/ajax4jsf/util and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-03 13:59:50 -0500 (Wed, 03 Dec 2008)
New Revision: 11534
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/util/DateUtils.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5153
https://jira.jboss.org/jira/browse/RF-5154
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-03 18:38:11 UTC (rev 11533)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-03 18:59:50 UTC (rev 11534)
@@ -93,7 +93,11 @@
}
public void resetSelectedDateString() {
- setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
+ if (getSelectedDate() != null) {
+ setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
+ } else {
+ setSelectedDateString("");
+ }
}
public String getSelectedDateString() {
@@ -251,4 +255,22 @@
this.currentDate = currentDate;
}
+ private boolean isPopup;
+
+ /**
+ * Gets value of isPopup field.
+ * @return value of isPopup field
+ */
+ public boolean isPopup() {
+ return isPopup;
+ }
+
+ /**
+ * Set a new value for isPopup field.
+ * @param isPopup a new value for isPopup field
+ */
+ public void setPopup(boolean isPopup) {
+ this.isPopup = isPopup;
+ }
+
}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/util/DateUtils.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/util/DateUtils.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/util/DateUtils.java 2008-12-03 18:59:50 UTC (rev 11534)
@@ -0,0 +1,44 @@
+package org.ajax4jsf.util;
+
+import java.text.DateFormatSymbols;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+public abstract class DateUtils {
+
+ /**
+ * Returns <code>Date</code> object according to given <code>dateString</code>
+ * @param dateString
+ * @param pattern
+ * @param locale
+ * @return
+ */
+ public static Date date(String dateString, String pattern, Locale locale) {
+ Date retVal = null;
+ try {
+ retVal = new SimpleDateFormat(pattern, locale).parse(dateString);
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return retVal;
+ }
+
+ public static String month(Date date, Locale locale) {
+ Calendar c = Calendar.getInstance(locale);
+ c.setTime(date);
+ DateFormatSymbols symbols = new DateFormatSymbols(locale);
+ return symbols.getMonths()[c.get(Calendar.MONTH)];
+ }
+
+ public static int year(Date date) {
+ Calendar c = Calendar.getInstance();
+ c.setTime(date);
+ return c.get(Calendar.YEAR);
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/util/DateUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-03 18:38:11 UTC (rev 11533)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-03 18:59:50 UTC (rev 11534)
@@ -22,10 +22,13 @@
package org.richfaces.testng;
import java.text.ParseException;
+import java.util.Calendar;
import java.util.Date;
+import java.util.Locale;
import org.ajax4jsf.bean.CalendarTestBean;
import org.ajax4jsf.template.Template;
+import org.ajax4jsf.util.DateUtils;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -33,13 +36,12 @@
public class CalendarTest extends SeleniumTestBase {
static final String RESET_METHOD = "#{calendarBean.reset}";
-
static final String FORM_ID = "_form:";
static final String CONTROLS_FORM_ID = "_controls:";
static final String availableDayCellClass = "rich-calendar-cell-size rich-calendar-cell rich-calendar-btn";
-
+
String calendarId;
String calendarHeaderId;
@@ -55,9 +57,15 @@
String resetActionId;
String testClientModeId;
-
+
+ String setupActionId;
+
+ String dateSelectionXpath;
+
String timeSelectionXpath;
-
+
+ String timeSelectionXpathMinusDiv;
+
String timeHoursSelectionId;
String timeMinutesSelectionId;
@@ -66,20 +74,44 @@
String timeSelectionCancelButtonId;
+ String selectedDateId;
+
+ String currentDateId;
+
+ String isPopupId;
+
+ String datePatternId;
+
+ String timeZoneId;
+
+ String localId;
+
+ String currentDateHeaderXpath;
+
void initIds(String parentId) {
calendarId = parentId + FORM_ID + "calendar";
calendarHeaderId = calendarId + "Header";
calendarFooterId = calendarId + "Footer";
+ dateSelectionXpath = "//td[@id='"+calendarFooterId+"']/table/tbody/tr/td[1]";
+ timeSelectionXpathMinusDiv = "//td[@id='"+calendarFooterId+"']/table/tbody/tr/td[3]";
timeSelectionXpath = "//td[@id='"+calendarFooterId+"']/table/tbody/tr/td[3]/div";
ajaxSubmitId = parentId + FORM_ID + "ajaxSubmit";
serverSubmitId = parentId + FORM_ID + "serverSubmit";
statusId = parentId + FORM_ID + "status";
resetActionId = parentId + CONTROLS_FORM_ID + "resetAction";
testClientModeId = parentId + CONTROLS_FORM_ID + "testClientMode";
+ setupActionId = parentId + CONTROLS_FORM_ID + "setup";
timeHoursSelectionId = calendarId + "TimeHours";
timeMinutesSelectionId = calendarId + "TimeMinutes";
timeSelectionOkButtonId = calendarId + "TimeEditorButtonOk";
timeSelectionCancelButtonId = calendarId + "TimeEditorButtonCancel";
+ selectedDateId = parentId + CONTROLS_FORM_ID + "selectedDate";
+ currentDateId = parentId + CONTROLS_FORM_ID + "currentDate";
+ isPopupId = parentId + CONTROLS_FORM_ID + "isPopup";
+ datePatternId = parentId + CONTROLS_FORM_ID + "datePattern";
+ timeZoneId = parentId + CONTROLS_FORM_ID + "timeZone";
+ localId = parentId + CONTROLS_FORM_ID + "local";
+ currentDateHeaderXpath = "//td[@id='"+calendarHeaderId+"']/table/tbody/tr/td[3]/div";
}
String getStatus() {
@@ -292,6 +324,76 @@
Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
}
+// @Test
+// public void testValueAndCurrentDateOfCalendarInCaseOfPopupTrue(Template template) {
+// renderPage(template);
+// //1. value != null + curr_date != null
+// //2. value != null + curr_date == null
+// //3. value == null + curr_date == null
+// }
+
+ @Test
+ public void testValueAndCurrentDateOfCalendarWithPopupFalse(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+ String expectedSelectedDate = "03/03/2007 11:00";
+ String expectedCurrentDate = "04/04/2008 13:00";
+
+ //1. value != null + curr_date != null
+ writeStatus("Check whether the component is present and up to the mark if value and currentDate are defined");
+ setValueById(selectedDateId, expectedSelectedDate);
+ setValueById(currentDateId, expectedCurrentDate);
+ clickCommandAndWait(setupActionId);
+
+ writeStatus("Check selected date");
+ String date = selenium.getText(dateSelectionXpath);
+ String time = selenium.getText(timeSelectionXpath);
+ String date_time = date + " " + time;
+ Assert.assertEquals(date_time, expectedSelectedDate, "Calendar shows wrong date");
+
+ writeStatus("Check current month and year");
+ String currentDate = selenium.getText(currentDateHeaderXpath);
+ Assert.assertEquals(currentDate, "April, 2008", "Calendar shows wrong current date");
+
+ //2. value != null + curr_date == null
+ writeStatus("Check whether the component is present and up to the mark if value is given but currentDate is not");
+
+ setValueById(selectedDateId, expectedSelectedDate);
+ setValueById(currentDateId, "");
+ clickCommandAndWait(setupActionId);
+
+ writeStatus("Check selected date");
+ date = selenium.getText(dateSelectionXpath);
+ time = selenium.getText(timeSelectionXpath);
+ date_time = date + " " + time;
+ Assert.assertEquals(date_time, expectedSelectedDate, "Calendar shows wrong date");
+
+ writeStatus("Check current month and year. Current date is not specified. Value date will be used instead");
+ currentDate = selenium.getText(currentDateHeaderXpath);
+ Assert.assertEquals(currentDate, "March, 2007", "Calendar shows wrong current date");
+
+ //3. value == null + curr_date == null
+ writeStatus("Check whether the component is present and up to the mark if value and currentDate are not defined");
+ setValueById(selectedDateId, "");
+ setValueById(currentDateId, "");
+ clickCommandAndWait(setupActionId);
+
+ writeStatus("Selected date is null. Selected value panel is not visible");
+ Assert.assertFalse(isVisible(dateSelectionXpath), "Footer with selected date has to be invisible");
+ Assert.assertFalse(isVisible(timeSelectionXpathMinusDiv), "Footer with selected date has to be invisible");
+
+ writeStatus("Check current month and year. Current date and value are not defined. Present (do not mix with current time 8))");
+ currentDate = selenium.getText(currentDateHeaderXpath);
+
+ Locale locale = new Locale(selenium.getText(localId));
+ Date presentTime = Calendar.getInstance(locale).getTime();
+ String month = DateUtils.month(presentTime, locale);
+ int year = DateUtils.year(presentTime);
+ String month_year = month + ", " + year;
+
+ Assert.assertEquals(currentDate, month_year, "Calendar shows wrong current date");
+ }
+
public String getTestUrl() {
return "pages/calendar/calendarTest.xhtml";
}
16 years, 10 months