JBoss Rich Faces SVN: r6267 - management/design/standardComponent.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-02-21 12:11:07 -0500 (Thu, 21 Feb 2008)
New Revision: 6267
Removed:
management/design/standardComponent/hs~advanced.css
management/design/standardComponent/hs~example.html
Modified:
management/design/standardComponent/basic.css
Log:
Modified: management/design/standardComponent/basic.css
===================================================================
--- management/design/standardComponent/basic.css 2008-02-21 17:02:26 UTC (rev 6266)
+++ management/design/standardComponent/basic.css 2008-02-21 17:11:07 UTC (rev 6267)
@@ -3,9 +3,16 @@
font-family: verdana /*generalFamilyFont*/;
color : #000000 /*controlTextColor*/;
}
-fieldset {
+fieldset{
border-width: 1px;
border-style : solid;
padding:10px;
+ border-color : #BED6F8 /*panelBorderColor*/;
}
+hr{
+ border-width: 1px;
+ border-style : solid;
+ border-color : #BED6F8 /*panelBorderColor*/;
+}
+
Deleted: management/design/standardComponent/hs~advanced.css
===================================================================
--- management/design/standardComponent/hs~advanced.css 2008-02-21 17:02:26 UTC (rev 6266)
+++ management/design/standardComponent/hs~advanced.css 2008-02-21 17:11:07 UTC (rev 6267)
@@ -1,91 +0,0 @@
-button, input[type="reset"], input[type="submit"], input[type="button"] {
- border-width: 1px;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*headerTextColor*/;
- background-color : #BED6F8 /*headerBackgroundColor*/;
- background-image : url(btn_bg.gif)/*from headerGradientColor to headerBackgroundColor, width generalSizeFont*/;
- background-repeat : repeat-x;
- background-position : top left;
-}
-
-textarea, input[type="text"], input[type="password"], select{
- border-width: 1px;
- border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*controlTextColor*/;
- background-color : #FFFFFF /*controlBackgroundColor*/;
- background-image : url(input_bg.gif)/*from additionalBackgroundColor to controlBackgroundColor, width generalSizeFont*/;
- background-repeat : no-repeat;
- background-position : 1px 1px;
- }
-
-
-input, select, textarea, button, keygen, isindex {
- border-width: 1px;
- border-color : #BED6F8 /*panelBorderColor*/;
- color : #000000 /*controlTextColor*/;
-}
-
-
- .input_def{
- border-width: 1px;
- border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*controlTextColor*/;
- background-color : #FFFFFF /*controlBackgroundColor*/;
- background-image : url(input_bg.gif)/*from additionalBackgroundColor to controlBackgroundColor, width generalSizeFont*/;
- background-repeat : no-repeat;
- background-position : 1px 1px;
- }
- .input_sel{
- border-width: 1px;
- border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*controlTextColor*/;
- background-color : #FFF2D0 /*NEW - inputLightColor*/;
- }
- .input_error{
- border-width: 1px;
- border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*controlTextColor*/;
- background-color : #FFE6E6 /*NEW - errorBackgroundColor*/;
- background-image : url(input_error.gif); /*NEW - errorColor*/
- background-repeat : no-repeat;
- background-position : center right;
- }
- .btn_def{
- border-width: 1px;
- border-style : outset;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*headerTextColor*/;
- background-color : #BED6F8 /*headerBackgroundColor*/;
- background-image : url(btn_bg.gif)/*from headerGradientColor to headerBackgroundColor, width generalSizeFont*/;
- background-repeat : repeat-x;
- background-position : top left;
- }
- .btn_press{
- border-width: 1px;
- border-style : inset;
- border-color : #BED6F8 /*panelBorderColor*/;
- font-size: 11px /*generalSizeFont*/;
- font-family: verdana /*generalFamilyFont*/;
- color : #000000 /*headerTextColor*/;
- background-color : #BED6F8 /*headerBackgroundColor*/;
- background-image : url(btn_press_bg.gif)/*from headerBackgroundColor to headerGradientColor, width generalSizeFont*/;
- background-repeat : repeat-x;
- background-position : bottom left;
- }
-
Deleted: management/design/standardComponent/hs~example.html
===================================================================
--- management/design/standardComponent/hs~example.html 2008-02-21 17:02:26 UTC (rev 6266)
+++ management/design/standardComponent/hs~example.html 2008-02-21 17:11:07 UTC (rev 6267)
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-<head>
- <title>Untitled</title>
-
-<link rel="STYLESHEET" type="text/css" href="basic.css">
-<link rel="STYLESHEET" type="text/css" href="advanced.css">
-</head>
-
-<body>
-
-<fieldset>
-<legend>Legend</legend>
-<button>Test</button>
-<input type="Button" value="Test">
-<input type="Checkbox">
-<input type="File">
-<input type="Radio">
-<input type="Text" value="Test">
-<select size="1">
- <option>Test</option>
-</select>
-
-<select multiple>
- <option>Test</option>
- <option>Test1</option>
- <option>Test2</option>
- <option>Test3</option>
-</select>
-
-
-<br><br>
-<textarea>text</textarea>
-
-<keygen />
-<br><br>
-<isindex />
-
-</fieldset>
-</body>
-</html>
16 years, 11 months
JBoss Rich Faces SVN: r6266 - trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-21 12:02:26 -0500 (Thu, 21 Feb 2008)
New Revision: 6266
Modified:
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
Modified: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-21 16:50:40 UTC (rev 6265)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-21 17:02:26 UTC (rev 6266)
@@ -408,7 +408,6 @@
getFileSize: function (data) {
if (data) {
- this.progressBar.enable();
var progressData = new ProgressData(data);
this.progressData = progressData;
if (this.activeEntry) {
@@ -423,7 +422,7 @@
prepareProgressBar: function () {
this.progressBar.setValue(0);
Element.show(this._progressBar);
- //this.progressBar.enable();
+ this.progressBar.enable();
},
finishProgressBar: function () {
16 years, 11 months
JBoss Rich Faces SVN: r6265 - trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-21 11:50:40 -0500 (Thu, 21 Feb 2008)
New Revision: 6265
Modified:
trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml
Log:
set up 100 MB max file size in demo version
Modified: trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml 2008-02-21 16:49:10 UTC (rev 6264)
+++ trunk/sandbox/samples/fileUploadDemo/src/main/webapp/WEB-INF/web.xml 2008-02-21 16:50:40 UTC (rev 6265)
@@ -35,7 +35,11 @@
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</init-param>
- </filter>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>100000000</param-value>
+ </init-param>
+ </filter>
<!--
<filter>
16 years, 11 months
JBoss Rich Faces SVN: r6264 - in trunk/sandbox/ui/fileUpload/src/main: resources/org/richfaces/renderkit/html/js and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-02-21 11:49:10 -0500 (Thu, 21 Feb 2008)
New Revision: 6264
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartFilter.java
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
file size restriction functionality
Modified: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartFilter.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartFilter.java 2008-02-21 16:45:41 UTC (rev 6263)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartFilter.java 2008-02-21 16:49:10 UTC (rev 6264)
@@ -83,6 +83,7 @@
Map<String, MultipartRequest> sessionsMap = null;
Map<String, Object> percentMap = null;
try {
+ if (!isFileSizeRestricted(request, maxRequestSize)) {
HttpSession session = httpRequest.getSession();
synchronized (session) {
sessionsMap = (Map<String, MultipartRequest>) session
@@ -105,18 +106,15 @@
if (multipartRequest.parseRequest()) {
chain.doFilter(multipartRequest, response);
} else {
- HttpServletResponse httpResponse = (HttpServletResponse) response;
- httpResponse.setStatus(HttpServletResponse.SC_OK);
- httpResponse.setContentType("text/html");
-
- PrintWriter writer = httpResponse.getWriter();
- writer
- .write("<html id=\"_richfaces_file_upload_stopped\"></html>");
- writer.close();
+ printResponse(response, "<html id=\"_richfaces_file_upload_stopped\"></html>");
}
+ }else {
+ printResponse(response, "<html id=\"_richfaces_file_upload_size_restricted\"></html>");
+ }
} finally {
if (sessionsMap != null) {
sessionsMap.remove(uid);
+ sessionsMap.remove(componentId);
}
}
} else {
@@ -141,6 +139,22 @@
}
}
+ private boolean isFileSizeRestricted (ServletRequest request, int maxSize) {
+ if (request.getContentLength() > maxSize) {
+ return true;
+ }
+ return false;
+ }
+
+ private void printResponse (ServletResponse response, String message) throws IOException{
+ HttpServletResponse httpResponse = (HttpServletResponse) response;
+ httpResponse.setStatus(HttpServletResponse.SC_OK);
+ httpResponse.setContentType("text/html");
+ PrintWriter writer = httpResponse.getWriter();
+ writer.write(message);
+ writer.close();
+ }
+
private boolean isMultipartRequest(HttpServletRequest request)
{
if (!"post".equals(request.getMethod().toLowerCase()))
@@ -171,6 +185,11 @@
if (param != null) {
this.createTempFiles = Boolean.parseBoolean(param);
}
+ param = filterConfig.getInitParameter("maxRequestSize");
+ if (param != null) {
+ this.maxRequestSize = Integer.parseInt(param);
+ }
+
}
}
Modified: trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java 2008-02-21 16:45:41 UTC (rev 6263)
+++ trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java 2008-02-21 16:49:10 UTC (rev 6264)
@@ -256,8 +256,9 @@
this.contentLength = Integer.parseInt(contentLength);
if (contentLength != null && maxRequestSize > 0
&& this.contentLength > maxRequestSize) {
- throw new FileUploadException(
- "Multipart request is larger than allowed size");
+ //TODO : we should make decision if can generate exception in this place
+ //throw new FileUploadException(
+ // "Multipart request is larger than allowed size");
}
}
Modified: trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-21 16:45:41 UTC (rev 6263)
+++ trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-21 16:49:10 UTC (rev 6264)
@@ -89,6 +89,7 @@
FileUploadEntry.UPLOAD_SUCCESS = "success";
FileUploadEntry.UPLOAD_TRANSFER_ERROR = "transfer_error";
FileUploadEntry.UPLOAD_SERVER_ERROR = "server_error";
+FileUploadEntry.UPLOAD_SIZE_ERROR = "size_error";
FileUploadEntry.LABELS = {};
FileUploadEntry.LABELS[FileUploadEntry.INITIALIZED] = '';
@@ -98,6 +99,7 @@
FileUploadEntry.LABELS[FileUploadEntry.UPLOAD_SUCCESS] = 'done';
FileUploadEntry.LABELS[FileUploadEntry.UPLOAD_TRANSFER_ERROR] = 'transfer_error';
FileUploadEntry.LABELS[FileUploadEntry.UPLOAD_SERVER_ERROR] = 'server_error';
+FileUploadEntry.LABELS[FileUploadEntry.UPLOAD_SIZE_ERROR] = 'File size restricted';
FileUploadEntry.getComponent = function(elt) {
while (elt) {
@@ -315,8 +317,11 @@
onload: function() {
var iframeDocument = this.iframe.contentWindow.document;
var elt = iframeDocument.getElementById('_richfaces_file_upload_stopped');
+ var restr = iframeDocument.getElementById('_richfaces_file_upload_size_restricted');
if (elt) {
this.callback(FileUploadEntry.UPLOAD_CANCELED);
+ } if (restr) {
+ this.callback(FileUploadEntry.UPLOAD_SIZE_ERROR);
} else {
//TODO handle server internal errors, etc.
this.callback(FileUploadEntry.UPLOAD_SUCCESS);
@@ -403,6 +408,7 @@
getFileSize: function (data) {
if (data) {
+ this.progressBar.enable();
var progressData = new ProgressData(data);
this.progressData = progressData;
if (this.activeEntry) {
@@ -417,13 +423,13 @@
prepareProgressBar: function () {
this.progressBar.setValue(0);
Element.show(this._progressBar);
- this.progressBar.enable();
+ //this.progressBar.enable();
},
finishProgressBar: function () {
this.progressBar.disable();
this.progressBar.setValue(100);
- Element.hide(this._progressBar);
+ //Element.hide(this._progressBar);
},
setupAutoUpload: function() {
@@ -462,7 +468,7 @@
var l = this.entries.length;
for (var i = 0; i < l; i++) {
var entry = this.entries[i];
- if (entry.state != FileUploadEntry.UPLOAD_SUCCESS) {
+ if (entry.state == FileUploadEntry.READY || entry.state == FileUploadEntry.INITIALIZED) {
return entry;
}
@@ -644,7 +650,7 @@
notifyStateChange: function(entry, oldState) {
var newState = entry.state;
- if (newState == FileUploadEntry.UPLOAD_SUCCESS) {
+ if (newState == FileUploadEntry.UPLOAD_SUCCESS || newState == FileUploadEntry.UPLOAD_SIZE_ERROR) {
//todo clear completed
//if (this.activeEntry) {
@@ -663,6 +669,7 @@
//but this.runUpload can be false if upload
//has been requested to stop by user
this.setupAutoUpload();
+ Element.hide(this._progressBar);
}
this._updateEntriesState();
16 years, 11 months
JBoss Rich Faces SVN: r6263 - management/design/standardComponent.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-02-21 11:45:41 -0500 (Thu, 21 Feb 2008)
New Revision: 6263
Modified:
management/design/standardComponent/advanced.css
Log:
Modified: management/design/standardComponent/advanced.css
===================================================================
--- management/design/standardComponent/advanced.css 2008-02-21 16:17:57 UTC (rev 6262)
+++ management/design/standardComponent/advanced.css 2008-02-21 16:45:41 UTC (rev 6263)
@@ -1,4 +1,4 @@
-button[type="button"], input[type="reset"], input[type="submit"], input[type="button"] {
+*|button {
border-width: 1px;
border-color : #BED6F8 /*panelBorderColor*/;
font-size: 11px /*generalSizeFont*/;
@@ -10,6 +10,32 @@
background-position : top left;
}
+button[type="button"], button[type="reset"], button[type="submit"], input[type="reset"], input[type="submit"], input[type="button"] {
+ border-width: 1px;
+ border-color : #BED6F8 /*panelBorderColor*/;
+ font-size: 11px /*generalSizeFont*/;
+ font-family: verdana /*generalFamilyFont*/;
+ color : #000000 /*headerTextColor*/;
+ background-color : #BED6F8 /*headerBackgroundColor*/;
+ background-image : url(btn_bg.gif)/*from headerGradientColor to headerBackgroundColor, width generalSizeFont*/;
+ background-repeat : repeat-x;
+ background-position : top left;
+}
+
+
+*|textarea{
+ border-width: 1px;
+ border-style : inset;
+ border-color : #BED6F8 /*panelBorderColor*/;
+ font-size: 11px /*generalSizeFont*/;
+ font-family: verdana /*generalFamilyFont*/;
+ color : #000000 /*controlTextColor*/;
+ background-color : #FFFFFF /*controlBackgroundColor*/;
+ background-image : url(input_bg.gif)/*from additionalBackgroundColor to controlBackgroundColor, width generalSizeFont*/;
+ background-repeat : no-repeat;
+ background-position : 1px 1px;
+ }
+
textarea[type="textarea"], input[type="text"], input[type="password"], select{
border-width: 1px;
border-style : inset;
16 years, 11 months
JBoss Rich Faces SVN: r6262 - trunk/ui/combobox/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-21 11:17:57 -0500 (Thu, 21 Feb 2008)
New Revision: 6262
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
Log:
add selectItems def
Modified: trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-02-21 16:17:31 UTC (rev 6261)
+++ trunk/ui/combobox/src/test/java/org/richfaces/component/ComboBoxComponentTest.java 2008-02-21 16:17:57 UTC (rev 6262)
@@ -56,6 +56,7 @@
javaScripts.add("a4j_3_2_0-SNAPSHOTorg.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/comboboxUtils.js");
javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/combobox.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/combolist.js");
javaScripts.add("a4j_3_2_0-SNAPSHOTorg/richfaces/renderkit/html/scripts/utils.js");
}
@@ -97,9 +98,11 @@
comboBox.getChildren().add(item2);
comboBox.getChildren().add(item3);
comboBox.getChildren().add(item4);
+
UISelectItems items = new UISelectItems();
items.setValue(selectItems);
+ comboBox.getChildren().add(items);
form.getChildren().add(comboBox);
}
16 years, 11 months
JBoss Rich Faces SVN: r6261 - trunk/ui/combobox/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-21 11:17:31 -0500 (Thu, 21 Feb 2008)
New Revision: 6261
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
remove script files list initialization
Modified: trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-02-21 16:16:41 UTC (rev 6260)
+++ trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-02-21 16:17:31 UTC (rev 6261)
@@ -36,15 +36,7 @@
List selectItems = new ArrayList();
- private static Set javaScripts = new HashSet();
-
- static {
- javaScripts.add("org/richfaces/renderkit/html/scripts/combobox.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/comboboxUtils.js");
- javaScripts.add("prototype.js");
- }
-
public void setUp() throws Exception {
super.setUp();
renderer = new ComboBoxRenderer();
16 years, 11 months
JBoss Rich Faces SVN: r6260 - in trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces: component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-21 11:16:41 -0500 (Thu, 21 Feb 2008)
New Revision: 6260
Added:
trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java
trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/
trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java
Removed:
trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
Added: trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java (rev 0)
+++ trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/InplaceSelectComponentTest.java 2008-02-21 16:16:41 UTC (rev 6260)
@@ -0,0 +1,137 @@
+package org.richfaces.component;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectItems;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.model.SelectItem;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+public class InplaceSelectComponentTest extends AbstractAjax4JsfTestCase {
+
+ UIForm form;
+ UIInplaceSelect iselect;
+ List selectItems = new ArrayList();
+
+ private static Set javaScripts = new HashSet();
+
+ static {
+
+
+ javaScripts.add("a4j_3_2_0-SNAPSHOTorg.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/comboboxUtils.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/combolist.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/inplaceinput.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/inplaceselectlist.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTscripts/inplaceselect.js");
+ javaScripts.add("a4j_3_2_0-SNAPSHOTorg/richfaces/renderkit/html/scripts/utils.js");
+ }
+
+
+ public InplaceSelectComponentTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+ iselect = (UIInplaceSelect)application.createComponent("org.richfaces.InplaceSelect");
+
+ selectItems.add(new SelectItem("Kansas City"));
+ selectItems.add(new SelectItem("Las Vegas"));
+ selectItems.add(new SelectItem("Oklahoma City"));
+ selectItems.add(new SelectItem("New Jersey"));
+ selectItems.add(new SelectItem("Detroit"));
+
+ UISelectItem item1 = new UISelectItem();
+ item1.setValue(new SelectItem("Toronto"));
+
+ UISelectItem item2 = new UISelectItem();
+ item2.setValue(new SelectItem("Cleveland"));
+
+ UISelectItem item3 = new UISelectItem();
+ item3.setValue(new SelectItem("Indianapolis"));
+
+ UISelectItem item4 = new UISelectItem();
+ item4.setValue(new SelectItem("New York"));
+
+ iselect.getChildren().add(item1);
+ iselect.getChildren().add(item2);
+ iselect.getChildren().add(item3);
+ iselect.getChildren().add(item4);
+
+ UISelectItems items = new UISelectItems();
+ items.setValue(selectItems);
+ iselect.getChildren().add(items);
+ iselect.setValue("New York");
+
+ form.getChildren().add(iselect);
+ }
+
+ public void testRenderer() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ }
+
+ public void testComboBoxStyles() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ if(links.size()==0){fail();}
+ for (int i = 0; i < links.size(); i++) {
+ HtmlElement link = (HtmlElement) links.get(i);
+ assertTrue(link.getAttributeValue("href").contains(
+ "css/inplaceselect.xcss"));
+ }
+ }
+
+ public void testComboBoxScripts() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+ if (item.getFirstChild() != null) {
+ String scriptBodyString = item.getFirstChild().toString();
+ assertTrue(scriptBodyString.contains("Richfaces.InplaceSelectList"));
+ assertTrue(scriptBodyString.contains("Richfaces.InplaceSelect"));
+ assertTrue(scriptBodyString.contains("Richfaces.InplaceSelect.CLASSES"));
+
+ }
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+ }
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ form = null;
+ iselect = null;
+ }
+}
Deleted: trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/JSFComponentTest.java 2008-02-21 16:16:27 UTC (rev 6259)
+++ trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/component/JSFComponentTest.java 2008-02-21 16:16:41 UTC (rev 6260)
@@ -1,53 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent()
- {
- assertTrue( true );
- }
-}
Added: trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java (rev 0)
+++ trunk/sandbox/ui/inplaceSelect/src/test/java/org/richfaces/renderkit/InplaceSelectRenderTest.java 2008-02-21 16:16:41 UTC (rev 6260)
@@ -0,0 +1,82 @@
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectItems;
+import javax.faces.model.SelectItem;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UIInplaceSelect;
+import org.richfaces.renderkit.html.InplaceSelectRenderer;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class InplaceSelectRenderTest extends AbstractAjax4JsfTestCase {
+
+ private UIInplaceSelect iselect;
+ private InplaceSelectRenderer renderer;
+ List selectItems = new ArrayList();
+
+ public InplaceSelectRenderTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ renderer = new InplaceSelectRenderer();
+ iselect = (UIInplaceSelect)application.createComponent("org.richfaces.InplaceSelect");
+ iselect.setValue("New York");
+ selectItems.add(new SelectItem("Kansas City"));
+ selectItems.add(new SelectItem("Las Vegas"));
+ selectItems.add(new SelectItem("Oklahoma City"));
+ selectItems.add(new SelectItem("New Jersey"));
+ selectItems.add(new SelectItem("Detroit"));
+
+ UISelectItem item1 = new UISelectItem();
+ item1.setValue(new SelectItem("Toronto"));
+
+ UISelectItem item2 = new UISelectItem();
+ item2.setValue(new SelectItem("Cleveland"));
+
+ UISelectItem item3 = new UISelectItem();
+ item3.setValue(new SelectItem("Indianapolis"));
+
+ UISelectItem item4 = new UISelectItem();
+ item4.setValue(new SelectItem("New York"));
+
+ iselect.getChildren().add(item1);
+ iselect.getChildren().add(item2);
+ iselect.getChildren().add(item3);
+ iselect.getChildren().add(item4);
+
+ UISelectItems items = new UISelectItems();
+ items.setValue(selectItems);
+ iselect.getChildren().add(items);
+ iselect.setValue("New York");
+
+ facesContext.getViewRoot().getChildren().add(iselect);
+ }
+
+ public void testRender(){
+
+ try {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ HtmlElement elem = page.getHtmlElementById(iselect.getClientId(facesContext));
+ assertNotNull(elem);
+ assertEquals(elem.getTagName(), "span");
+ renderer.doEncodeEnd(writer, facesContext, iselect);
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+
+}
16 years, 11 months
JBoss Rich Faces SVN: r6259 - trunk/sandbox/ui/inplaceSelect/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-21 11:16:27 -0500 (Thu, 21 Feb 2008)
New Revision: 6259
Modified:
trunk/sandbox/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
Modified: trunk/sandbox/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-02-21 16:16:17 UTC (rev 6258)
+++ trunk/sandbox/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-02-21 16:16:27 UTC (rev 6259)
@@ -77,7 +77,7 @@
return getConvertedValue(context, component, submittedValue, converter);
}
- public void encodeItems( FacesContext context, UIComponent component) throws IOException {
+ public void encodeItems(FacesContext context, UIComponent component) throws IOException {
List values = new ArrayList();
ResponseWriter writer = context.getResponseWriter();
16 years, 11 months
JBoss Rich Faces SVN: r6258 - trunk/sandbox/ui/inplaceSelect/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-02-21 11:16:17 -0500 (Thu, 21 Feb 2008)
New Revision: 6258
Modified:
trunk/sandbox/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
Log:
add default description
Modified: trunk/sandbox/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/sandbox/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-02-21 15:59:18 UTC (rev 6257)
+++ trunk/sandbox/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-02-21 16:16:17 UTC (rev 6258)
@@ -31,90 +31,108 @@
<property>
<name>editEvent</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA["click"]]></defaultvalue>
</property>
<property>
<name>maxSelectWidth</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>minSelectWidth</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>selectWidth</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>defaultLabel</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA["Click..."]]></defaultvalue>
</property>
<property>
<name>showControls</name>
<classname>boolean</classname>
+ <description></description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>saveControlIcon</name>
<classname>java.lang.String</classname>
+ <description></description>
</property>
<property>
<name>cancelControlIcon</name>
<classname>java.lang.String</classname>
+ <description></description>
</property>
<property>
<name>controlsPosition</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA["center"]]></defaultvalue>
</property>
<property>
<name>controlsHorizontalAlign</name>
<classname>java.lang.String</classname>
+ <description></description>
<defaultvalue><![CDATA["right"]]></defaultvalue>
</property>
<property>
<name>applyFromControlsOnly</name>
<classname>boolean</classname>
+ <description></description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>oneditactivation</name>
<classname>java.lang.String</classname>
+ <description></description>
</property>
<property>
<name>onviewactivation</name>
<classname>java.lang.String</classname>
+ <description></description>
</property>
<property>
<name>oneditactivated</name>
<classname>java.lang.String</classname>
+ <description></description>
</property>
<property>
<name>onviewactivated</name>
<classname>java.lang.String</classname>
+ <description></description>
</property>
<property>
<name>selectOnEdit</name>
<classname>boolean</classname>
+ <description></description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>tabindex</name>
<classname>int</classname>
+ <description></description>
</property>
<property>
<name>value</name>
- <classname>java.lang.String</classname>
+ <classname>java.lang.Object</classname>
+ <description></description>
</property>
<property>
<name>listWidth</name>
<classname>java.lang.String</classname>
- <description></description>
+ <description>"100px"</description>
</property>
<property>
<name>listHeight</name>
16 years, 11 months