JBoss Rich Faces SVN: r11410 - trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-11-27 07:20:46 -0500 (Thu, 27 Nov 2008)
New Revision: 11410
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
Log:
encode no-break space in for empty cells
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-11-27 12:08:08 UTC (rev 11409)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-11-27 12:20:46 UTC (rev 11410)
@@ -193,23 +193,28 @@
encodeStyleClass(writer, null,
"extdt-empty-cell rich-extdt-subheadercell", null,
null);
+ encodeNBSP(writer);
writer.endElement("th");
}
else{
writer.writeAttribute(HTML.style_ATTRIBUTE, "height: 0px", null);
for (int i = 0; i < numberOfColumns; i++) {
writer.startElement("th", header);
+ encodeNBSP(writer);
writer.endElement("th");
}
}
writer.endElement("tr");
-
encodeFilterRow(context, writer, table, table
.getSortedColumns(),
"extdt-subheadercell rich-extdt-subheadercell",
headerClass, "filter", HTML.th_ELEM);
writer.endElement("thead");
}
+
+ private void encodeNBSP(ResponseWriter writer) throws IOException {
+ writer.write(" ");
+ }
private void encodeFilterRow(FacesContext context, ResponseWriter writer,
UIExtendedDataTable table, Iterator<UIColumn> headers,
@@ -229,6 +234,7 @@
writer.startElement(HTML.th_ELEM, table);
encodeStyleClass(writer, null,
"extdt-empty-cell rich-extdt-subheadercell", null, null);
+ encodeNBSP(writer);
writer.endElement(HTML.th_ELEM);
writer.endElement(HTML.TR_ELEMENT);
}
@@ -325,6 +331,9 @@
dataColumn.getFacet("filter").encodeAll(context);
writer.endElement(HTML.DIV_ELEM);
}
+ else {
+ encodeNBSP(writer);
+ }
writer.endElement(element);
}
}
15 years, 5 months
JBoss Rich Faces SVN: r11409 - trunk/ui/combobox/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-27 07:08:08 -0500 (Thu, 27 Nov 2008)
New Revision: 11409
Modified:
trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
Log:
extend test
Modified: trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java
===================================================================
--- trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-11-27 10:53:38 UTC (rev 11408)
+++ trunk/ui/combobox/src/test/java/org/richfaces/renderkit/ComboBoxRendererTest.java 2008-11-27 12:08:08 UTC (rev 11409)
@@ -22,18 +22,18 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.component.UISelectItem;
-import javax.faces.component.UISelectItems;
import javax.faces.model.SelectItem;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.richfaces.component.UIComboBox;
-import org.richfaces.renderkit.html.ComboBoxRenderer;
+import org.w3c.dom.Node;
+import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
@@ -44,69 +44,84 @@
public class ComboBoxRendererTest extends AbstractAjax4JsfTestCase {
private UIComponent form;
- private UIComboBox comboBox;
- private ComboBoxRenderer renderer;
+ private UIComboBox comboBox1;
+ private UIComboBox comboBox2;
String suggestions = "Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Massachusetts,Michigan,Georgia,Hawaii,Idaho,Indiana,Iowa,Kansas,Kentucky,Louisiana,Maine,Minnesota,Mississippi,Missouri,Montana,Nebraska";
List selectItems = new ArrayList();
public void setUp() throws Exception {
- super.setUp();
- renderer = new ComboBoxRenderer();
- comboBox = (UIComboBox) application.createComponent("org.richfaces.ComboBox");
- comboBox.setSuggestionValues(Arrays.asList(suggestions.split(",")));
- selectItems.add(new SelectItem("District of Columbia"));
- selectItems.add(new SelectItem("Illinois"));
- selectItems.add(new SelectItem("Maryland"));
- selectItems.add(new SelectItem("Nevada"));
- selectItems.add(new SelectItem("New Hampshire"));
- selectItems.add(new SelectItem("New Jersey"));
+ super.setUp();
- UISelectItem item1 = new UISelectItem();
- item1.setValue(new SelectItem("Oregon"));
+ comboBox1 = (UIComboBox) application.createComponent("org.richfaces.ComboBox");
+ comboBox1.setSuggestionValues(Arrays.asList(suggestions.split(",")));
+ selectItems.add(new SelectItem("District of Columbia"));
+ selectItems.add(new SelectItem("Illinois"));
+ selectItems.add(new SelectItem("Maryland"));
+ selectItems.add(new SelectItem("Nevada"));
+ selectItems.add(new SelectItem("New Hampshire"));
+ selectItems.add(new SelectItem("New Jersey"));
+
+ UISelectItem item1 = new UISelectItem();
+ item1.setValue(new SelectItem("Oregon"));
+
+ UISelectItem item2 = new UISelectItem();
+ item2.setValue(new SelectItem("Pennsylvania"));
+
+ UISelectItem item3 = new UISelectItem();
+ item3.setValue(new SelectItem("Rhode Island"));
+
+ UISelectItem item4 = new UISelectItem();
+ item4.setValue(new SelectItem("South Carolina"));
+
+ comboBox1.getChildren().add(item1);
+ comboBox1.getChildren().add(item2);
+ comboBox1.getChildren().add(item3);
+ comboBox1.getChildren().add(item4);
+
+ // SuggestionValues is array
+ comboBox2 = (UIComboBox) application.createComponent("org.richfaces.ComboBox");
+ comboBox2.setSuggestionValues(suggestions.split(","));
+ comboBox2.getChildren().add(item1);
+ comboBox2.getChildren().add(item2);
+ comboBox2.getChildren().add(item3);
+ comboBox2.getChildren().add(item4);
+
+ facesContext.getViewRoot().getChildren().add(comboBox1);
+ facesContext.getViewRoot().getChildren().add(comboBox2);
+ }
- UISelectItem item2 = new UISelectItem();
- item2.setValue(new SelectItem("Pennsylvania"));
-
- UISelectItem item3 = new UISelectItem();
- item3.setValue(new SelectItem("Rhode Island"));
-
- UISelectItem item4 = new UISelectItem();
- item4.setValue(new SelectItem("South Carolina"));
-
- comboBox.getChildren().add(item1);
- comboBox.getChildren().add(item2);
- comboBox.getChildren().add(item3);
- comboBox.getChildren().add(item4);
-
- UISelectItems items = new UISelectItems();
- items.setValue(selectItems);
- facesContext.getViewRoot().getChildren().add(comboBox);
-
- Map requestMap = facesContext.getExternalContext().getRequestParameterMap();
- String id = "comboBoxValue" + comboBox.getClientId(facesContext);
- requestMap.put(id, "Pennsylvania");
- }
-
-// public void itemsTextAsJSArrayTest() {
-// String script = renderer.getItemsTextAsJSArray(facesContext, comboBox);
-// assertNotNull(script);
-// }
-
public void testRender() throws Exception {
-
- HtmlPage page = renderView();
- assertNotNull(page);
- HtmlElement elem = page.getHtmlElementById(comboBox.getClientId(facesContext));
- assertNotNull(elem);
- assertEquals(elem.getTagName(), "div");
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ HtmlElement elem1 = page.getHtmlElementById(comboBox1.getClientId(facesContext));
+ assertNotNull(elem1);
+ assertEquals("div",elem1.getTagName());
+ checkList(page, comboBox1);
+ HtmlElement elem2 = page.getHtmlElementById(comboBox2.getClientId(facesContext));
+ assertNotNull(elem2);
+ assertEquals("div",elem2.getTagName());
+ checkList(page, comboBox2);
+ }
+
+ protected void checkList(HtmlPage page, UIComboBox combobox) throws Exception {
+ String listId = combobox.getClientId(facesContext) + "list";
+ HtmlElement list = page.getHtmlElementById(listId);
+ Iterator<HtmlElement> htmlElements = list.getAllHtmlChildElements();
+ String allItems = suggestions + "Oregon, Pennsylvania, Rhode Island, South Carolina";
+ for (; htmlElements.hasNext();) {
+ HtmlElement span = htmlElements.next();
+ assertEquals("span", span.getTagName());
+ DomNode node = span.getFirstDomChild();
+ assertEquals(Node.TEXT_NODE, node.getNodeType());
+ assertTrue(allItems.contains(node.getNodeValue()));
+ }
}
public void tearDown() throws Exception {
- super.tearDown();
- renderer = null;
+ super.tearDown();
}
public ComboBoxRendererTest(String name) {
- super(name);
+ super(name);
}
}
15 years, 5 months
JBoss Rich Faces SVN: r11408 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-11-27 05:53:38 -0500 (Thu, 27 Nov 2008)
New Revision: 11408
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-4866 new rev
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-11-27 10:52:57 UTC (rev 11407)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-11-27 10:53:38 UTC (rev 11408)
@@ -300,12 +300,8 @@
return;
}
- var value = this.comboList.activeItem.innerText;
- if(!value) {
- value = this.comboList.activeItem.textContent.strip();
- }
-
- // var value = this.comboList.activeItem.innerHTML.unescapeHTML();
+ var value = this.comboList.activeItem.childNodes[0].nodeValue;
+
if (toSetOnly) {
var oV = this.field.value;
if (oV == value) {
15 years, 5 months
JBoss Rich Faces SVN: r11407 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-11-27 05:52:57 -0500 (Thu, 27 Nov 2008)
New Revision: 11407
Modified:
trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
Log:
RF-4502 - the table for scrollableDataTable has been added
Modified: trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2008-11-27 10:52:30 UTC (rev 11406)
+++ trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2008-11-27 10:52:57 UTC (rev 11407)
@@ -319,6 +319,31 @@
</section>
+ <section>
+ <title>Facets</title>
+ <table>
+ <title>Facets</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Facet</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>header</entry>
+ <entry>Defines the header content</entry>
+ </row>
+ <row>
+ <entry>footer</entry>
+ <entry>Defines the footer content</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
<section>
<title>Look-and-Feel Customization</title>
15 years, 5 months
JBoss Rich Faces SVN: r11406 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-11-27 05:52:30 -0500 (Thu, 27 Nov 2008)
New Revision: 11406
Modified:
trunk/docs/userguide/en/src/main/docbook/included/columns.xml
Log:
RF-5028 - class name has been corrected.
Modified: trunk/docs/userguide/en/src/main/docbook/included/columns.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-11-27 10:51:38 UTC (rev 11405)
+++ trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-11-27 10:52:30 UTC (rev 11406)
@@ -60,9 +60,9 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlColumns;
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlColumn;
...
-HtmlColumns myColumns = new HtmlColumns();
+HtmlColumn myColumns = new HtmlColumn();
...]]></programlisting>
</section>
<section>
15 years, 5 months
JBoss Rich Faces SVN: r11405 - trunk/test-applications/seamApp.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-11-27 05:51:38 -0500 (Thu, 27 Nov 2008)
New Revision: 11405
Modified:
trunk/test-applications/seamApp/pom.xml
Log:
seam version = 2.1.0.SP1
Modified: trunk/test-applications/seamApp/pom.xml
===================================================================
--- trunk/test-applications/seamApp/pom.xml 2008-11-27 10:49:35 UTC (rev 11404)
+++ trunk/test-applications/seamApp/pom.xml 2008-11-27 10:51:38 UTC (rev 11405)
@@ -9,7 +9,7 @@
<properties>
<projectName>seamApp</projectName>
<richfacesVersion>3.3.0-SNAPSHOT</richfacesVersion>
- <seamVersion>2.0.1.GA</seamVersion>
+ <seamVersion>2.1.0.SP1</seamVersion>
<jbossDownloadURL>http://downloads.sourceforge.net/jboss/jboss-4.2.2.GA.zip</jbossDownloadURL>
<jbossDeployDir>jboss-4.2.2.GA/jboss-4.2.2.GA/server/default/</jbossDeployDir>
<droolsVersion>4.0.0</droolsVersion>
15 years, 5 months
JBoss Rich Faces SVN: r11404 - in trunk/test-applications/seamApp/web/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-27 05:49:35 -0500 (Thu, 27 Nov 2008)
New Revision: 11404
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
Log:
+ seamTextSupport in editor
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-26 19:22:55 UTC (rev 11403)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/editor/Editor.java 2008-11-27 10:49:35 UTC (rev 11404)
@@ -12,8 +12,10 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.component.html.HtmlEditor;
-import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;;
+import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;
+;
+
@Name("editor")
@Scope(ScopeType.SESSION)
public class Editor {
@@ -33,10 +35,11 @@
private String dialogType;
private String language;
private boolean configuration;
+
// private String skin;
public Editor() {
- value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
+ value = "It's easy to make *bold text*, /italic text/, |monospace|,-deleted text-, super^scripts^ or _underlines_.";
width = "400";
height = "200";
theme = "simple";
@@ -44,7 +47,7 @@
immediate = false;
rendered = true;
required = false;
- useSeamText = false;
+ useSeamText = true;
viewMode = "visual";
readonly = false;
tabindex = "1";
@@ -53,8 +56,19 @@
// skin = "default";
configuration = false;
}
-
+
/*
+ * delete custom converter
+ */
+ public void useSeamTextLis(ValueChangeEvent e) {
+// if (useSeamText) {
+// htmlEditor.setConverter(convert);
+// } else {
+// htmlEditor.setConverter(null);
+// }
+ }
+
+ /*
* attach config file to editor
*/
public void useConfigFile(ValueChangeEvent e) {
@@ -64,7 +78,7 @@
htmlEditor.setConfiguration(null);
}
}
-
+
/*
* Custom valueChangeListener
*/
@@ -75,39 +89,39 @@
/*
* Custom Converter for editor
*/
- public Converter getConvert() {
- return new Converter() {
- public Object getAsObject(FacesContext context,
- UIComponent component, String newValue)
- throws ConverterException {
+// private Converter convert = new Converter() {
+// public Object getAsObject(FacesContext context, UIComponent component,
+// String newValue) throws ConverterException {
+//
+// System.out.println("!!! getAsObject work !!!");
+//
+// if (false)
+// throw new ConverterException(new FacesMessage(
+// FacesMessage.SEVERITY_ERROR, "Converter error",
+// "Error while convert to Object"));
+//
+// return newValue;
+// }
+//
+// public String getAsString(FacesContext context, UIComponent component,
+// Object value) throws ConverterException {
+//
+// System.out.println("!!! getAsString work !!!");
+//
+// if (false)
+// throw new ConverterException(new FacesMessage(
+// FacesMessage.SEVERITY_ERROR, "Converter error",
+// "Error while convert to String"));
+//
+// String result = (value == null) ? "" : value.toString();
+// return result;
+// }
+// };
- System.out.println("!!! getAsObject work !!!");
+// public Converter getConvert() {
+// return convert;
+// }
- if (false)
- throw new ConverterException(new FacesMessage(
- FacesMessage.SEVERITY_ERROR, "Converter error",
- "Error while convert to Object"));
-
- return newValue;
- }
-
- public String getAsString(FacesContext context,
- UIComponent component, Object value)
- throws ConverterException {
-
- System.out.println("!!! getAsString work !!!");
-
- if (false)
- throw new ConverterException(new FacesMessage(
- FacesMessage.SEVERITY_ERROR, "Converter error",
- "Error while convert to String"));
-
- String result = (value == null) ? "" : value.toString();
- return result;
- }
- };
- }
-
/*
* Custom Validator for Editor
*/
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-26 19:22:55 UTC (rev 11403)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/Editor.xhtml 2008-11-27 10:49:35 UTC (rev 11404)
@@ -11,16 +11,16 @@
height="#{editor.height}" theme="#{editor.theme}"
onchange="#{event.onchange}" oninit="#{event.oninit}"
onsave="#{event.onsave}" onsetup="#{event.onsetup}"
- autoResize="#{editor.autoResize}" converter="#{editor.convert}"
- converterMessage="converterMessage" immediate="#{editor.immediate}"
- rendered="#{editor.rendered}" required="#{editor.required}"
- requiredMessage="requiredMessage" useSeamText="#{editor.useSeamText}"
- validator="#{editor.validate}" validatorMessage="validatorMessage"
+ autoResize="#{editor.autoResize}" converterMessage="converterMessage"
+ immediate="#{editor.immediate}" rendered="#{editor.rendered}"
+ required="#{editor.required}" requiredMessage="requiredMessage"
+ useSeamText="#{editor.useSeamText}" validator="#{editor.validate}"
+ validatorMessage="validatorMessage"
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass" >
-
+ language="#{editor.language}" styleClass="EditorStyleClass">
+
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
</rich:editor>
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 19:22:55 UTC (rev 11403)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-27 10:49:35 UTC (rev 11404)
@@ -39,7 +39,7 @@
<h:outputText value="useSeamText (work only with Seam libraries): "></h:outputText>
<h:selectBooleanCheckbox value="#{editor.useSeamText}"
- onchange="submit();" />
+ valueChangeListener="#{editor.useSeamTextLis}" onchange="submit();" />
<h:outputText value="readonly: "></h:outputText>
<h:selectBooleanCheckbox value="#{editor.readonly}"
@@ -66,7 +66,7 @@
<f:selectItem itemValue="de" itemLabel="de" />
<f:selectItem itemValue="ru" itemLabel="ru" />
</h:selectOneRadio>
-
+
<h:outputText value="use configuration file: "></h:outputText>
<h:selectBooleanCheckbox value="#{editor.configuration}"
onchange="submit();" valueChangeListener="#{editor.useConfigFile}" />
15 years, 5 months
JBoss Rich Faces SVN: r11403 - in trunk/test-applications/seleniumTest/richfaces/src: main/resources/script/selenium and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-11-26 14:22:55 -0500 (Wed, 26 Nov 2008)
New Revision: 11403
Removed:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/core/
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/script/selenium/user-extensions.js
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
Log:
Selenium extension fix
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/resources/script/selenium/user-extensions.js
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/resources/script/selenium/user-extensions.js 2008-11-26 18:45:42 UTC (rev 11402)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/resources/script/selenium/user-extensions.js 2008-11-26 19:22:55 UTC (rev 11403)
@@ -1,3 +1,4 @@
+
IEBrowserBot.prototype._fireEventOnElement = function(eventType, element, clientX, clientY) {
var win = this.getCurrentWindow();
triggerEvent(element, 'focus', false);
@@ -46,4 +47,99 @@
}
throw e;
}
-};
\ No newline at end of file
+};
+
+
+
+Selenium.prototype.doDragAndDropToObject = function(locatorOfObjectToBeDragged, locatorOfDragDestinationObject) {
+/** Drags an element and drops it on another element
+ *
+ * @param locatorOfObjectToBeDragged an element to be dragged
+ * @param locatorOfDragDestinationObject an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped
+ */
+ var startX = this.getElementPositionLeft(locatorOfObjectToBeDragged);
+ var startY = this.getElementPositionTop(locatorOfObjectToBeDragged);
+
+ var destinationLeftX = this.getElementPositionLeft(locatorOfDragDestinationObject);
+ var destinationTopY = this.getElementPositionTop(locatorOfDragDestinationObject);
+ var destinationWidth = this.getElementWidth(locatorOfDragDestinationObject);
+ var destinationHeight = this.getElementHeight(locatorOfDragDestinationObject);
+
+ var endX = Math.round(destinationLeftX + (destinationWidth / 2));
+ var endY = Math.round(destinationTopY + (destinationHeight / 2));
+
+ var deltaX = endX - startX;
+ var deltaY = endY - startY;
+
+ var movementsString = "" + deltaX + "," + deltaY;
+
+ this.doDragAndDrop(locatorOfObjectToBeDragged, movementsString);
+ var objectToBeDragged = this.browserbot.findElement(locatorOfObjectToBeDragged);
+ var clientStartXY = getClientXY(objectToBeDragged)
+ var clientStartX = clientStartXY[0];
+ var clientStartY = clientStartXY[1];
+
+ var movements = movementsString.split(/,/);
+ var movementX = Number(movements[0]);
+ var movementY = Number(movements[1]);
+
+ var clientFinishX = ((clientStartX + movementX) < 0) ? 0 : (clientStartX + movementX);
+ var clientFinishY = ((clientStartY + movementY) < 0) ? 0 : (clientStartY + movementY);
+
+ // We should also fire event on DragDestinationObject.
+ var dragDestinationObject = this.browserbot.findElement(locatorOfDragDestinationObject);
+ this.browserbot.triggerMouseEvent(dragDestinationObject, 'mouseover', true, clientFinishX, clientFinishY);
+
+ this.browserbot.triggerMouseEvent(objectToBeDragged, 'mousemove', true, clientFinishX, clientFinishY);
+ this.browserbot.triggerMouseEvent(objectToBeDragged, 'mouseup', true, clientFinishX, clientFinishY);
+ this.browserbot.triggerMouseEvent(dragDestinationObject, 'mouseup', true, clientFinishX, clientFinishY);
+
+};
+
+
+Selenium.prototype.doDragAndDrop = function(locator, movementsString) {
+ /** Drags an element a certain distance and then drops it
+ * @param locator an element locator
+ * @param movementsString offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
+ */
+ var element = this.browserbot.findElement(locator);
+ var clientStartXY = getClientXY(element)
+ var clientStartX = clientStartXY[0];
+ var clientStartY = clientStartXY[1];
+
+ var movements = movementsString.split(/,/);
+ var movementX = Number(movements[0]);
+ var movementY = Number(movements[1]);
+
+ var clientFinishX = ((clientStartX + movementX) < 0) ? 0 : (clientStartX + movementX);
+ var clientFinishY = ((clientStartY + movementY) < 0) ? 0 : (clientStartY + movementY);
+
+ var mouseSpeed = this.mouseSpeed;
+ var move = function(current, dest) {
+ if (current == dest) return current;
+ if (Math.abs(current - dest) < mouseSpeed) return dest;
+ return (current < dest) ? current + mouseSpeed : current - mouseSpeed;
+ }
+
+ this.browserbot.triggerMouseEvent(element, 'mousedown', true, clientStartX, clientStartY);
+ this.browserbot.triggerMouseEvent(element, 'mousemove', true, clientStartX, clientStartY);
+ var clientX = clientStartX;
+ var clientY = clientStartY;
+
+ while ((clientX != clientFinishX) || (clientY != clientFinishY)) {
+ clientX = move(clientX, clientFinishX);
+ clientY = move(clientY, clientFinishY);
+ this.browserbot.triggerMouseEvent(element, 'mousemove', true, clientX, clientY);
+ }
+
+};
+
+try {
+if (commandFactory && selenium) {
+ commandFactory.registerAll(selenium);
+}
+}catch(e){}
+
+
+
+
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dnd/dndTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-11-26 18:45:42 UTC (rev 11402)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-11-26 19:22:55 UTC (rev 11403)
@@ -21,7 +21,10 @@
package org.richfaces;
+import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -118,7 +121,9 @@
if (getFirefoxTemplate() != null) {
config.setFirefoxProfileTemplate(new File(getFirefoxTemplate()));
}
+ config.setUserExtensions(new File(getClass().getClassLoader().getResource("script/selenium/user-extensions.js").toURI()));
config.setMultiWindow(false);
+
seleniumServer = new SeleniumServer(false, config);
seleniumServer.start();
}
@@ -138,11 +143,33 @@
synchronized (MUTEX) {
this.filterPrefix = filterPrefix;
selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
+ setFileExtensionContent();
selenium.start();
selenium.allowNativeXpath("false");
}
}
+
+ private void setFileExtensionContent() {
+ try {
+ File file = new File(getClass().getClassLoader().getResource(
+ "script/selenium/user-extensions.js").toURI());
+ FileInputStream stream = new FileInputStream(file);
+ ByteArrayOutputStream b = new ByteArrayOutputStream();
+ byte[] buffer = new byte[4096];
+ int read;
+ while ((read = stream.read(buffer)) > 0) {
+ b.write(buffer, 0, read);
+ }
+
+ String js = b.toString();
+ if (js != null && js.length() > 0) {
+ selenium.setExtensionJs(js);
+ }
+ } catch (Exception e) {
+ }
+ }
+
@BeforeTest
@Parameters({"loadStyleStrategy", "loadScriptStrategy"})
protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-11-26 18:45:42 UTC (rev 11402)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DnDTest.java 2008-11-26 19:22:55 UTC (rev 11403)
@@ -54,7 +54,7 @@
}
- @Test
+ // @Test
public void testDropValue(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
15 years, 5 months
JBoss Rich Faces SVN: r11402 - trunk/framework/api/src/main/java/org/ajax4jsf/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-11-26 13:45:42 -0500 (Wed, 26 Nov 2008)
New Revision: 11402
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
Log:
https://jira.jboss.org/jira/browse/RF-5004
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2008-11-26 15:58:57 UTC (rev 11401)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2008-11-26 18:45:42 UTC (rev 11402)
@@ -115,7 +115,12 @@
StringBuilder ret = new StringBuilder();
addEncodedString(ret, obj);
return ret.toString();
- }
+ } else if (obj instanceof Enum) {
+ // all other put as encoded strings.
+ StringBuilder ret = new StringBuilder();
+ addEncodedString(ret, obj);
+ return ret.toString();
+ }
// All other objects threaded as Java Beans.
try {
StringBuilder ret = new StringBuilder("{");
15 years, 5 months
JBoss Rich Faces SVN: r11401 - in trunk/test-applications/facelets/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-26 10:58:57 -0500 (Wed, 26 Nov 2008)
New Revision: 11401
Modified:
trunk/test-applications/facelets/src/main/java/editor/Editor.java
trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml
trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml
Log:
changes in editor config
Modified: trunk/test-applications/facelets/src/main/java/editor/Editor.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/editor/Editor.java 2008-11-26 15:39:00 UTC (rev 11400)
+++ trunk/test-applications/facelets/src/main/java/editor/Editor.java 2008-11-26 15:58:57 UTC (rev 11401)
@@ -26,8 +26,8 @@
private String tabindex;
private String dialogType;
private String language;
+ private boolean configuration;
// private String skin;
- private String configuration;
public Editor() {
value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
@@ -45,10 +45,21 @@
dialogType = "window";
language = "en";
// skin = "default";
- configuration = "";
+ configuration = false;
}
-
+
/*
+ * attach config file to editor
+ */
+ public void useConfigFile(ValueChangeEvent e) {
+ if (!configuration) {
+ htmlEditor.setConfiguration("editorconfig");
+ } else {
+ htmlEditor.setConfiguration(null);
+ }
+ }
+
+ /*
* Custom valueChangeListener
*/
public void valueChangeListener(ValueChangeEvent e) {
@@ -236,11 +247,11 @@
this.language = language;
}
- public String getConfiguration() {
- return (configuration == null)?"":configuration;
+ public boolean getConfiguration() {
+ return configuration;
}
- public void setConfiguration(String configuration) {
+ public void setConfiguration(boolean configuration) {
this.configuration = configuration;
}
Modified: trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml 2008-11-26 15:39:00 UTC (rev 11400)
+++ trunk/test-applications/facelets/src/main/webapp/Editor/Editor.xhtml 2008-11-26 15:58:57 UTC (rev 11401)
@@ -19,8 +19,7 @@
valueChangeListener="#{editor.valueChangeListener}"
viewMode="#{editor.viewMode}" readonly="#{editor.readonly}"
tabindex="#{editor.tabindex}" dialogType="#{editor.dialogType}"
- language="#{editor.language}" styleClass="EditorStyleClass"
- configuration="#{editor.configuration}">
+ language="#{editor.language}" styleClass="EditorStyleClass" >
<f:param name="theme_advanced_resizing" value="true" />
<f:param name="theme_advanced_statusbar_location" value="top" />
Modified: trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 15:39:00 UTC (rev 11400)
+++ trunk/test-applications/facelets/src/main/webapp/Editor/EditorProperty.xhtml 2008-11-26 15:58:57 UTC (rev 11401)
@@ -68,10 +68,8 @@
</h:selectOneRadio>
<h:outputText value="use configuration file: "></h:outputText>
- <h:selectOneRadio value="#{editor.configuration}" onchange="submit();">
- <f:selectItem itemValue="" itemLabel="do not use" />
- <f:selectItem itemValue="editorconfig" itemLabel="use editorconfig.properties" />
- </h:selectOneRadio>
+ <h:selectBooleanCheckbox value="#{editor.configuration}"
+ onchange="submit();" valueChangeListener="#{editor.useConfigFile}" />
</h:panelGrid>
<h:commandButton value="add test" action="#{editor.addHtmlEditor}"></h:commandButton>
</f:subview>
\ No newline at end of file
15 years, 5 months