JBoss Rich Faces SVN: r7238 - trunk/framework/impl/src/main/javascript/prototype.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-25 20:16:39 -0400 (Tue, 25 Mar 2008)
New Revision: 7238
Modified:
trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js
Log:
http://jira.jboss.com/jira/browse/RF-2753
Modified: trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js
===================================================================
--- trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js 2008-03-25 20:05:53 UTC (rev 7237)
+++ trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js 2008-03-26 00:16:39 UTC (rev 7238)
@@ -2084,7 +2084,8 @@
if (element.offsetParent) return $(element.offsetParent);
if (element == document.body) return $(element);
- while ((element = element.parentNode) && element != document.body)
+ while ((element = element.parentNode) && element != document.body
+ && Object.isElement(element)/* changed by Nick - http://dev.rubyonrails.org/ticket/11007 */)
if (Element.getStyle(element, 'position') != 'static')
return $(element);
16 years, 9 months
JBoss Rich Faces SVN: r7237 - Reports/3.2.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-03-25 16:05:53 -0400 (Tue, 25 Mar 2008)
New Revision: 7237
Added:
trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR525032008mvitenkov.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR525032008mvitenkov.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR525032008mvitenkov.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
JBoss Rich Faces SVN: r7236 - trunk/ui/suggestionbox/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-25 16:00:55 -0400 (Tue, 25 Mar 2008)
New Revision: 7236
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
Log:
http://jira.jboss.com/jira/browse/RF-2576
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-25 19:24:14 UTC (rev 7235)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-25 20:00:55 UTC (rev 7236)
@@ -423,19 +423,24 @@
FacesContext context = getFacesContext();
setupValue(context);
- Object modelValues = getModelValuesData();
- Object requestedData = getRequestedValuesData();
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if (null != modelValues || null != requestedData) {
- Map<String,Object> map = new HashMap<String, Object>();
- map.put("suggestionObjects", modelValues);
-
- if (requestedData != null) {
- map.put("requestedObjects", requestedData);
+
+ if (this.isUsingSuggestObjects()) {
+ Object modelValues = getModelValuesData();
+ Object requestedData = getRequestedValuesData();
+
+ if (null != modelValues || null != requestedData) {
+ Map<String,Object> map = new HashMap<String, Object>();
+ map.put("suggestionObjects", modelValues);
+
+ if (requestedData != null) {
+ map.put("requestedObjects", requestedData);
+ }
+
+ ajaxContext.setResponseData(map);
}
-
- ajaxContext.setResponseData(map);
}
+
AjaxRendererUtils.addRegionsFromComponent(this, context);
AjaxRendererUtils.addRegionByName(context, this, this.getId());
// setSubmitted(true);
16 years, 9 months
JBoss Rich Faces SVN: r7235 - trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-03-25 15:24:14 -0400 (Tue, 25 Mar 2008)
New Revision: 7235
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
[RF-2756] fileUpload: onupload event can't be handled
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-03-25 19:17:35 UTC (rev 7234)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-25 19:24:14 UTC (rev 7235)
@@ -492,11 +492,12 @@
for (var e in this.events) {
if (e && this.events[e]) {
if(e == 'onupload') {
- this.element.observe("rich:" + e, function(event) {
- if(this.events[e](event) !== false) {
- this._upload();
- }
- }.bindAsEventListener(this));
+ this.element.observe("rich:" + e, (function (handler) {
+ return function(event) {
+ if(handler(event) !== false) {
+ event.memo.entry.upload();
+ }
+ }.bind(this);}.bind(this))(this.events[e]));
} else {
this.element.observe("rich:" + e, this.events[e]);
}
@@ -564,7 +565,7 @@
newUpload.id = this.id + ":file" + (this.idCounter++);
this.currentInput = newUpload;
elt.parentNode.appendChild(newUpload);
-
+
if (this.runUpload) {
this.upload();
}
@@ -593,26 +594,22 @@
upload: function() {
if (this.disabled) return;
- if(this.events.onupload) {
- this.element.fire("rich:onupload", {});
- } else {
- this._upload();
- }
- },
-
- _upload: function() {
this.runUpload = true;
if (!this.activeEntry) {
//no upload is being run now
-
- var entry = this._selectEntryForUpload();
- if (entry) {
- entry.upload();
+
+ var entry2upload = this._selectEntryForUpload();
+ if (entry2upload) {
+ if(this.events.onupload) {
+ this.element.fire("rich:onupload", {entry : entry2upload});
+ } else {
+ entry2upload.upload();
+ }
}
}
},
-
+
stop: function() {
if (this.disabled) return;
this.runUpload = false;
@@ -742,7 +739,7 @@
if (this.disabled) {
d1.onclick = function() {return false;};
}else {
- d1.onclick = function() {return this.upload();}.bind(this);
+ d1.onclick = function() { return this.upload();}.bind(this);
}
this._updateClassNames(d1, d2, (this.runUpload) ? this.classes.CANCEL : this.classes.UPDATE, (this.runUpload) ? this.classes.CANCEL_CONTENT : this.classes.UPDATE_CONTENT);
},
16 years, 9 months
JBoss Rich Faces SVN: r7234 - trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-25 15:17:35 -0400 (Tue, 25 Mar 2008)
New Revision: 7234
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
RF-2683: inplaceSelect should be selectOne
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-25 19:17:31 UTC (rev 7233)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-25 19:17:35 UTC (rev 7234)
@@ -136,7 +136,7 @@
}
if (!this.attributes.showControls) {
- this.save();
+ this.saveValue();
}
},
@@ -150,7 +150,7 @@
this.tempValueKeeper.blur();
break;
case Event.KEY_TAB :
- this.save();
+ this.saveValue();
this.byTab = true;
break;
}
@@ -161,7 +161,7 @@
},*/
okHandler : function(e) {
- this.save();
+ this.saveValue();
Event.stop(e);
},
@@ -276,8 +276,13 @@
}
},
- save : function() {
+ saveValue : function() {
var userValue = this.tempValueKeeper.value;
+ var currentText = userValue;
+ this.save(userValue, currentText);
+ },
+
+ save : function(userValue, currentText) {
var value = this.valueKeeper.value;
if (this.events.onviewactivation) {
this.inplaceInput.fire("rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value});
@@ -288,7 +293,7 @@
this.valueKeeper.value = "";
//this.startViewState();
} else {
- this.currentText = userValue;
+ this.currentText = currentText;
this.valueKeeper.value = userValue;
}
if (userValue != this.value) {
16 years, 9 months
JBoss Rich Faces SVN: r7233 - in trunk/ui/inplaceSelect/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-25 15:17:31 -0400 (Tue, 25 Mar 2008)
New Revision: 7233
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
RF-2683: inplaceSelect should be selectOne
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-03-25 19:04:36 UTC (rev 7232)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-03-25 19:17:31 UTC (rev 7233)
@@ -32,6 +32,8 @@
private static Log logger = LogFactory.getLog(InplaceSelectBaseRenderer.class);
private static final String RICH_INPLACE_SELECT_CLASSES = "rich-inplace-select-item rich-inplace-select-font";
private static final String CONTROLS_FACET = "controls";
+
+ private JSONArray jsonParentArray;
@Override
@@ -69,7 +71,7 @@
public void encodeItems(FacesContext context, UIComponent component) throws IOException {
List <String> labels = new ArrayList<String>();
ResponseWriter writer = context.getResponseWriter();
- JSONArray jsonParentArray = new JSONArray();
+ jsonParentArray = new JSONArray();
List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
if (!selectItems.isEmpty()) {
@@ -88,14 +90,6 @@
}
}
setValuesList(labels);
- StringBuffer attributes = new StringBuffer();
- writer.startElement("script", component);
- getUtils().writeAttribute(writer, "type", "text/javascript" );
- attributes.append("var options = ");
- attributes.append(jsonParentArray.toString());
- attributes.append(";");
- writer.write(attributes.toString());
- writer.endElement("script");
}
public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
@@ -116,4 +110,44 @@
protected Class<? extends UIComponent> getComponentClass() {
return UIInplaceSelect.class;
}
+
+ public String getItemsTextAsJSArray(FacesContext context, UIComponent component) {
+ StringBuffer attributes = new StringBuffer();
+ attributes.append(jsonParentArray.toString());
+ return attributes.toString();
+ }
+
+ public String getSelectedItemLabel(FacesContext context, UIComponent component) {
+ String defaultLabel = null;
+ Object value = component.getAttributes().get("value");
+ if (value == null) {
+ return createDefaultLabel(component);
+ }
+ defaultLabel = getItemLabel(context, component, value);
+ if (defaultLabel == null) {
+ return createDefaultLabel(component);
+ }
+ return defaultLabel;
+ }
+
+ protected String getItemLabel(FacesContext context, UIComponent component, Object value) {
+ String itemLabel = null;
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for(SelectItem item : selectItems) {
+ if (value.equals(item.getValue())) {
+ itemLabel = item.getLabel();
+ }
+ }
+ }
+ return itemLabel;
+ }
+
+ protected String createDefaultLabel(UIComponent component) {
+ String defaultLabel = (String) component.getAttributes().get("defaultLabel");
+ if (defaultLabel == null || defaultLabel.equals("")) {
+ defaultLabel = "\u00a0\u00a0\u00a0";
+ }
+ return defaultLabel;
+ }
}
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-25 19:04:36 UTC (rev 7232)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-25 19:17:31 UTC (rev 7233)
@@ -1,11 +1,12 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelect = Class.create(Richfaces.InplaceInput, {
initialize : function($super, listObj, clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes, barParams, buttonId) {
+ this.button = $(buttonId);
this.comboList = listObj;
- this.button = $(buttonId);
$super(clientId, temValueKeepId, valueKeepId, tabberId, attributes, events, classes, barParams);
this.clickOnBar = false;
+ this.currentItemValue = this.value;
this.button.style.top = Richfaces.getBorderWidth(this.tempValueKeeper, "t") + "px";
},
@@ -70,7 +71,7 @@
this.comboList.hideWithDelay();
}
if (this.attributes.showControls) {
- this.save();
+ this.saveValue();
}
this.comboList.isList = false;
/*this.comboList.hideWithDelay();*/
@@ -108,7 +109,7 @@
tmpValueKeyDownHandlerIn : function(event) {
switch (event.keyCode) {
case Event.KEY_RETURN :
- this.save();
+ this.saveValue();
this.comboList.hideWithDelay();
Event.stop(event);
break;
@@ -126,15 +127,16 @@
}
},
- save : function($super) {
+ saveValue : function($super) {
if (this.comboList.activeItem) {
- var userValue = this.comboList.activeItem.innerHTML;
- this.tempValueKeeper.value = userValue;
+ var userLabel = this.comboList.activeItem.innerHTML;
+ this.currentItemValue = this.comboList.activeItem.value;
+ this.tempValueKeeper.value = userLabel;
this.comboList.selectedItem = this.comboList.activeItem;
//this.clickOnField = false;
}
if (!this.comboList.isList || this.clickOnBar) {
- $super();
+ this.save(this.currentItemValue, this.tempValueKeeper.value);
}
},
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-03-25 19:04:36 UTC (rev 7232)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselectlist.js 2008-03-25 19:17:31 UTC (rev 7233)
@@ -1,7 +1,8 @@
if(!window.Richfaces) window.Richfaces = {};
Richfaces.InplaceSelectList = Class.create(Richfaces.ComboBoxList, {
- initialize : function($super, listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay) {
+ initialize : function($super, listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay, value) {
$super(listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldId, shadowId, showDelay, hideDelay);
+ this.wrappingItems(value);
},
setPosition : function($super, fieldTop, fieldLeft, fieldHeight) {
@@ -35,11 +36,7 @@
},
resetState : function() {
- //var tempList = this.list.cloneNode(false);
- //this.listParent.childNodes[1].firstChild.replaceChild(tempList, this.list);
- //this.list = $(tempList.id);
this.activeItem = null;
- //this.isList = false;
},
getEventItem : function(event) {
@@ -68,5 +65,16 @@
}
var component = this.listParent.parentNode;
this.listParent.hide();
+ },
+
+ wrappingItems : function(value) {
+ var len = this.getItems().length;
+ for (var i = 0; i < len; i++) {
+ var it = this.getItems()[i];
+ it.value = this.itemsText[i][1];
+ if (it.value == value) {
+ this.doSelectItem(it);
+ }
+ }
}
});
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-25 19:04:36 UTC (rev 7232)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-25 19:17:31 UTC (rev 7233)
@@ -29,17 +29,13 @@
<![CDATA[
Object value = component.getAttributes().get("value");
Object fieldValue = component.getAttributes().get("value");
+ String fieldLabel = getSelectedItemLabel(context, component);
value = getConvertedStringValue(context, component,value);
if (value == null || value.equals("")) {
fieldValue = "";
- String defaultValue = (String)component.getAttributes().get("defaultLabel");
- if(defaultValue == null || defaultValue.equals("")) {
- defaultValue = "\u00a0\u00a0\u00a0";
- }
- value = defaultValue;
}
- variables.setVariable("value", value);
+ variables.setVariable("fieldLabel", fieldLabel);
variables.setVariable("fieldValue", fieldValue);
/*String saveIcon = (String)component.getAttributes().get("saveControlIcon");
@@ -88,7 +84,7 @@
<input id="#{clientId}inplaceTmpValue"
type="text"
style='display:none;'
- value="#{fieldValue}"
+ value="#{fieldLabel}"
autocomplete="off"
maxlength='#{component.attributes["inputMaxLength"]}'
readonly="readonly"
@@ -178,32 +174,29 @@
}
};
- var richInplaceSelAttributes = {defaultLabel : '#{component.attributes["defaultLabel"]}',
- showControls : #{component.attributes["showControls"]},
- editEvent : '#{component.attributes["editEvent"]}',
- verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
- horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
- inputWidth : '#{component.attributes["selectWidth"]}',
- minInputWidth : '#{component.attributes["minSelectWidth"]}',
- maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
- openOnEdit:#{component.attributes["openOnEdit"]}
- };
-
- var richInplaceSelEvents = {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
- onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
- oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
- onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")}};
-
- var richInplaceList = new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
- Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', options, null,
- '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0);
- var richInplaceSelect = new Richfaces.InplaceSelect(richInplaceList, '#{clientId}', '#{clientId}inplaceTmpValue',
+ new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
+ Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component)}, null,
+ '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0, '#{fieldValue}'),
+ '#{clientId}', '#{clientId}inplaceTmpValue',
'#{clientId}inplaceValue', '#{clientId}tabber',
- richInplaceSelAttributes, richInplaceSelEvents, Richfaces.InplaceSelect.CLASSES,
+ {defaultLabel : '#{component.attributes["defaultLabel"]}',
+ showControls : #{component.attributes["showControls"]},
+ editEvent : '#{component.attributes["editEvent"]}',
+ verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
+ horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
+ inputWidth : '#{component.attributes["selectWidth"]}',
+ minInputWidth : '#{component.attributes["minSelectWidth"]}',
+ maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
+ openOnEdit:#{component.attributes["openOnEdit"]}},
+ {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
+ onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
+ oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
+ onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")}},
+ Richfaces.InplaceSelect.CLASSES,
['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
</script>
</div>
- #{value}
+ #{fieldLabel}
<jsp:scriptlet>
16 years, 9 months
JBoss Rich Faces SVN: r7232 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-25 15:04:36 -0400 (Tue, 25 Mar 2008)
New Revision: 7232
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-2335
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-03-25 18:55:17 UTC (rev 7231)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-03-25 19:04:36 UTC (rev 7232)
@@ -356,7 +356,7 @@
processAllFocusElements: function(root, callback) {
if (root.focus &&
// Many not visible elements have focus method, we is had to avoid processing them.
- /^a|input|select|button|textarea$/i.test(root.tagName) &&
+ /^(?:a|input|select|button|textarea)$/i.test(root.tagName) &&
!root.disabled && !/^hidden$/.test(root.type) &&
Element.visible(root)) {
16 years, 9 months
JBoss Rich Faces SVN: r7231 - trunk/ui/inplaceSelect/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-25 14:55:17 -0400 (Tue, 25 Mar 2008)
New Revision: 7231
Modified:
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2717
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-25 18:35:38 UTC (rev 7230)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-25 18:55:17 UTC (rev 7231)
@@ -80,7 +80,7 @@
<jsp:scriptlet>
} else {
</jsp:scriptlet>
- <div id="#{clientId}" class="rich-inplace-select-view" x:passThruWithExclusions="id,styleClass,class,style">
+ <div id="#{clientId}" class="rich-inplace-select-view #{component.attributes['viewClass']}" x:passThruWithExclusions="id,styleClass,class,style">
<jsp:scriptlet>
}
</jsp:scriptlet>
16 years, 9 months
JBoss Rich Faces SVN: r7230 - in trunk/ui/fileUpload/src/main: resources/org/richfaces/renderkit/html/js and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-25 14:35:38 -0400 (Tue, 25 Mar 2008)
New Revision: 7230
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
RF-2742
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-03-25 18:28:38 UTC (rev 7229)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-03-25 18:35:38 UTC (rev 7230)
@@ -7,27 +7,27 @@
<f:verbatim><![CDATA[
-.upload_list_overflow{overflow: auto; overflow-y: auto; overflow-x: hidden;}
-.upload_name{ width : 100%; height : 58px; padding : 2px 10px 2px 10px;}
-.upload_del{ width : 90px; text-align : center; padding-top : 3; padding-bottom : 3;}
-.upload_scroll{ width : 10px; text-align : center;}
+.rich_file_upload_list_overflow{overflow: auto; overflow-y: auto; overflow-x: hidden;}
+.rich_file_upload_name{ width : 100%; height : 58px; padding : 2px 10px 2px 10px;}
+.rich_file_upload_del{ width : 90px; text-align : center; padding-top : 3; padding-bottom : 3;}
+.rich_file_upload_scroll{ width : 10px; text-align : center;}
-input[type="file"][class~="hidden"]::-webkit-file-upload-button {
+input[type="file"][class~="rich_file_hidden"]::-webkit-file-upload-button {
font-size: 10em;
-webkit-appearance: button;
}
-.upload_button_content{
+.rich_file_upload_button_content{
padding : 2px 6px 2px 3px;
text-align : left;
white-space : nowrap;
}
-.upload_name_padding{padding : 2px 0px 2px 0px;}
+.rich_file_upload_name_padding{padding : 2px 0px 2px 0px;}
-.upload_ico{background-position : 0px 50%; background-repeat : no-repeat; padding-left : 19px;vertical-align: middle;}
+.rich_file_upload_ico{background-position : 0px 50%; background-repeat : no-repeat; padding-left : 19px;vertical-align: middle;}
-input.hidden {
+input.rich_file_hidden {
Z-INDEX: 2;
FILTER: alpha(opacity: 0);
POSITION: relative;
@@ -38,28 +38,28 @@
]]>
</f:verbatim>
-<u:selector name=".upload_font">
+<u:selector name=".rich_file_upload_font">
<u:style name="font-family" skin="generalFamilyFont" />
<u:style name="font-size" skin="generalSizeFont" />
</u:selector>
-<u:selector name=".upload_table_td">
+<u:selector name=".rich_file_upload_table_td">
<u:style name="border-bottom-color" skin="tableBorderColor" />
<u:style name="border-bottom" value="1px solid" />
<u:style name="white-space" value="nowrap" />
</u:selector>
-<u:selector name=".upload_list_decor">
+<u:selector name=".rich_file_upload_list_decor">
<u:style name="border" value="1px solid;" />
<u:style name="border-color" skin="tableBorderColor" />
<u:style name="background-color" skin="tableBackgroundColor" />
</u:selector>
-<u:selector name=".upload_anc">
+<u:selector name=".rich_file_upload_anc">
<u:style name="color" skin="generalLinkColor" />
</u:selector>
-<u:selector name=".upload_toolbar_decor">
+<u:selector name=".rich_file_upload_toolbar_decor">
<u:style name="border-bottom" value="1px solid" />
<u:style name="border-top" value="1px solid" />
<u:style name="border-left" value="1px solid" />
@@ -71,20 +71,20 @@
<u:style name="width" value="100%" />
</u:selector>
-<u:selector name=".upload_button_border">
+<u:selector name=".rich_file_upload_button_border">
<u:style name="border" value="1px solid" />
<u:style name="margin" value="2px" />
<u:style name="border-color" skin="tableBorderColor" />
</u:selector>
-<u:selector name=".upload_button_dis">
+<u:selector name=".rich_file_upload_button_dis">
<u:style name="background-repeat" value="repeat-x" />
<u:style name="cursor" value="pointer" />
<u:style name="padding" value="2px" />
</u:selector>
-<u:selector name=".upload_enrty_dis">
+<u:selector name=".rich_file_upload_enrty_dis">
<u:style name="background-repeat" value="repeat-x" />
<u:style name="background-color" skin="trimColor" />
<u:style name="text-color" value="red" />
@@ -94,14 +94,14 @@
-<u:selector name="a.upload_button_selection">
+<u:selector name="a.rich_file_upload_button_selection">
<u:style name="color" skin="generalTextColor" />
<u:style name="text-decoration" value="none" />
<u:style name="display" value="block" />
</u:selector>
-<u:selector name=".upload_button">
+<u:selector name=".rich_file_upload_button">
<u:style name="background-repeat" value="repeat-x" />
<u:style name="background-position" value="top left" />
<u:style name="background-color" skin="trimColor" />
@@ -113,7 +113,7 @@
</u:selector>
-<u:selector name=".upload_button_light">
+<u:selector name=".rich_file_upload_button_light">
<u:style name="background-repeat" value="repeat-x" />
<u:style name="background-position" value="top left" />
<u:style name="background-color" skin="trimColor" />
@@ -127,7 +127,7 @@
</u:selector>
-<u:selector name=".upload_button_press">
+<u:selector name=".rich_file_upload_button_press">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.images.UploadButtonPressedBgGradient" />
</u:style>
@@ -139,45 +139,45 @@
<u:style name="background-color" skin="additionalBackgroundColor" />
</u:selector>
-<u:selector name=".upload_ico_add">
+<u:selector name=".rich_file_upload_ico_add">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_add.gif" />
</u:style>
</u:selector>
-<u:selector name=".upload_ico_add_dis">
+<u:selector name=".rich_file_upload_ico_add_dis">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_add_dis.gif" />
</u:style>
<u:style name="color" skin="tableBorderColor" />
</u:selector>
-<u:selector name=".upload_ico_start">
+<u:selector name=".rich_file_upload_ico_start">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_start.gif" />
</u:style>
</u:selector>
-<u:selector name=".upload_ico_start_dis">
+<u:selector name=".rich_file_upload_ico_start_dis">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_start_dis.gif" />
</u:style>
<u:style name="color" skin="tableBorderColor" />
</u:selector>
-<u:selector name=".upload_ico_stop">
+<u:selector name=".rich_file_upload_ico_stop">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_stop.gif" />
</u:style>
</u:selector>
-<u:selector name=".upload_ico_clear">
+<u:selector name=".rich_file_upload_ico_clear">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_clear.gif" />
</u:style>
</u:selector>
-<u:selector name=".upload_ico_clear_dis">
+<u:selector name=".rich_file_upload_ico_clear_dis">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/ico_clear_dis.gif" />
</u:style>
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-03-25 18:28:38 UTC (rev 7229)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-25 18:35:38 UTC (rev 7230)
@@ -26,7 +26,7 @@
{
'style':'',
'onclick': function (context) { return 'var entry = FileUploadEntry.getComponent(this); entry.uploadObject.clear(entry); return false;';},
- 'className':function (context) { return 'upload_anc ' + Richfaces.evalMacro("className", context); },
+ 'className':function (context) { return 'rich_file_upload_anc ' + Richfaces.evalMacro("className", context); },
'href':'#'
},
[
@@ -40,7 +40,7 @@
{
'style':'',
'onclick': function (context) { return 'FileUploadEntry.getComponent(this).uploadObject.stop(); return false;';},
- 'className':function (context) { return 'upload_anc ' + Richfaces.evalMacro("className", context); },
+ 'className':function (context) { return 'rich_file_upload_anc ' + Richfaces.evalMacro("className", context); },
'href':'#'
},
[
@@ -54,7 +54,7 @@
{
'style':'',
'onclick': function (context) { return 'var entry = FileUploadEntry.getComponent(this); entry.uploadObject.clear(entry); return false;';},
- 'className':function (context) { return 'upload_anc ' + Richfaces.evalMacro("className", context); },
+ 'className':function (context) { return 'rich_file_upload_anc ' + Richfaces.evalMacro("className", context); },
'href':'#'
},
[
@@ -71,28 +71,28 @@
[
new E('tr',{},
[
- new E('td',{'className':function (context) { return 'upload_font upload_name upload_table_td ' + Richfaces.evalMacro("className", context);}},
+ new E('td',{'className':function (context) { return 'rich_file_upload_font rich_file_upload_name rich_file_upload_table_td ' + Richfaces.evalMacro("className", context);}},
[
- new E('div',{'className':'upload_name_padding','style':function (context) {return 'overflow : hidden; width:' + Richfaces.evalMacro("fileEntryWidth", context);}},
+ new E('div',{'className':'rich_file_upload_name_padding','style':function (context) {return 'overflow : hidden; width:' + Richfaces.evalMacro("fileEntryWidth", context);}},
[
new ET(function (context) { return Richfaces.evalMacro("fileName", context)})
]),
new E('div',{ }),
- new E('div',{'className':'upload_name_padding','style':function (context) {return 'overflow : hidden; width:' + Richfaces.evalMacro("fileEntryWidth", context);}},
+ new E('div',{'className':'rich_file_upload_name_padding','style':function (context) {return 'overflow : hidden; width:' + Richfaces.evalMacro("fileEntryWidth", context);}},
[
new ET(function (context) { return Richfaces.evalMacro("label", context)})
])
]),
- new E('td',{'style':'vertical-align: center;', 'className':'upload_table_td'},
+ new E('td',{'style':'vertical-align: center;', 'className':'rich_file_upload_table_td'},
[
- new E('div',{'className':'upload_font upload_del'},
+ new E('div',{'className':'rich_file_upload_font rich_file_upload_del'},
[
//FileUploadEntry.clearControlTemplate
])
]),
- new E('td',{'className':'upload_table_td'},
+ new E('td',{'className':'rich_file_upload_table_td'},
[
- new E('div',{'className':'upload_font upload_scroll'},[ new T ('\u00A0') ])
+ new E('div',{'className':'rich_file_upload_font rich_file_upload_scroll'},[ new T ('\u00A0') ])
])
])
])
@@ -755,31 +755,31 @@
}else {
d1.className = buttonClass.ENABLED;
d2.className = buttonContentClass.ENABLED;
- d1.onmouseover = function () {this.className='upload_button_light upload_font';};
- d1.onmouseout = function () {this.className='upload_button upload_font';};
- d1.onmousedown = function () {this.className='upload_button_press upload_font';};
- d1.onmouseup = function () {this.className='upload_button upload_font';};
+ d1.onmouseover = function () {this.className='rich_file_upload_button_light rich_file_upload_font';};
+ d1.onmouseout = function () {this.className='rich_file_upload_button rich_file_upload_font';};
+ d1.onmousedown = function () {this.className='rich_file_upload_button_press rich_file_upload_font';};
+ d1.onmouseup = function () {this.className='rich_file_upload_button rich_file_upload_font';};
}
},
disable: function () {
this.disabled = true;
- this.items.className = "upload_list_overflow " + this.classes.UPLOAD_LIST.DISABLED;
+ this.items.className = "rich_file_upload_list_overflow " + this.classes.UPLOAD_LIST.DISABLED;
for (var i = 0; i < this.entries.length; i++) {
var entry = this.entries[i];
- entry.entryElement.rows[0].cells[0].className = "upload_font upload_name upload_table_td " + this.classes.FILE_ENTRY.DISABLED;
- entry.controlArea.firstChild.className = "upload_anc " + this.classes.FILE_ENTRY_CONTROL.DISABLED;
+ entry.entryElement.rows[0].cells[0].className = "rich_file_upload_font rich_file_upload_name rich_file_upload_table_td " + this.classes.FILE_ENTRY.DISABLED;
+ entry.controlArea.firstChild.className = "rich_file_upload_anc " + this.classes.FILE_ENTRY_CONTROL.DISABLED;
}
this.processButtons();
},
enable: function () {
this.disabled = false;
- this.items.className = "upload_list_overflow " + this.classes.UPLOAD_LIST.ENABLED;
+ this.items.className = "rich_file_upload_list_overflow " + this.classes.UPLOAD_LIST.ENABLED;
for (var i = 0; i < this.entries.length; i++) {
var entry = this.entries[i];
- entry.entryElement.rows[0].cells[0].className = "upload_font upload_name upload_table_td " + this.classes.FILE_ENTRY.ENABLED;
- entry.controlArea.firstChild.className = "upload_anc " + this.classes.FILE_ENTRY_CONTROL.ENABLED;
+ entry.entryElement.rows[0].cells[0].className = "rich_file_upload_font rich_file_upload_name rich_file_upload_table_td " + this.classes.FILE_ENTRY.ENABLED;
+ entry.controlArea.firstChild.className = "rich_file_upload_anc " + this.classes.FILE_ENTRY_CONTROL.ENABLED;
}
this.processButtons();
},
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-25 18:28:38 UTC (rev 7229)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-25 18:35:38 UTC (rev 7230)
@@ -29,10 +29,10 @@
variables.setVariable("maxCount", max);
boolean disabled = (Boolean)component.getAttributes().get("disabled");
- String addButtonClass = (disabled) ? "upload_button_dis upload_font " + (String)component.getAttributes().get("addButtonClassDisabled")
- : "upload_button upload_font " + (String)component.getAttributes().get("addButtonClass");
- String addButtonClassContent = (disabled) ? "upload_button_content upload_font upload_ico upload_ico_add_dis " + (String)component.getAttributes().get("addButtonClassDisabled")
- : "upload_button_content upload_font upload_ico upload_ico_add " + (String)component.getAttributes().get("addButtonClass");
+ String addButtonClass = (disabled) ? "rich_file_upload_button_dis rich_file_upload_font " + (String)component.getAttributes().get("addButtonClassDisabled")
+ : "rich_file_upload_button rich_file_upload_font " + (String)component.getAttributes().get("addButtonClass");
+ String addButtonClassContent = (disabled) ? "rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_add_dis " + (String)component.getAttributes().get("addButtonClassDisabled")
+ : "rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_add " + (String)component.getAttributes().get("addButtonClass");
String uploadListClass = (disabled) ? (String)component.getAttributes().get("uploadListClassDisabled") : (String)component.getAttributes().get("uploadListClass");
variables.setVariable("addButtonClass",addButtonClass);
@@ -55,7 +55,7 @@
</jsp:scriptlet>
-<div class="upload_list_decor" style="width: #{listWidth}" id="#{clientId}">
+<div class="rich_file_upload_list_decor" style="width: #{listWidth}" id="#{clientId}">
<f:call name="utils.encodeBeginFormIfNessesary" />
<!-- iframe name="ddd" id="#{clientId}_iframe" style="display: none;"/ -->
@@ -67,11 +67,11 @@
]]>
</jsp:scriptlet>
</span>
- <table class="upload_toolbar_decor">
+ <table class="rich_file_upload_toolbar_decor">
<tr>
<td>
- <div class="upload_button_border" style=" float:left;">
- <div class="#{addButtonClass}" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'" onmouseout="this.className='upload_button upload_font'"
+ <div class="rich_file_upload_button_border" style=" float:left;">
+ <div class="#{addButtonClass}" onmouseover="this.className='rich_file_upload_button_light rich_file_upload_font'" onmousedown="this.className='rich_file_upload_button_press rich_file_upload_font'" onmouseup="this.className='rich_file_upload_button rich_file_upload_font'" onmouseout="this.className='rich_file_upload_button rich_file_upload_font'"
style="position: relative;"
id="#{clientId}:add1">
<div class="#{addButtonClassContent}"
@@ -79,20 +79,20 @@
style="position: relative;">#{addLabel}</div>
<div style="overflow : hidden; position : absolute; top : 0px; left : 0px; ">
<input type="file" style="cursor: pointer; right: 0px; top: 0px; font-size: 10em; position: absolute"
- class="hidden"
+ class="rich_file_hidden"
id="#{clientId}:file"
name="#{clientId}:file"
onchange="return $('#{clientId}').component.add(this);"/>
</div>
</div>
</div>
- <div class="upload_button_border" style=" float:left; display: none;">
- <div class="upload_button upload_font #{component.attributes['uploadButtonClass']}" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
- onmouseout="this.className='upload_button upload_font'"
+ <div class="rich_file_upload_button_border" style=" float:left; display: none;">
+ <div class="rich_file_upload_button rich_file_upload_font #{component.attributes['uploadButtonClass']}" onmouseover="this.className='rich_file_upload_button_light rich_file_upload_font'" onmousedown="this.className='rich_file_upload_button_press rich_file_upload_font'" onmouseup="this.className='rich_file_upload_button rich_file_upload_font'"
+ onmouseout="this.className='rich_file_upload_button rich_file_upload_font'"
id="#{clientId}:upload1"
onclick="return $('#{clientId}').component.upload();">
- <a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_start #{component.attributes['uploadButtonClass']}"
+ <a href="#" class="rich_file_upload_button_selection">
+ <div class="rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_start #{component.attributes['uploadButtonClass']}"
id="#{clientId}:upload2">
#{uploadLabel}
</div>
@@ -104,13 +104,13 @@
<!-- -->
- <div class="upload_button_border" style=" float:right; display: none;">
- <div class="upload_button upload_font #{component.attributes['cleanButtonClass']}" onmouseover="this.className='upload_button_light upload_font'" onmousedown="this.className='upload_button_press upload_font'" onmouseup="this.className='upload_button upload_font'"
- onmouseout="this.className='upload_button upload_font'"
+ <div class="rich_file_upload_button_border" style=" float:right; display: none;">
+ <div class="rich_file_upload_button rich_file_upload_font #{component.attributes['cleanButtonClass']}" onmouseover="this.className='rich_file_upload_button_light rich_file_upload_font'" onmousedown="this.className='rich_file_upload_button_press rich_file_upload_font'" onmouseup="this.className='rich_file_upload_button rich_file_upload_font'"
+ onmouseout="this.className='rich_file_upload_button rich_file_upload_font'"
onclick="return $('#{clientId}').component.clear();"
id="#{clientId}:clean1">
- <a href="#" class="upload_button_selection">
- <div class="upload_button_content upload_font upload_ico upload_ico_clear_dis #{component.attributes['cleanButtonClass']}"
+ <a href="#" class="rich_file_upload_button_selection">
+ <div class="rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_clear_dis #{component.attributes['cleanButtonClass']}"
id="#{clientId}:clean2">#{clearAllLabel}</div>
</a>
</div>
@@ -119,7 +119,7 @@
</tr>
</table>
- <div class="upload_list_overflow #{uploadListClass}" style="width: 100%; height: #{listHeight}" id="#{clientId}:fileItems">
+ <div class="rich_file_upload_list_overflow #{uploadListClass}" style="width: 100%; height: #{listHeight}" id="#{clientId}:fileItems">
</div>
@@ -127,36 +127,36 @@
<script type="text/javascript">
FileUpload.CLASSES = {
ADD : {
- ENABLED : 'upload_button upload_font #{component.attributes["addButtonClass"]}',
- DISABLED : 'upload_button_dis upload_font #{component.attributes["addButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button rich_file_upload_font #{component.attributes["addButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_dis rich_file_upload_font #{component.attributes["addButtonClassDisabled"]}'
},
ADD_CONTENT : {
- ENABLED : 'upload_button_content upload_font upload_ico upload_ico_add #{component.attributes["addButtonClass"]}',
- DISABLED : 'upload_button_content upload_font upload_ico upload_ico_add_dis #{component.attributes["addButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_add #{component.attributes["addButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_add_dis #{component.attributes["addButtonClassDisabled"]}'
},
UPDATE : {
- ENABLED : 'upload_button upload_font #{component.attributes["uploadButtonClass"]}',
- DISABLED : 'upload_button_dis upload_font #{component.attributes["uploadButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button rich_file_upload_font #{component.attributes["uploadButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_dis rich_file_upload_font #{component.attributes["uploadButtonClassDisabled"]}'
},
UPDATE_CONTENT : {
- ENABLED : 'upload_button_content upload_font upload_ico upload_ico_start #{component.attributes["uploadButtonClass"]}',
- DISABLED : 'upload_button_content upload_font upload_ico upload_ico_start_dis #{component.attributes["uploadButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_start #{component.attributes["uploadButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_start_dis #{component.attributes["uploadButtonClassDisabled"]}'
},
CANCEL : {
- ENABLED : 'upload_button upload_font #{component.attributes["cancelButtonClass"]}',
- DISABLED : 'upload_button_dis upload_font #{component.attributes["cancelButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button rich_file_upload_font #{component.attributes["cancelButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_dis rich_file_upload_font #{component.attributes["cancelButtonClassDisabled"]}'
},
CANCEL_CONTENT : {
- ENABLED : 'upload_button_content upload_font upload_ico upload_ico_stop #{component.attributes["cancelButtonClass"]}',
- DISABLED : 'upload_button_content upload_font upload_ico upload_ico_stop_dis #{component.attributes["cancelButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_stop #{component.attributes["cancelButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_stop_dis #{component.attributes["cancelButtonClassDisabled"]}'
},
CLEAN : {
- ENABLED : 'upload_button upload_font #{component.attributes["cleanButtonClass"]}',
- DISABLED : 'upload_button_dis upload_font #{component.attributes["cleanButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button rich_file_upload_font #{component.attributes["cleanButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_dis rich_file_upload_font #{component.attributes["cleanButtonClassDisabled"]}'
},
CLEAN_CONTENT : {
- ENABLED : 'upload_button_content upload_font upload_ico upload_ico_clear #{component.attributes["cleanButtonClass"]}',
- DISABLED : 'upload_button_content upload_font upload_ico upload_ico_clear_dis #{component.attributes["cleanButtonClassDisabled"]}'
+ ENABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_clear #{component.attributes["cleanButtonClass"]}',
+ DISABLED : 'rich_file_upload_button_content rich_file_upload_font rich_file_upload_ico rich_file_upload_ico_clear_dis #{component.attributes["cleanButtonClassDisabled"]}'
},
FILE_ENTRY : {
ENABLED : '#{component.attributes["fileEntryClass"]}',
16 years, 9 months
JBoss Rich Faces SVN: r7229 - in trunk: framework/test/src/test/java/org/ajax4jsf/framework/renderer and 18 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-03-25 14:28:38 -0400 (Tue, 25 Mar 2008)
New Revision: 7229
Added:
trunk/test-applications/seleniumTest/
trunk/test-applications/seleniumTest/pom.xml
trunk/test-applications/seleniumTest/src/
trunk/test-applications/seleniumTest/src/main/
trunk/test-applications/seleniumTest/src/main/java/
trunk/test-applications/seleniumTest/src/main/java/org/
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java
trunk/test-applications/seleniumTest/src/main/resources/
trunk/test-applications/seleniumTest/src/main/webapp/
trunk/test-applications/seleniumTest/src/main/webapp/META-INF/
trunk/test-applications/seleniumTest/src/main/webapp/META-INF/MANIFEST.MF
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/lib/
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/seleniumTest/src/main/webapp/index.jsp
trunk/test-applications/seleniumTest/src/main/webapp/test.xhtml
trunk/test-applications/seleniumTest/src/test/
trunk/test-applications/seleniumTest/src/test/java/
trunk/test-applications/seleniumTest/src/test/java/org/
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumExampleTest.java
trunk/test-applications/seleniumTest/src/test/testng/
trunk/test-applications/seleniumTest/src/test/testng/unix/
trunk/test-applications/seleniumTest/src/test/testng/unix/testng.xml
trunk/test-applications/seleniumTest/src/test/testng/win/
trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
Modified:
trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/BeforeRendererListenerTestCase.java
trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/ChameleonRenderKitImplTestCase.java
trunk/pom.xml
trunk/ui/core/src/test/java/org/ajax4jsf/component/MockDataAdaptor.java
Log:
create Selenium-based integration test
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/BeforeRendererListenerTestCase.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/BeforeRendererListenerTestCase.java 2008-03-25 18:19:20 UTC (rev 7228)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/BeforeRendererListenerTestCase.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -43,7 +43,6 @@
*/
public BeforeRendererListenerTestCase(String name) {
super(name);
- // TODO Auto-generated constructor stub
}
/*
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/ChameleonRenderKitImplTestCase.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/ChameleonRenderKitImplTestCase.java 2008-03-25 18:19:20 UTC (rev 7228)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/framework/renderer/ChameleonRenderKitImplTestCase.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -35,7 +35,6 @@
*/
public ChameleonRenderKitImplTestCase(String name) {
super(name);
- // TODO Auto-generated constructor stub
}
/*
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-03-25 18:19:20 UTC (rev 7228)
+++ trunk/pom.xml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -21,6 +21,7 @@
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-2</version>
</extension>
+ <!-- scm deployment wagon
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-scm</artifactId>
@@ -36,6 +37,7 @@
<artifactId>maven-scm-provider-svnexe</artifactId>
<version>1.0</version>
</extension>
+ -->
</extensions>
<pluginManagement>
<plugins>
Added: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml (rev 0)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>seleniumTest</groupId>
+ <artifactId>seleniumTest</artifactId>
+ <packaging>war</packaging>
+ <name>seleniumTest Maven Webapp</name>
+ <version>3.2.0-SNAPSHOT</version>
+ <url>http://maven.apache.org</url>
+ <repositories>
+ <repository>
+ <id>openqa</id>
+ <name>OpenQA Repository</name>
+ <url>http://archiva.openqa.org/repository/releases</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <build>
+ <finalName>seleniumTest</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <background>true</background>
+ <debug>false</debug>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>0.3.1</version>
+ <dependencies></dependencies>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <dependencies>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ </dependency>
+ </dependencies>
+ <type>embedded</type>
+ </container>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+
+ <configuration>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase -->
+ <skip>true</skip>
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <suiteXmlFiles>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng.xml
+ </suiteXmlFile>
+ </suiteXmlFiles>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>linux</id>
+ <activation>
+ <os>
+ <family>unix</family>
+ </os>
+ </activation>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/testng/unix</directory>
+ <targetPath>testng</targetPath>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ </build>
+ </profile>
+ <profile>
+ <id>windows</id>
+ <activation>
+ <os>
+ <family>windows</family>
+ </os>
+ </activation>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/testng/win</directory>
+ <targetPath>testng</targetPath>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ </build>
+ </profile>
+ </profiles>
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.7</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <version>1.0-beta-1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openqa.selenium.server</groupId>
+ <artifactId>selenium-server-coreless</artifactId>
+ <version>1.0-beta-1</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>jetty</groupId>
+ <artifactId>org.mortbay.jetty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,45 @@
+package org.ajax4jsf;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+public class A4jTestBean {
+
+ private String param = "Not set yet";
+ private boolean checked;
+
+ public String getParam() {
+ return param;
+ }
+
+ public void setParam(String param) {
+ this.param = param;
+ }
+
+ private void checkMap() {
+ Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ for (String key : params.keySet()) {
+ System.out.println(key + "=" + params.get(key));
+ }
+ }
+
+ public void perform(ActionEvent actionEvent) {
+ System.out.println("A4jTestBean.perform(ActionEvent) = " + param);
+ checkMap();
+ }
+
+ public void perform() {
+ System.out.println("A4jTestBean.perform() = " + param);
+ checkMap();
+ }
+
+ public boolean isChecked() {
+ return checked;
+ }
+
+ public void setChecked(boolean checked) {
+ this.checked = checked;
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/A4jTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,206 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ValueChangeEvent;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+ private java.lang.String text;
+
+ private String text2="<%%%>";
+
+ private String[] array = {"one]","two]]>"};
+
+ private String[][] array2 = {{"one","two"},{"three","four"}};
+
+ private UIComponent component;
+
+ private HtmlOutputText outputComponent;
+
+ /**
+ * @return the component
+ */
+ public UIComponent getComponent() {
+ return component;
+ }
+
+ /**
+ * @param component the component to set
+ */
+ public void setComponent(UIComponent component) {
+ this.component = component;
+ }
+
+ public java.lang.String getText() {
+ return text;
+ }
+
+ public void setText(java.lang.String text) {
+ this.text = text;
+ }
+
+ public String ok(){
+ System.out.println("Button pressed");
+ setText("testOk");
+ return null;
+ }
+
+ public String setCookie() {
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
+ Cookie cookie = new Cookie("test", "Setted at time "+System.currentTimeMillis());
+ cookie.setMaxAge(60 * 60 * 24 * 365);
+ response.addCookie(cookie);
+ return "verify_cookie";
+ }
+
+ public String getTestCookie(){
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
+ Cookie[] cookies = request.getCookies();
+ for (int i = 0; i < cookies.length; i++) {
+ if("test".equals(cookies[i].getName())){
+ return cookies[i].getValue();
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return the array
+ */
+ public String[] getArray() {
+ return array;
+ }
+
+ /**
+ * @param array the array to set
+ */
+ public void setArray(String[] array) {
+ this.array = array;
+ }
+
+ /**
+ * @return the array2
+ */
+ public String[][] getArray2() {
+ return array2;
+ }
+
+ /**
+ * @param array2 the array2 to set
+ */
+ public void setArray2(String[][] array2) {
+ this.array2 = array2;
+ }
+
+ /**
+ * @return the text2
+ */
+ public String getText2() {
+ return text2;
+ }
+
+ /**
+ * @param text2 the text2 to set
+ */
+ public void setText2(String test2) {
+ this.text2 = test2;
+ }
+
+ public void validate(FacesContext context, UIComponent input,Object newValue) {
+ FacesMessage msg = new FacesMessage("#{bean.validate} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("validate");
+ }
+
+ public void onChange(ValueChangeEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIComponent input = event.getComponent();
+ FacesMessage msg = new FacesMessage("#{bean.onChange} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("onChange");
+
+ }
+
+ public void validate2(FacesContext context, UIComponent input,Object newValue) {
+ FacesMessage msg = new FacesMessage("#{bean.validate2} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("validate2");
+
+ }
+
+ public void onChange2(ValueChangeEvent event) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ UIComponent input = event.getComponent();
+ FacesMessage msg = new FacesMessage("#{bean.onChange2} called");
+ context.addMessage(input.getClientId(context), msg);
+ System.out.println("onChange2");
+
+ }
+
+ public String getTime(){
+ return (new Date(System.currentTimeMillis())).toString();
+ }
+
+ public String clearSession(){
+ ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+ HttpSession session = (HttpSession) externalContext.getSession(false);
+ if(null != session){
+ session.setMaxInactiveInterval(5);
+ }
+ return null;
+ }
+
+ /**
+ * @return the outputComponent
+ */
+ public HtmlOutputText getOutputComponent() {
+ outputComponent = new HtmlOutputText();
+ return outputComponent;
+ }
+
+ /**
+ * @param outputComponent the outputComponent to set
+ */
+ public void setOutputComponent(HtmlOutputText outputComponent) {
+ this.outputComponent = outputComponent;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,62 @@
+/**
+ * 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;
+
+/**
+ * @author shura
+ *
+ */
+public class ChildBean {
+
+ private String name;
+
+ private int qty;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the qty
+ */
+ public int getQty() {
+ return this.qty;
+ }
+
+ /**
+ * @param qty the qty to set
+ */
+ public void setQty(int qty) {
+ this.qty = qty;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ChildBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,135 @@
+/**
+ * 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;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+public class Data {
+
+ private static final String[] mnames={"Jan","Feb","Mar","Apr","May"};
+
+ private List mounths = new ArrayList();
+
+ private List numbers = new ArrayList();
+
+ private boolean c3rendered=true;
+
+ private boolean c2rendered=true;
+
+ /**
+ * @return the c3rendered
+ */
+ public boolean isC3rendered() {
+ return this.c3rendered;
+ }
+
+ /**
+ * @param c3rendered the c3rendered to set
+ */
+ public void setC3rendered(boolean c3rendered) {
+ this.c3rendered = c3rendered;
+ }
+
+ public String toggleColumn() {
+ this.c3rendered = !this.c3rendered;
+ return null;
+ }
+ /**
+ * @return the numbers
+ */
+ public List getNumbers() {
+ return this.numbers;
+ }
+
+ /**
+ * @param numbers the numbers to set
+ */
+ public void setNumbers(List numbers) {
+ this.numbers = numbers;
+ }
+
+ public Data() {
+ Properties properties = System.getProperties();
+ Enumeration keys = properties.keys();
+ for(int i=0;i<5;i++){
+ DataBean bean = new DataBean();
+ int l = (int)(Math.random()*5)+1;
+ bean.setTotal(0);
+ bean.setMounth(mnames[i]);
+ mounths.add(bean);
+ for(int j=0;j<l;j++){
+ ChildBean child = new ChildBean();
+ child.setName((String) keys.nextElement());
+ int qty = (int)(Math.random()*10);
+ bean.setTotal(bean.getTotal()+qty);
+ child.setQty(qty);
+ bean.getDetail().add(child);
+ }
+ }
+ for(int i=0;i<16;i++){
+ numbers.add(new Integer(i));
+ }
+ }
+
+ /**
+ * @return the mounths
+ */
+ public List getMounths() {
+ return this.mounths;
+ }
+
+ /**
+ * @param mounths the mounths to set
+ */
+ public void setMounths(List mounths) {
+ this.mounths = mounths;
+ }
+
+ /**
+ * @return the c2rendered
+ */
+ public boolean isC2rendered() {
+ return this.c2rendered;
+ }
+
+ /**
+ * @param c2rendered the c2rendered to set
+ */
+ public void setC2rendered(boolean c2rendered) {
+ this.c2rendered = c2rendered;
+ }
+
+ public int getC2span(){
+ return c3rendered?1:2;
+ }
+
+ public int getC1span(){
+ int i = c2rendered?1:c3rendered?2:3;
+ return i;
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Data.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,119 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class DataBean {
+ private List detail = new ArrayList();
+
+ private String mounth;
+
+ private int total;
+
+ private int price;
+
+ private boolean checked=true;
+ /**
+ *
+ */
+ public DataBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the detail
+ */
+ public List getDetail() {
+ return this.detail;
+ }
+
+ /**
+ * @param detail the detail to set
+ */
+ public void setDetail(List detail) {
+ this.detail = detail;
+ }
+
+ /**
+ * @return the mounth
+ */
+ public String getMounth() {
+ return this.mounth;
+ }
+
+ /**
+ * @param mounth the mounth to set
+ */
+ public void setMounth(String mounth) {
+ this.mounth = mounth;
+ }
+
+ /**
+ * @return the total
+ */
+ public int getTotal() {
+ return this.total;
+ }
+
+ /**
+ * @param total the total to set
+ */
+ public void setTotal(int total) {
+ this.total = total;
+ }
+
+ /**
+ * @return the checked
+ */
+ public boolean isChecked() {
+ System.out.println("Invoke get checked for mounth "+getMounth()+", checked:"+checked);
+ return this.checked;
+ }
+
+ /**
+ * @param checked the checked to set
+ */
+ public void setChecked(boolean checked) {
+ System.out.println("Invoke set checked for mounth "+getMounth()+", checked:"+checked);
+ this.checked = checked;
+ }
+
+ public String check(){
+ checked = !checked;
+ System.out.println("Invoke check action for mounth "+getMounth()+", checked:"+checked);
+ return null;
+ }
+
+ public String inc(){
+ total++;
+ return null;
+ }
+
+ public void checkChanged(ValueChangeEvent event) {
+ System.out.println("Checked changed for mounth "+getMounth());
+ }
+
+ /**
+ * @return the price
+ */
+ public int getPrice() {
+ return price;
+ }
+
+ /**
+ * @param price the price to set
+ */
+ public void setPrice(int price) {
+ this.price = price;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class EnclosedData {
+
+ private List<RepeatData> repeatData;
+
+ public EnclosedData() {
+ repeatData = new ArrayList<RepeatData>();
+ for(int i=0;i<5;i++){
+ RepeatData data = new RepeatData();
+ data.setText("Top row "+i);
+ repeatData.add(data);
+ }
+ }
+
+ /**
+ * @return the repeatData
+ */
+ public List<RepeatData> getRepeatData() {
+ return repeatData;
+ }
+
+ /**
+ * @param repeatData the repeatData to set
+ */
+ public void setRepeatData(List<RepeatData> repeatData) {
+ this.repeatData = repeatData;
+ }
+
+
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/EnclosedData.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ListAction {
+
+ private List data;
+
+ private Set keys;
+
+ /**
+ * @return the data
+ */
+ public List getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ public Set getKeys(){
+ return keys;
+ }
+
+ public String timer(){
+ if(null != data){
+ keys=new HashSet();
+ int random = (int)(Math.random()*10.0);
+ for(int i=0;i<random;i++){
+ Bean bean = (Bean) data.get(i);
+ bean.setText(bean.getText()+" X");
+ keys.add(new Integer(i));
+ }
+ }
+ return null;
+ }
+
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ListAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,17 @@
+package org.ajax4jsf;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+public interface Media {
+
+ public void paint(OutputStream out, Object data) throws IOException;
+
+ public void initData();
+
+ public void setData(MediaData data);
+
+ public MediaData getData();
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/Media.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,55 @@
+package org.ajax4jsf;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+
+public class MediaBean implements Media {
+
+ private MediaData data;
+
+ /**
+ * @return the data
+ */
+ public MediaData getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(MediaData data) {
+ this.data = data;
+ }
+
+ public void initData(){
+ data= new MediaData();
+ data.setWidth(100);
+ data.setHeight(100);
+ data.setBackground(Color.BLUE);
+ data.setDrawColor(Color.RED);
+ }
+
+ public void paint(OutputStream out, Object data) throws IOException{
+ if (data instanceof MediaData) {
+
+ MediaData paintData = (MediaData) data;
+ BufferedImage img = new BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
+ Graphics2D graphics2D = img.createGraphics();
+ graphics2D.setBackground(paintData.getBackground());
+ graphics2D.setColor(paintData.getDrawColor());
+ graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
+ graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
+ graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
+ graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
+
+ ImageIO.write(img,"jpeg",out);
+
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,39 @@
+package org.ajax4jsf;
+
+import java.awt.Color;
+import java.io.Serializable;
+
+public class MediaData implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+ Integer Width=110;
+ Integer Height=50;
+ Color Background=new Color(0,0,0);
+ Color DrawColor=new Color(255,255,255);
+ public MediaData() {
+ }
+ public Color getBackground() {
+ return Background;
+ }
+ public void setBackground(Color background) {
+ Background = background;
+ }
+ public Color getDrawColor() {
+ return DrawColor;
+ }
+ public void setDrawColor(Color drawColor) {
+ DrawColor = drawColor;
+ }
+ public Integer getHeight() {
+ return Height;
+ }
+ public void setHeight(Integer height) {
+ Height = height;
+ }
+ public Integer getWidth() {
+ return Width;
+ }
+ public void setWidth(Integer width) {
+ Width = width;
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MediaData.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,103 @@
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.EventListener;
+import java.util.EventObject;
+import java.util.List;
+
+import org.ajax4jsf.event.PushEventListener;
+
+
+public class MessageBean implements Runnable {
+
+ private String result;
+
+ private boolean running = true;
+
+ private PushEventListener listener;
+
+ private List messages = new ArrayList(10);
+
+ private int counter = 0;
+
+ public MessageBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the result
+ */
+ public String getResult() {
+ return result;
+ }
+
+ /**
+ * @param result
+ * the result to set
+ */
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public void addListener(EventListener listener) {
+ synchronized (listener) {
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+ Thread th = new Thread(this);
+ th.start();
+
+ }
+ }
+ }
+
+ public void run() {
+ try {
+ while (isRunning()) {
+ Thread.sleep(10000);
+ Date current = new Date(System.currentTimeMillis());
+ if(messages.size()>=10){
+ messages.remove(0);
+ }
+ messages.add(messages.size(),String.valueOf(counter++)+" at "+current.toString());
+ System.out.println("event occurs");
+ synchronized (listener) {
+ listener.onEvent(new EventObject(this));
+ }
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @return the running
+ */
+ public synchronized boolean isRunning() {
+ return running;
+ }
+
+ /**
+ * @param running
+ * the running to set
+ */
+ public synchronized void setRunning(boolean running) {
+ this.running = running;
+ }
+
+ /**
+ * @return the messages
+ */
+ public List getMessages() {
+ return messages;
+ }
+
+ /**
+ * @param messages the messages to set
+ */
+ public void setMessages(List messages) {
+ this.messages = messages;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/MessageBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,64 @@
+package org.ajax4jsf;
+
+import java.io.Serializable;
+
+import org.ajax4jsf.component.UIInclude;
+
+public class NavigateBean implements Serializable {
+
+ private String viewId="/pages/hello.jsp";
+
+ transient private UIInclude include;
+
+ public String navigateOne() {
+
+ return "sucessOne";
+ }
+
+ public String navigateTwo() {
+
+ return "sucessTwo";
+ }
+
+ public String navigateHello() {
+
+ return "sucessHello";
+ }
+
+ /**
+ * @return the viewId
+ */
+ public String getViewId() {
+ return viewId;
+ }
+
+ /**
+ * @param viewId the viewId to set
+ */
+ public void setViewId(String viewId) {
+ this.viewId = viewId;
+ }
+
+ public String reset(){
+ setViewId("/pages/hello.jsp");
+ if(null != include){
+ include.setViewId("/pages/hello.jsp");
+ }
+ return null;
+ }
+
+ /**
+ * @return the include
+ */
+ public UIInclude getInclude() {
+ return include;
+ }
+
+ /**
+ * @param include the include to set
+ */
+ public void setInclude(UIInclude include) {
+ this.include = include;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/NavigateBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ObjectNotFoundException extends Exception {
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ObjectNotFoundException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageDescriptionBean {
+
+ private String _path;
+
+ private String _title;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return _title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PageDescriptionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,125 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PagesBean {
+
+ private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
+
+ private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
+
+ private static final Pattern TITLE_PATTERN = Pattern.compile("<title>(.*)</title>",Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
+
+ private ServletContext _servletContext;
+
+ private List<PageDescriptionBean> _jspPages;
+
+ private String _path;
+
+ private List<PageDescriptionBean> _xhtmlPages;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path
+ * the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the servletContext
+ */
+ public ServletContext getServletContext() {
+ return _servletContext;
+ }
+
+ /**
+ * @param servletContext
+ * the servletContext to set
+ */
+ public void setServletContext(ServletContext servletContext) {
+ _servletContext = servletContext;
+ }
+
+ public List<PageDescriptionBean> getJspPages() {
+ if (_jspPages == null && null != getServletContext()) {
+ _jspPages = getPagesByPattern(JSP_PATTERN);
+ }
+
+ return _jspPages;
+ }
+
+ public List<PageDescriptionBean> getXhtmlPages() {
+ if (_xhtmlPages == null && null != getServletContext()) {
+ _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ }
+
+ return _xhtmlPages;
+ }
+
+ /**
+ *
+ */
+ private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
+ List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
+ Set resourcePaths = getServletContext().getResourcePaths(getPath());
+ for (Iterator iterator = resourcePaths.iterator(); iterator
+ .hasNext();) {
+ String page = (String) iterator.next();
+ if (pattern.matcher(page).matches()) {
+ PageDescriptionBean pageBean = new PageDescriptionBean();
+ pageBean.setPath(page);
+ InputStream pageInputStream = getServletContext().getResourceAsStream(page);
+ if(null != pageInputStream){
+ byte[] head = new byte[1024];
+ try {
+ int readed = pageInputStream.read(head);
+ String headString = new String(head,0,readed);
+ Matcher titleMatcher = TITLE_PATTERN.matcher(headString);
+ if(titleMatcher.find() && titleMatcher.group(1).length()>0){
+ pageBean.setTitle(titleMatcher.group(1));
+ } else {
+ pageBean.setTitle(page);
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ try {
+ pageInputStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ jspPages.add(pageBean);
+ }
+ }
+ return jspPages;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/PagesBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,62 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class RepeatData {
+
+ private List data;
+
+ private String text;
+
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public RepeatData() {
+ data = new ArrayList(10);
+ for(int i=0;i<10;i++){
+ Bean bean = new Bean();
+ bean.setText("Row "+i);
+ data.add(bean);
+ }
+ }
+
+ public String ok(){
+ System.out.println("Row command pressed");
+ return null;
+ }
+
+ /**
+ * @return the data
+ */
+ public List getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(List data) {
+ this.data = data;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RepeatData.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,64 @@
+package org.ajax4jsf;
+
+
+
+import java.util.logging.Logger;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author krasi
+ *
+ */
+public class TestBean {
+ String id = "";
+ static final Logger LOGGER = Logger.getLogger(TestBean.class.getName());
+
+ public TestBean() {
+ }
+
+ public String getId() {
+
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 1.",
+ ""));
+
+ System.out.println("GET 1 ------" + id);
+ if (!id.equals("")) {
+ System.out.println("GET 2 ------" + id);
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 2.",
+ "11"));
+
+ try {
+ System.out.println("GET 3 ------" + id);
+ throw new ObjectNotFoundException();
+
+ } catch (ObjectNotFoundException e) {
+ System.out.println("GET 4 ------" + id);
+ FacesContext.getCurrentInstance().addMessage(
+ null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Message 3.",
+ "11"));
+ }
+
+ }
+
+ return id;
+ }
+
+ public void setId(String id) {
+ System.out.println("SET 1-" + id);
+ this.id = id;
+ }
+
+ public String searchByID() {
+ System.out.println("searchByID");
+ return null;
+
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.util.Date;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class TimerBean {
+
+ private boolean _enabled;
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return _enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ _enabled = enabled;
+ }
+
+ public Date getTimer(){
+ return new Date(System.currentTimeMillis());
+ }
+
+ public String go() {
+ setEnabled(true);
+ return null;
+ }
+
+ public String stop() {
+ setEnabled(false);
+ return null;
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TimerBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/META-INF/MANIFEST.MF 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/.faces-config.xml.jsfdia 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<PROCESS ENTITY="JSFProcess"/>
Added: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+
+<faces-config>
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+ <!-- queue.xhtml -->
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>text</property-name>
+ <property-class>java.lang.String</property-class>
+ <null-value />
+ </managed-property>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <display-name>Archetype Created Web Application</display-name>
+ <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>com.sun.faces.validateXml</param-name>
+ <param-value>false</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.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <!--
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ -->
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
+ <param-value>NONE,TIDY,NEKO</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.TIDY</param-name>
+ <param-value>
+ /pages/repeater.xhtml,/pages/tabs.xhtml
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.NONE</param-name>
+ <param-value>
+ /pages/layout.xhtml
+ </param-value>
+ </context-param>
+ <!--
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ -->
+ <context-param>
+ <param-name>org.richfaces.LoadStyleStrategy</param-name>
+ <param-value>DEFAULT</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.LoadScriptStrategy</param-name>
+ <param-value>DEFAULT</param-value>
+ </context-param>
+ <!--
+ -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>forceparser</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</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>/faces/*</url-pattern>
+ </servlet-mapping>
+ <error-page>
+ <exception-type>javax.servlet.ServletException</exception-type>
+ <location>/faces/error.xhtml</location>
+ </error-page>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/main/webapp/index.jsp
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/index.jsp (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/index.jsp 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,5 @@
+<html>
+<body>
+<h2>Hello World!</h2>
+</body>
+</html>
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/test-applications/seleniumTest/src/main/webapp/test.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/test.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/test.xhtml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <head><title>test</title></head>
+ <body>
+ <h:form id="fff">
+ <a4j:commandLink id="lnk" action="#{bean.ok}" value="Ok ajax"
+ reRender="out"></a4j:commandLink>
+ <h:outputText id="out" value="#{bean.text}"/>
+ </h:form>
+ <script type="text/javascript">
+ window.done=false;A4J.AJAX.AddListener(new A4J.AJAX.Listener(function(){window.done=true}));
+ </script>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/test.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumExampleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumExampleTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumExampleTest.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,61 @@
+/**
+ *
+ */
+package org.richfaces;
+
+/**
+ * @author asmirnov
+ *
+ */
+import static org.testng.Assert.*;
+
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+
+public class SeleniumExampleTest
+
+{
+ private DefaultSelenium selenium;
+
+ protected DefaultSelenium createSeleniumClient(String url, String browser){
+ return new DefaultSelenium("localhost", 4444,
+ browser, url);
+ }
+ @BeforeTest
+ @Parameters({ "browser" })
+ public void startSelenium(String browser){
+ selenium = createSeleniumClient("http://localhost:8080/", browser);
+ selenium.start();
+ }
+
+ @Test
+ public void testSomethingSimple() throws Exception {
+ selenium.open("http://localhost:8080/seleniumTest/faces/test.xhtml");
+ selenium.waitForPageToLoad("5000");
+
+ //
+ System.out.println("body [" + selenium.getHtmlSource() + "]");
+ //
+ // selenium.getEval("window.done=false;A4J.AJAX.AddListener(new
+ // A4J.AJAX.Listener(function(){window.done=true}))");
+ selenium.click("id=fff:lnk");
+ selenium.waitForCondition(
+ "selenium.browserbot.getCurrentWindow().done==true", "3000");
+ System.out.println("ajax body [" + selenium.getHtmlSource() + "]");
+ assertEquals("testOk", selenium.getText("id=fff:out"));
+
+ // Test help link
+ }
+ /**
+ *
+ */
+ @AfterTest
+ public void stopSelenium() {
+ selenium.stop();
+ selenium = null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumExampleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/test/testng/unix/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/unix/testng.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/unix/testng.xml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,10 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+ <test name="FireFoxFunctionalTests">
+ <parameter name="browser" value="*firefox ${firefoxDefaultPath}"/>
+ <packages>
+ <package name="org.richfaces" />
+ </packages>
+ </test>
+</suite>
+
Property changes on: trunk/test-applications/seleniumTest/src/test/testng/unix/testng.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml 2008-03-25 18:28:38 UTC (rev 7229)
@@ -0,0 +1,16 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="seleniumTest">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*iexplore"/>
+ <packages>
+ <package name="org.richfaces" />
+ </packages>
+ </test>
+ <test name="FireFoxFunctionalTests">
+ <parameter name="browser" value="*firefox"/>
+ <packages>
+ <package name="org.richfaces" />
+ </packages>
+ </test>
+</suite>
+
Property changes on: trunk/test-applications/seleniumTest/src/test/testng/win/testng.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/MockDataAdaptor.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/MockDataAdaptor.java 2008-03-25 18:19:20 UTC (rev 7228)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/MockDataAdaptor.java 2008-03-25 18:28:38 UTC (rev 7229)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.model.DataComponentState;
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.tests.MockComponentState;
@@ -53,7 +55,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -61,7 +63,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
16 years, 9 months