JBoss Rich Faces SVN: r21403 - branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2011-02-02 17:56:49 -0500 (Wed, 02 Feb 2011)
New Revision: 21403
Modified:
branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java
Log:
RF-10416 fixed JDK 1.5 compile time issue
Modified: branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java 2011-02-02 19:54:54 UTC (rev 21402)
+++ branches/enterprise/3.3.X/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java 2011-02-02 22:56:49 UTC (rev 21403)
@@ -66,7 +66,7 @@
//freeze the pool
synchronized (DocumentBuilderPoolHolder._documentBuilderPool) {
//pop the top builder - if empty it will through EmptyStackException
- builder = (DocumentBuilder) DocumentBuilderPoolHolder._documentBuilderPool.pop();
+ builder = (DocumentBuilder) DocumentBuilderPoolHolder._documentBuilderPool.removeFirst();
}
} catch (NoSuchElementException e) {
//Stack is empty, create a new builder
@@ -90,7 +90,7 @@
builder.reset();
//push the builder back
- DocumentBuilderPoolHolder._documentBuilderPool.push(builder);
+ DocumentBuilderPoolHolder._documentBuilderPool.addFirst(builder);
}
}
}
13 years, 11 months
JBoss Rich Faces SVN: r21402 - in trunk/ui/output/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-02 14:54:54 -0500 (Wed, 02 Feb 2011)
New Revision: 21402
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
Log:
https://issues.jboss.org/browse/RF-10209
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2011-02-02 18:36:12 UTC (rev 21401)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2011-02-02 19:54:54 UTC (rev 21402)
@@ -22,6 +22,28 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.active;
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.disabled;
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.inactive;
+import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.DIV_ELEM;
+import static org.richfaces.renderkit.HtmlConstants.ID_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.SPAN_ELEM;
+import static org.richfaces.renderkit.HtmlConstants.STYLE_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.TBODY_ELEMENT;
+import static org.richfaces.renderkit.HtmlConstants.TD_ELEM;
+import static org.richfaces.renderkit.HtmlConstants.TR_ELEMENT;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.component.AbstractTabPanel;
@@ -32,18 +54,6 @@
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.Map;
-
-import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.*;
-import static org.richfaces.renderkit.HtmlConstants.*;
-import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
-
/**
* @author akolonitsky
* @since 2010-08-24
@@ -77,19 +87,21 @@
super.doEncodeBegin(w, context, component);
writeTabsLine(w, context, component);
- writeTabsLineSeparator(w);
+ writeTabsLineSeparator(w, component);
}
- private void writeTabsLineSeparator(ResponseWriter writer) throws IOException {
- writer.write("<div class='rf-tb-hdr_brd'></div>");
+ private void writeTabsLineSeparator(ResponseWriter writer, UIComponent component) throws IOException {
+ writer.startElement(DIV, component);
+ writer.writeAttribute(CLASS_ATTRIBUTE, "rf-tab-hdr-brd", null);
+ writer.endElement(DIV);
}
private void writeTabsLine(ResponseWriter w, FacesContext context, UIComponent comp) throws IOException {
w.startElement(DIV, comp);
- w.writeAttribute(CLASS, "rf-tb-hdr-tabline-vis", null);
+ w.writeAttribute(CLASS, "rf-tab-hdr-tabline-vis", null);
w.startElement("table", comp);
- w.writeAttribute(CLASS_ATTRIBUTE, "rf-tb-hdr-tabs", null);
+ w.writeAttribute(CLASS_ATTRIBUTE, "rf-tab-hdr-tabs", null);
w.writeAttribute("cellspacing", "0", null);
w.startElement(TBODY_ELEMENT, comp);
w.startElement(TR_ELEMENT, comp);
@@ -108,9 +120,9 @@
w.endElement(TBODY_ELEMENT);
w.endElement("table");
- writeTopTabsControl(w, comp, "rf-tb-hdr-scrl_l rf-tb-hdn", "\u00AB");
- writeTopTabsControl(w, comp, "rf-tb-hdr-tablst rf-tb-hdn", "\u2193");
- writeTopTabsControl(w, comp, "rf-tb-hdr-scrl_r rf-tb-hdn", "\u00BB");
+ writeTopTabsControl(w, comp, "rf-tab-hdr-scrl-lft rf-tab-hdn", "\u00AB");
+ writeTopTabsControl(w, comp, "rf-tab-hdr-tablst rf-tab-hdn", "\u2193");
+ writeTopTabsControl(w, comp, "rf-tab-hdr-scrl-rgh rf-tab-hdn", "\u00BB");
w.endElement(DIV_ELEM);
}
@@ -142,12 +154,12 @@
writer.startElement(TD_ELEM, tab);
writer.writeAttribute(ID_ATTRIBUTE, tab.getClientId(context) + ":header:" + state.toString(), null);
renderPassThroughAttributes(context, tab, HEADER_ATTRIBUTES);
- writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses("rf-tb-hdr rf-tb-hdr-" + state.abbreviation(),
+ writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses("rf-tab-hdr rf-tab-hdr-" + state.abbreviation(),
attributeAsString(tab, "headerClass"), attributeAsString(tab, state.headerClass())), null);
writer.writeAttribute(STYLE_ATTRIBUTE, concatStyles(isDisplay ? "" : "display : none", attributeAsString(tab, "headerStyle")), null);
- writer.startElement("span", tab);
- writer.writeAttribute(CLASS_ATTRIBUTE, "rf-tb-lbl", null);
+ writer.startElement(SPAN_ELEM, tab);
+ writer.writeAttribute(CLASS_ATTRIBUTE, "rf-tab-lbl", null);
UIComponent headerFacet = tab.getHeaderFacet(state);
if (headerFacet != null && headerFacet.isRendered()) {
@@ -159,7 +171,7 @@
}
}
- writer.endElement("span");
+ writer.endElement(SPAN_ELEM);
writer.endElement(TD_ELEM);
}
@@ -174,15 +186,15 @@
}
private void writeTopTabFirstSpacer(ResponseWriter w, UIComponent comp) throws IOException {
- writeTopTabSpacer(w, comp, "padding-left: 5px;", "rf-tb-hdr-spcr");
+ writeTopTabSpacer(w, comp, "padding-left: 5px;", "rf-tab-hdr-spcr");
}
private void writeTopTabSpacer(ResponseWriter w, UIComponent comp) throws IOException {
- writeTopTabSpacer(w, comp, "", "rf-tb-hdr-spcr rf-tb-hortab-tabspcr_wdh");
+ writeTopTabSpacer(w, comp, "", "rf-tab-hdr-spcr rf-tab-hortab-tabspcr-wdh");
}
private void writeTopTabLastSpacer(ResponseWriter w, UIComponent comp) throws IOException {
- writeTopTabSpacer(w, comp, "padding-right: 5px; width: 100%;", "rf-tb-hdr-spcr");
+ writeTopTabSpacer(w, comp, "padding-right: 5px; width: 100%;", "rf-tab-hdr-spcr");
}
private void writeTopTabSpacer(ResponseWriter w, UIComponent comp, String style, String styleClass) throws IOException {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2011-02-02 18:36:12 UTC (rev 21401)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2011-02-02 19:54:54 UTC (rev 21402)
@@ -67,7 +67,7 @@
@Override
protected String getStyleClass(UIComponent component) {
- return concatClasses("rf-tb", attributeAsString(component, "styleClass"));
+ return concatClasses("rf-tab", attributeAsString(component, "styleClass"));
}
@Override
@@ -104,7 +104,7 @@
private void encodeContentBegin(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException {
writer.startElement(DIV_ELEM, component);
- writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses("rf-tb-cnt", attributeAsString(component, "contentClass")), null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses("rf-tab-cnt", attributeAsString(component, "contentClass")), null);
writer.writeAttribute(ID_ATTRIBUTE, component.getClientId(context) + ":content", null);
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss 2011-02-02 18:36:12 UTC (rev 21401)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss 2011-02-02 19:54:54 UTC (rev 21402)
@@ -1,4 +1,4 @@
-.rf-tb-hdr {
+.rf-tab-hdr {
white-space: nowrap;
border: "1px solid #{richSkin.panelBorderColor}";
cursor : pointer;
@@ -12,7 +12,7 @@
}
-.rf-tb-hdr-act {
+.rf-tab-hdr-act {
border-bottom: 0px;
font-weight: bold;
vertical-align: top;
@@ -23,15 +23,15 @@
cursor: default;
}
-.rf-tb-hdr-inact {
+.rf-tab-hdr-inact {
}
-.rf-tb-hdr-dis {
+.rf-tab-hdr-dis {
color: "#{richSkin.tabDisabledTextColor}";
cursor: default;
}
-.rf-tb-hdr-tabline-vis {
+.rf-tab-hdr-tabline-vis {
background:url("#{resource['org.richfaces.images:tabLineBg.png']}") repeat-x scroll center top;
background-color: "#{richSkin.additionalBackgroundColor}";
@@ -48,31 +48,31 @@
position: relative;
}
-.rf-tb-hdr-tabs {
+.rf-tab-hdr-tabs {
border: 0px;
width: 100%;
height: 100%;
}
-.rf-tb-hdr-spcr {
+.rf-tab-hdr-spcr {
border-bottom: "1px solid #{richSkin.panelBorderColor}";
}
-.rf-tb-hortab-tabspcr_wdh {
+.rf-tab-hortab-tabspcr-wdh {
padding-left: 1px;
}
-.rf-tb-lbl {
+.rf-tab-lbl {
white-space: nowrap;
font-family: '#{richSkin.generalFamilyFont}';
font-size: '#{richSkin.generalSizeFont}';
}
-.rf-tb-hdn {
+.rf-tab-hdn {
display: none
}
-.rf-tb-hdr-scrl_l {
+.rf-tab-hdr-scrl-lft {
background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top repeat-x #{richSkin.additionalBackgroundColor}";
position: absolute;
top: 1px;
@@ -87,7 +87,7 @@
padding-top: 6px;
}
-.rf-tb-hdr-scrl_r {
+.rf-tab-hdr-scrl-rgh {
background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top repeat-x #{richSkin.additionalBackgroundColor}";
position: absolute;
top: 1px;
@@ -102,7 +102,7 @@
padding-top: 6px;
}
-.rf-tb-hdr-tablst {
+.rf-tab-hdr-tablst {
background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top repeat-x #{richSkin.additionalBackgroundColor}";
position: absolute;
top: 1px;
@@ -117,14 +117,14 @@
padding-top: 2px;
}
-.rf-tb-hdr_brd {
+.rf-tab-hdr-brd {
border: "1px solid #{richSkin.panelBorderColor}";
border-top: 0px;
height: 2px;
background: '#{richSkin.tabBackgroundColor}';
}
-.rf-tb-cnt {
+.rf-tab-cnt {
border: "1px solid #{richSkin.panelBorderColor}";
border-top: 0px;
font-family: '#{richSkin.generalFamilyFont}';
13 years, 11 months
JBoss Rich Faces SVN: r21401 - in trunk: cdk/generator and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-02 13:36:12 -0500 (Wed, 02 Feb 2011)
New Revision: 21401
Modified:
trunk/bom/pom.xml
trunk/cdk/generator/pom.xml
Log:
https://issues.jboss.org/browse/RF-10393
Modified: trunk/bom/pom.xml
===================================================================
--- trunk/bom/pom.xml 2011-02-02 18:33:40 UTC (rev 21400)
+++ trunk/bom/pom.xml 2011-02-02 18:36:12 UTC (rev 21401)
@@ -181,7 +181,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>r07</version>
+ <version>r08</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
Modified: trunk/cdk/generator/pom.xml
===================================================================
--- trunk/cdk/generator/pom.xml 2011-02-02 18:33:40 UTC (rev 21400)
+++ trunk/cdk/generator/pom.xml 2011-02-02 18:36:12 UTC (rev 21401)
@@ -125,8 +125,8 @@
be "provided" even though it is provided by container this is building a
maven plugin that runs outside of container TODO A better place for this
may be needed, cdk-parent/cdk-bom? -->
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
<version>2.0.3-b03</version>
</dependency>
<dependency>
13 years, 11 months
JBoss Rich Faces SVN: r21400 - in trunk/ui/input/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-02-02 13:33:40 -0500 (Wed, 02 Feb 2011)
New Revision: 21400
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
trunk/ui/input/ui/src/main/templates/select.template.xml
Log:
RF-9805
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2011-02-02 18:21:44 UTC (rev 21399)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.ecss 2011-02-02 18:33:40 UTC (rev 21400)
@@ -4,30 +4,31 @@
font-family: '#{richSkin.generalFamilyFont}';
}
+.rf-sel-cntr {
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.panelBorderColor}';
+ display: inline-block;
+ font-size: 1px;
+ white-space: nowrap;
+}
+
input.rf-sel-inp {
- border-width: 0px;
- width: 100%;
- color: '#{richSkin.generalTextColor}';
- font-size: '#{richSkin.generalSizeFont}';
- font-family: '#{richSkin.generalFamilyFont}';
+ background-color: '#{richSkin.controlBackgroundColor}';
+ background-image: url("#{resource['org.richfaces.renderkit.html.images.InputBackgroundImage']}");
+ background-position:1px 1px;
+ background-repeat:no-repeat;
+ border: 0px;
+ margin: 0px;
+ padding: 0px;
+ vertical-align: top;
+ width: 182px;
}
.rf-sel{
- width:200px;
display:inline-block;
}
-.rf-sel-fld{
- border-width: 1px;
- border-style: solid;
- border-color: '#{richSkin.panelBorderColor}';
- background-image: "url(#{resource['org.richfaces.renderkit.html.images.AutocompleteFieldGradient']})";
- background-repeat: repeat-x;
- background-position: top left;
- background-color: '#{richSkin.controlBackgroundColor}';
- width: 100%;
-}
-
.rf-sel-fld-err input{
color: #FF0000;
}
@@ -37,18 +38,11 @@
background-repeat: repeat-x;
background-position: top left;
background-color: '#{richSkin.headerBackgroundColor}';
- text-align: center;
- border-style: solid;
- border-width: 1px;
- border-color: '#{richSkin.panelBorderColor}';
- border-left-width: 0px;
-
- width: 15px;
- position: absolute;
- top: 0px;
- right: 0px;
- height: 200px;
- padding-top: 1px
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-left-color: '#{richSkin.panelBorderColor}';
+ display: inline-block;
+ vertical-align: top;
}
.rf-sel-btn-arrow{
@@ -57,7 +51,8 @@
background-image: "url(#{resource['org.richfaces:combo_down_button.gif']})";
cursor: pointer;
width: 15px;
- height: 15px;
+ height: 16px;
+ display: inline-block;
}
.rf-sel-btn-dis {
@@ -87,7 +82,6 @@
.rf-sel-lst-scrl{
overflow: auto;
overflow-x: hidden;
- width: 200px;
}
.rf-sel-opt{
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-02-02 18:21:44 UTC (rev 21399)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-02-02 18:33:40 UTC (rev 21400)
@@ -15,18 +15,13 @@
var inputLabel = this.__getValue() ;
this.initialValue = (inputLabel != this.defaultLabel) ? inputLabel : "";
this.selValueInput = $(document.getElementById(id+"selValue"));
- this.field = $(document.getElementById(id+"Field"));
+ this.container = this.selValueInput.parent();
this.clientItems = mergedOptions.items;
if(mergedOptions.showControl && !mergedOptions.disabled) {
- this.btn = $(document.getElementById(id+"Button"));
- this.btn.bind("mousedown", $.proxy(this.__onBtnMouseDown, this));
- this.btn.bind("mouseup", $.proxy(this.__onMouseUp, this));
-
- this.fld = $(document.getElementById(id+"Field"));
- this.fld.bind("mousedown", $.proxy(this.__onBtnMouseDown, this));
- this.fld.bind("mouseup", $.proxy(this.__onMouseUp, this));
+ this.container.bind("mousedown", $.proxy(this.__onBtnMouseDown, this))
+ .bind("mouseup", $.proxy(this.__onMouseUp, this));
}
this.selectFirst = mergedOptions.selectFirst;
@@ -158,9 +153,9 @@
var items = this.popupList.__getItems();
if(items.length != 0) {
- this.field.removeClass("rf-sel-fld-err");
+ this.container.removeClass("rf-sel-fld-err");
} else {
- this.field.addClass("rf-sel-fld-err");
+ this.container.addClass("rf-sel-fld-err");
}
if(!this.popupList.isVisible()) {
@@ -223,7 +218,7 @@
}
});
} else {
- this.field.removeClass("rf-sel-fld-err");
+ this.container.removeClass("rf-sel-fld-err");
var prevValue = this.selValueInput.val();
if(prevValue && prevValue != "") {
Modified: trunk/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/select.template.xml 2011-02-02 18:21:44 UTC (rev 21399)
+++ trunk/ui/input/ui/src/main/templates/select.template.xml 2011-02-02 18:33:40 UTC (rev 21400)
@@ -20,32 +20,30 @@
<cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
<div id="#{clientId}" class="rf-sel">
- <div style="position : relative; overflow : hidden; text-align : left; padding-right : 18px;">
+ <span class="rf-sel-cntr">
<input id="#{clientId}selValue" name="#{clientId}" type="hidden" value="#{getInputValue(facesContext, component)}"/>
- <div id="#{clientId}Field" class="rf-sel-fld">
- <input cdk:passThroughWithExclusions="class autocomplete id value disabled name type readonly onchange onblur onfocus"
- id="#{clientId}Input"
- value="#{getSelectLabel(facesContext, component)}"
- disabled="#{disabled}"
- name="#{clientId}Input"
- type="text"
- class="rf-sel-inp"
- autocomplete="off"
- readonly="#{component.attributes['enableManualInput'] ? '' : 'readonly'}"/>
- </div>
+ <input cdk:passThroughWithExclusions="class autocomplete id value disabled name type readonly onchange onblur onfocus"
+ id="#{clientId}Input"
+ value="#{getSelectLabel(facesContext, component)}"
+ disabled="#{disabled}"
+ name="#{clientId}Input"
+ type="text"
+ class="rf-sel-inp"
+ autocomplete="off"
+ readonly="#{component.attributes['enableManualInput'] ? '' : 'readonly'}"/>
<c:if test="#{component.attributes['showButton']}">
<c:if test="#{component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-sel-btn rf-sel-btn-dis">
- <div class="rf-sel-btn-arrow"></div>
- </div>
+ <span id="#{clientId}Button" class="rf-sel-btn rf-sel-btn-dis">
+ <span class="rf-sel-btn-arrow"></span>
+ </span>
</c:if>
<c:if test="#{!component.attributes['disabled']}">
- <div id="#{clientId}Button" class="rf-sel-btn">
- <div class="rf-sel-btn-arrow"></div>
- </div>
+ <span id="#{clientId}Button" class="rf-sel-btn">
+ <span class="rf-sel-btn-arrow"></span>
+ </span>
</c:if>
</c:if>
- </div>
+ </span>
<div id="#{clientId}List" class="#{getListCss(component)}">
<cdk:call expression="renderListHandlers(facesContext, component);"/>
13 years, 11 months
JBoss Rich Faces SVN: r21399 - in trunk: examples/dnd-demo/src/main/webapp/examples and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-02 13:21:44 -0500 (Wed, 02 Feb 2011)
New Revision: 21399
Modified:
trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml
trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java
Log:
RF-10334 Drop Target - add @immediate, @bypassUpdates and @execute attributes
Modified: trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
===================================================================
--- trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java 2011-02-02 18:14:00 UTC (rev 21398)
+++ trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java 2011-02-02 18:21:44 UTC (rev 21399)
@@ -17,7 +17,56 @@
private String dragValue2 = "dragValue 2";
private String dragValue3 = "dragValue 3";
private String acceptedTypes = "drg1, drg2";
+ private String phaseId = "none";
+ private boolean immediate = false;
+ private boolean bypassUpdates = false;
+ private Object execute;
+ private String executeTest = "none";
+
+ public String getExecuteTest() {
+ return executeTest;
+ }
+
+ public void setExecuteTest(String executeTest) {
+ this.executeTest = executeTest;
+ }
+ public Object getExecute() {
+ return execute;
+ }
+
+ public void setExecute(Object execute) {
+ this.execute = execute;
+ }
+
+
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public boolean isBypassUpdates() {
+ return bypassUpdates;
+ }
+
+ public void setBypassUpdates(boolean bypassUpdates) {
+ this.bypassUpdates = bypassUpdates;
+ }
+
+ public String getPhaseId() {
+ return phaseId;
+ }
+
+ public void setPhaseId(String phaseId) {
+ this.phaseId = phaseId;
+ }
+
+
+
public List<String> getDropValues(){
return dropValues;
}
@@ -58,10 +107,8 @@
this.acceptedTypes = acceptedTypes;
}
- public void processEvent(DropEvent event) {
- String value = (String)event.getDragValue();
- dropValues.add(value);
- System.out.println("DataBean.processEvent()");
+ public void addDropValues(String value){
+ dropValues.add(value);
}
public void makeAcceptedTypesNullable(){
Modified: trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml
===================================================================
--- trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml 2011-02-02 18:14:00 UTC (rev 21398)
+++ trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml 2011-02-02 18:21:44 UTC (rev 21399)
@@ -83,20 +83,37 @@
action="#{dataBean.makeAcceptedTypesNullable}"
render="drp"/>
</li>
+ <li>
+ <h:outputText value="Immediate:"/>
+ <h:selectBooleanCheckbox value="#{dataBean.immediate}">
+ <a4j:ajax render="drp @this"/>
+ </h:selectBooleanCheckbox>
+ </li>
+ <li>
+ <h:outputText value="bypassUpdates:"/>
+ <h:selectBooleanCheckbox value="#{dataBean.bypassUpdates}">
+ <a4j:ajax render="drp @this"/>
+ </h:selectBooleanCheckbox>
+ </li>
</ul>
</td>
</tr>
</table>
<a4j:outputPanel id="drp" layout="block" styleClass="droppable">
- <dnd:dropTarget acceptedTypes="#{dataBean.acceptedTypes}" dropListener="#{dataBean.processEvent}"
- render="grid"/>
+ <dnd:dropTarget acceptedTypes="#{dataBean.acceptedTypes}" dropListener="#{dropListenerBean.processDrop}"
+ render="grid executeOut" execute="executeIn" immediate="#{dataBean.immediate}" bypassUpdates="#{dataBean.bypassUpdates}"/>
<h:dataTable id="grid" var="dropValue" value="#{dataBean.dropValues}">
<h:column>
- <h:outputText value="#{dropValue}"/>
+ <h:outputText value="#{dropValue}"/> : <h:outputText value="#{dataBean.phaseId}" />;
</h:column>
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="execute" layout="block">
+ <h:inputText id="executeIn" value="#{dataBean.executeTest}"/> <br/>
+ <h:outputText id="executeOut" value="#{dataBean.executeTest}"/> <br/>
+ </a4j:outputPanel>
</h:form>
</h:body>
</html>
\ No newline at end of file
Modified: trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java
===================================================================
--- trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java 2011-02-02 18:14:00 UTC (rev 21398)
+++ trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java 2011-02-02 18:21:44 UTC (rev 21399)
@@ -47,29 +47,50 @@
tag = @Tag(name="dropTarget" ,handler="org.richfaces.view.facelets.DropHandler", type = TagType.Facelets)
)
public abstract class AbstractDropTarget extends UIComponentBase {
-
+
public static final String COMPONENT_TYPE = "org.richfaces.DropTarget";
- public static final String COMPONENT_FAMILY = "org.richfaces.DropTarget";
-
-
+ public static final String COMPONENT_FAMILY = "org.richfaces.DropTarget";
+
+
@Attribute
public abstract Object getDropValue();
-
+
+ @Attribute
+ public abstract boolean isImmediate();
+
+ @Attribute
+ public abstract boolean isBypassUpdates();
+
+ @Attribute
+ public abstract Object getExecute();
+
public abstract Object getAcceptedTypes();
-
+
public void addDropListener(DropListener listener) {
addFacesListener(listener);
}
+
+ public DropListener[] getDropListeners() {
+ return (DropListener[]) getFacesListeners(DropListener.class);
+ }
public void removeDropListener(DropListener listener) {
removeFacesListener(listener);
}
-
+
@Override
public void queueEvent(FacesEvent event) {
- if(event instanceof DropEvent) {
- event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ if (event instanceof DropEvent) {
+
+ if (isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (isBypassUpdates()) {
+ event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
+
}
super.queueEvent(event);
}
13 years, 11 months
JBoss Rich Faces SVN: r21398 - in trunk: ui/input/ui/src/main/resources/META-INF/resources/org.richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-02-02 13:14:00 -0500 (Wed, 02 Feb 2011)
New Revision: 21398
Modified:
trunk/examples/input-demo/src/main/webapp/examples/inplaceInput.xhtml
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
Log:
https://jira.jboss.org/browse/RF-10341
Modified: trunk/examples/input-demo/src/main/webapp/examples/inplaceInput.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/inplaceInput.xhtml 2011-02-02 17:08:33 UTC (rev 21397)
+++ trunk/examples/input-demo/src/main/webapp/examples/inplaceInput.xhtml 2011-02-02 18:14:00 UTC (rev 21398)
@@ -15,6 +15,8 @@
<in:inplaceInput showControls="true" value="New York">
</in:inplaceInput>
<h:commandButton value="submit"/>
+ <in:inplaceInput showControls="true" defaultLabel="click to enter your name" saveOnBlur="true" onblur="RichFaces.$('form:ii').cancel()" id="ii">
+ </in:inplaceInput>
</h:form>
</h:body>
</html>
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2011-02-02 17:08:33 UTC (rev 21397)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2011-02-02 18:14:00 UTC (rev 21398)
@@ -63,6 +63,7 @@
var value = this.__getValue()
if(value.length > 0) {
this.setLabel(value);
+ this.useDefaultLabel = false;
} else {
this.setLabel(this.defaultLabel);
this.useDefaultLabel = true;
@@ -77,8 +78,8 @@
cancel: function(){
var text = "";
if(!this.useDefaultLabel) {
- text = this.getLabel()
- }
+ text = this.getLabel();
+ }
this.__setValue(text);
this.isSaved = true;
this.oncancel();
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2011-02-02 17:08:33 UTC (rev 21397)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2011-02-02 18:14:00 UTC (rev 21398)
@@ -8,7 +8,8 @@
this.label = $(document.getElementById(id+"Label"));
var labelText = this.label.text();
var inputLabel = this.__getValue();
- this.initialValue = (labelText == inputLabel) ? labelText : "";
+ this.initialLabel = (labelText == inputLabel) ? labelText : "";
+ this.useDefaultLabel = labelText != inputLabel
this.saveOnBlur = mergedOptions.saveOnBlur;
this.showControls = mergedOptions.showControls;
this.getInput().bind("focus", $.proxy(this.__editHandler, this));
@@ -102,7 +103,7 @@
},
isValueChanged: function () {
- return (this.__getValue() != this.initialValue);
+ return (this.__getValue() != this.initialLabel);
},
onshow: function(){
@@ -153,7 +154,11 @@
__isFocused: function() {
return this.focused;
- }
+ },
+ setValue: function(value) {
+ this.__setValue(value);
+ this.save();
+ }
}
})());
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-02-02 17:08:33 UTC (rev 21397)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-02-02 18:14:00 UTC (rev 21398)
@@ -11,6 +11,7 @@
this.popupList = new rf.ui.PopupList(id+"List", this, mergedOptions);
this.items = mergedOptions.items;
this.selValueInput = $(document.getElementById(id+"selValue"));
+ this.initialValue = this.selValueInput.val();
this.list = $(document.getElementById(id+"List"));
this.list.bind("mousedown", $.proxy(this.__onListMouseDown, this));
this.list.bind("mouseup", $.proxy(this.__onListMouseUp, this));
@@ -79,19 +80,42 @@
this.popupList.hide();
this.__showLabel();
},
+
+ __selectItemByValue: function(value) {
+ var item;
+ for (var i=0; i<this.items.length; i++) {
+ item = this.items[i];
+ if (item.value == value) {
+ this.popupList.__selectByIndex(i);
+ return;
+ }
+ }
+ this.popupList.resetSelection();
+ },
+
onsave: function() {
var item = this.popupList.currentSelectItem();
if(item) {
- this.savedIndex = this.popupList.getSelectedItemIndex();
- var value = this.getItemValue(item);
- this.saveItemValue(value);
+ var index = this.popupList.getSelectedItemIndex();
+ if (this.items[index].label == this.__getValue()) {
+ this.savedIndex = index;
+ var value = this.getItemValue(item);
+ this.saveItemValue(value);
+ this.popupList.__selectByIndex(this.savedIndex);
+ } else {
+ this.__selectItemByValue(this.getValue());
+ }
}
},
oncancel: function() {
var prevItem = this.popupList.getItemByIndex(this.savedIndex);
- if(prevItem) {
+ if (prevItem) {
var value = this.getItemValue(prevItem);
this.saveItemValue(value);
+ this.popupList.__selectByIndex(this.savedIndex);
+ } else {
+ this.saveItemValue(this.initialValue);
+ this.__selectItemByValue(this.initialValue);
}
},
onblur: function(e) {
@@ -226,8 +250,8 @@
item = this.items[i];
if (item.value == value) {
this.__setValue(item.label);
+ this.popupList.__selectByIndex(i);
this.save();
- this.popupList.__selectByIndex(i);
break;
}
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2011-02-02 17:08:33 UTC (rev 21397)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2011-02-02 18:14:00 UTC (rev 21398)
@@ -98,7 +98,7 @@
item.removeClass(this.selectItemCss);
}
},
-
+
currentSelectItem: function() {
if(this.items && this.index != -1) {
return this.items[this.index];
@@ -110,19 +110,17 @@
},
getItemByIndex: function(i) {
- if(i >= 0 && i <= this.items.length) {
+ if(i >= 0 && i < this.items.length) {
return this.items[i];
}
},
- resetItemsSelection: function() {
- if(this.items) {
- var popup = this;
- this.items.each(function(i,item){
- popup.unselectItem($(item));
- }
- );
+ resetSelection: function() {
+ var item = this.currentSelectItem();
+ if(item) {
+ this.unselectItem($(item));
}
+ this.index = -1;
},
isPopupList: function(target) {
@@ -172,7 +170,7 @@
item = this.items.eq(this.index);
this.selectItem(item);
},
-
+
__selectCurrent: function() {
var item;
if(this.items && this.index >= 0) {
Modified: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2011-02-02 17:08:33 UTC (rev 21397)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2011-02-02 18:14:00 UTC (rev 21398)
@@ -62,7 +62,7 @@
HtmlElement span = page.getFirstByXPath("//*[@id = '"+ withControlsComponentId +"']");
assertNotNull(span);
- assertEquals("rf-ii-d-s rf-ii-c-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-d-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
edit(page, withControlsComponentId, "Another Test String");
13 years, 11 months
JBoss Rich Faces SVN: r21397 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richInplaceSelect and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-02-02 12:08:33 -0500 (Wed, 02 Feb 2011)
New Revision: 21397
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
Log:
https://issues.jboss.org/browse/RF-9037
* added 9 new tests for inplace select
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2011-02-02 16:01:47 UTC (rev 21396)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2011-02-02 17:08:33 UTC (rev 21397)
@@ -81,7 +81,18 @@
// TODO has to be tested in another way
attributes.remove("converter");
+ attributes.remove("converterMessage");
+ attributes.remove("required");
+ attributes.remove("requiredMessage");
attributes.remove("validator");
+ attributes.remove("validatorMessage");
+ attributes.remove("valueChangeListener");
+
+ // TODO remove as soon as RF-10411 is resolved
+ attributes.setAttribute("changedStateClass", null);
+ attributes.setAttribute("disabledStateClass", null);
+ attributes.setAttribute("editStateClass", null);
+ attributes.setAttribute("readyStateClass", null);
}
public Attributes getAttributes() {
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml 2011-02-02 16:01:47 UTC (rev 21396)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml 2011-02-02 17:08:33 UTC (rev 21397)
@@ -49,6 +49,7 @@
editEvent="#{richInplaceSelectBean.attributes['editEvent'].value}"
editStateClass="#{richInplaceSelectBean.attributes['editStateClass'].value}"
immediate="#{richInplaceSelectBean.attributes['immediate'].value}"
+ inputWidth="#{richInplaceSelectBean.attributes['inputWidth'].value}"
itemClass="#{richInplaceSelectBean.attributes['itemClass'].value}"
listClass="#{richInplaceSelectBean.attributes['listClass'].value}"
listHeight="#{richInplaceSelectBean.attributes['listHeight'].value}"
@@ -98,6 +99,7 @@
selectItemClass="#{richInplaceSelectBean.attributes['selectItemClass'].value}"
showControls="#{richInplaceSelectBean.attributes['showControls'].value}"
state="#{richInplaceSelectBean.attributes['state'].value}"
+ style="#{richInplaceSelectBean.attributes['style'].value}"
tabindex="#{richInplaceSelectBean.attributes['tabindex'].value}"
validatorMessage="#{richInplaceSelectBean.attributes['validatorMessage'].value}"
value="#{richInplaceSelectBean.attributes['value'].value}"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-02-02 16:01:47 UTC (rev 21396)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-02-02 17:08:33 UTC (rev 21397)
@@ -30,9 +30,12 @@
import static org.testng.Assert.assertTrue;
import java.net.URL;
+import javax.faces.event.PhaseId;
import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
@@ -101,6 +104,21 @@
}
@Test
+ public void testChangedStateClass() {
+ selenium.type(pjq("input[id$=changedStateClassInput]"), "metamer-ftest-class");
+ selenium.waitForPageToLoad();
+
+ selenium.click(select);
+ selenium.click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
+ waitGui.failWith("Output did not change.").until(textEquals.locator(output).text("Hawaii"));
+
+ JQueryLocator elementWhichHasntThatClass = jq(select.getRawLocator() + ":not(.metamer-ftest-class)");
+ assertTrue(selenium.isElementPresent(select));
+ assertFalse(selenium.isElementPresent(elementWhichHasntThatClass));
+ }
+
+ @Test
public void testDefaultLabel() {
selenium.type(pjq("input[type=text][id$=defaultLabelInput]"), "new label");
selenium.waitForPageToLoad();
@@ -117,6 +135,31 @@
}
@Test
+ public void testDisabled() {
+ selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ selenium.type(pjq("input[type=text][id$=valueInput]"), "Hawaii");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.isElementPresent(select), "Inplace input is not on the page.");
+ assertTrue(selenium.isElementPresent(label), "Default label should be present on the page.");
+ assertEquals(selenium.getText(label), "Hawaii", "Default label");
+ assertFalse(selenium.isElementPresent(input), "Input should not be present on the page.");
+ assertFalse(selenium.isElementPresent(okButton), "OK button should not be present on the page.");
+ assertFalse(selenium.isElementPresent(cancelButton), "Cancel button should not be present on the page.");
+ assertFalse(selenium.isElementPresent(edit), "Edit should not be present on the page.");
+ }
+
+ @Test
+ public void testDisabledStateClass() {
+ selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testStyleClass(select, "disabledStateClass");
+ }
+
+ @Test
public void testEditEvent() {
selenium.type(pjq("input[type=text][id$=editEventInput]"), "mouseup");
selenium.waitForPageToLoad();
@@ -128,6 +171,51 @@
}
@Test
+ public void testEditStateClass() {
+ selenium.type(pjq("input[id$=editStateClassInput]"), "metamer-ftest-class");
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.belongsClass(select, "metamer-ftest-class"), "Inplace input should not have class metamer-ftest-class.");
+
+ selenium.click(select);
+ assertTrue(selenium.belongsClass(select, "metamer-ftest-class"), "Inplace input should have class metamer-ftest-class.");
+
+ selenium.click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
+ assertFalse(selenium.belongsClass(select, "metamer-ftest-class"), "Inplace input should not have class metamer-ftest-class.");
+ }
+
+ @Test
+ public void testImmediate() {
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ String reqTime = selenium.getText(time);
+ selenium.click(select);
+ selenium.click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
+
+ phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "value changed: -> Hawaii");
+ }
+
+ @Test
+ public void testInputWidth() {
+ selenium.type(pjq("input[type=text][id$=inputWidthInput]"), "300px");
+ selenium.waitForPageToLoad();
+
+ String width = selenium.getStyle(input, CssProperty.WIDTH);
+ assertEquals(width, "300px", "Width of input did not change.");
+
+ selenium.type(pjq("input[type=text][id$=inputWidthInput]"), "");
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isAttributePresent(input.getAttribute(Attribute.STYLE)), "Input should not have attribute style.");
+ }
+
+ @Test
public void testItemClass() {
final String value = "metamer-ftest-class";
selenium.type(pjq("input[type=text][id$=itemClassInput]"), value);
@@ -401,6 +489,11 @@
}
@Test
+ public void testReadyStateClass() {
+ testStyleClass(select, "readyStateClass");
+ }
+
+ @Test
public void testRendered() {
selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
selenium.waitForPageToLoad();
@@ -459,7 +552,7 @@
selenium.click(options.format(10));
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
-
+
guardNoRequest(selenium).fireEvent(input, Event.BLUR);
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
assertEquals(selenium.getValue(input), "Click here to edit", "Input should contain default label.");
@@ -528,4 +621,23 @@
assertFalse(selenium.isDisplayed(popup), "Popup should not be displayed.");
}
}
+
+ @Test
+ public void testTabindex() {
+ AttributeLocator<?> attr = input.getAttribute(new Attribute("tabindex"));
+
+ selenium.type(pjq("input[id$=tabindexInput]"), "47");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.getAttribute(attr).contains("47"), "Attribute tabindex should contain \"47\".");
+ }
+
+ @Test
+ public void testValue() {
+ selenium.type(pjq("input[type=text][id$=valueInput]"), "North Carolina");
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.belongsClass(edit, "rf-is-none"), "Edit should contain class rf-is-none when popup is closed.");
+ assertEquals(selenium.getText(label), "North Carolina", "Label should contain selected value.");
+ }
}
13 years, 11 months
JBoss Rich Faces SVN: r21396 - modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-02 11:01:47 -0500 (Wed, 02 Feb 2011)
New Revision: 21396
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml
Log:
Removal of legacy jboss-scanning.xml files
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
+++ modules/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:47 UTC (rev 21396)
@@ -1,10 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-
- <path name="WEB-INF/classes">
- </path>
-
- <path name="WEB-INF/lib/guava-r05.jar">
- <exclude name="com.google.common.collect" />
- </path>
-
-</scanning>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21395 - in trunk: archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF and 10 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-02 11:01:40 -0500 (Wed, 02 Feb 2011)
New Revision: 21395
Removed:
trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
Log:
Removal of legacy jboss-scanning.xml files
Deleted: trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,14 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/irc-client/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/push-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
Deleted: trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:36 UTC (rev 21394)
+++ trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2011-02-02 16:01:40 UTC (rev 21395)
@@ -1,11 +0,0 @@
-<scanning xmlns="urn:jboss:scanning:1.0">
-<!--
- For JBoss AS 6 integration there is a conflict with guava, and
- google-collections. JBAS-8361
--->
- <path name="WEB-INF/classes"></path>
-
- <path name="WEB-INF/lib/guava-r07.jar">
- <exclude name="com.google.common.collect" />
- </path>
-</scanning>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21394 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-02 11:01:36 -0500 (Wed, 02 Feb 2011)
New Revision: 21394
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TreeNodeAttributes.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
Log:
rich:treeNode - automate test case (RFPL-1052)
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties 2011-02-02 15:55:57 UTC (rev 21393)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties 2011-02-02 16:01:36 UTC (rev 21394)
@@ -1,5 +1,5 @@
-attr.dir.rtl=RTL
-attr.dir.ltr=LTR
+attr.dir.rtl=rtl
+attr.dir.ltr=ltr
attr.dir.null=
attr.selectionType.client=client
attr.selectionType.ajax=ajax
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties 2011-02-02 15:55:57 UTC (rev 21393)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeNodeBean.properties 2011-02-02 16:01:36 UTC (rev 21394)
@@ -1,5 +1,5 @@
-attr.dir.rtl=RTL
-attr.dir.ltr=LTR
+attr.dir.rtl=rtl
+attr.dir.ltr=ltr
attr.dir.null=
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-02 15:55:57 UTC (rev 21393)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-02 16:01:36 UTC (rev 21394)
@@ -58,6 +58,10 @@
public <T extends ExtendedLocator<JQueryLocator>> AbstractComponentAttributes(T root) {
this.root.setLocator(root);
}
+
+ public ExtendedLocator<JQueryLocator> getRoot() {
+ return root.getLocator();
+ }
protected String getProperty(String propertyName) {
final ElementLocator<?> locator = propertyLocator.format(propertyName, "");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-02-02 15:55:57 UTC (rev 21393)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-02-02 16:01:36 UTC (rev 21394)
@@ -31,6 +31,7 @@
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
import java.net.URL;
import java.util.Locale;
@@ -49,6 +50,8 @@
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.reference.LocatorReference;
+import org.jboss.test.selenium.locator.reference.ReferencedLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.jboss.test.selenium.waiting.retrievers.Retriever;
import org.jboss.test.selenium.waiting.retrievers.TextRetriever;
@@ -66,7 +69,7 @@
* @version $Revision$
*/
public abstract class AbstractMetamerTest extends AbstractTestCase {
-
+
protected JQueryLocator time = jq("span[id$=requestTime]");
protected JQueryLocator renderChecker = jq("span[id$=renderChecker]");
protected JQueryLocator statusChecker = jq("span[id$=statusCheckerOutput]");
@@ -75,6 +78,9 @@
protected TextRetriever retrieveRenderChecker = retrieveText.locator(jq("#renderChecker"));
protected TextRetriever retrieveStatusChecker = retrieveText.locator(jq("#statusCheckerOutput"));
protected PhaseInfo phaseInfo = new PhaseInfo();
+
+
+ protected LocatorReference<JQueryLocator> attributesRoot = new LocatorReference<JQueryLocator>(pjq("span[id$=:attributes:panel]"));
/**
* timeout in miliseconds
@@ -214,7 +220,7 @@
* name of the attribute that will be set (e.g. style, headerStyle, itemContentStyle)
*/
protected void testStyle(ElementLocator<?> element, String attribute) {
- ElementLocator<?> styleInput = pjq("input[id$=" + attribute + "Input]");
+ ElementLocator<?> styleInput = ref(attributesRoot, "input[id$=" + attribute + "Input]");
final String value = "background-color: yellow; font-size: 1.5em;";
selenium.type(styleInput, value);
@@ -234,7 +240,7 @@
* name of the attribute that will be set (e.g. styleClass, headerClass, itemContentClass)
*/
protected void testStyleClass(ExtendedLocator<JQueryLocator> element, String attribute) {
- ElementLocator<?> classInput = pjq("input[id$=" + attribute + "Input]");
+ ElementLocator<?> classInput = ref(attributesRoot, "input[id$=" + attribute + "Input]");
final String styleClass = "metamer-ftest-class";
selenium.type(classInput, styleClass);
@@ -247,7 +253,9 @@
public void testRequestEventsBefore(String... events) {
for (String event : events) {
- selenium.type(pjq(format("input[type=text][id$=on{0}Input]", event)), format("metamerEvents += \"{0} \"", event));
+ ReferencedLocator<JQueryLocator> input = ref(attributesRoot, "input[type=text][id$=on{0}Input]");
+ input = input.format(event);
+ selenium.type(input, format("metamerEvents += \"{0} \"", event));
selenium.waitForPageToLoad();
}
@@ -270,8 +278,9 @@
* locator of tested element
*/
protected void testDir(ElementLocator<?> element) {
- JQueryLocator ltrInput = pjq("input[type=radio][name$=dirInput][value=ltr],input[type=radio][name$=dirInput][value=LTR]");
- JQueryLocator rtlInput = pjq("input[type=radio][name$=dirInput][value=rtl],input[type=radio][name$=dirInput][value=RTL]");
+ ElementLocator<?> ltrInput = ref(attributesRoot, "input[type=radio][name$=dirInput][value=ltr]");
+ ElementLocator<?> rtlInput = ref(attributesRoot, "input[type=radio][name$=dirInput][value=rtl]");
+
AttributeLocator<?> dirAttribute = element.getAttribute(new Attribute("dir"));
// dir = null
@@ -324,7 +333,7 @@
* locator of tested element
*/
protected void testTitle(ElementLocator<?> element) {
- JQueryLocator input = pjq("input[type=text][id$=titleInput]");
+ ElementLocator<?> input = ref(attributesRoot, "input[type=text][id$=titleInput]");
AttributeLocator<?> attribute = element.getAttribute(new Attribute("title"));
// title = null
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-02-02 15:55:57 UTC (rev 21393)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-02-02 16:01:36 UTC (rev 21394)
@@ -56,6 +56,7 @@
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.richTreeNode.TreeNodeAttributes;
import org.testng.annotations.Test;
/**
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java 2011-02-02 15:55:57 UTC (rev 21393)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java 2011-02-02 16:01:36 UTC (rev 21394)
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *******************************************************************************/
-package org.richfaces.tests.metamer.ftest.richTree;
-
-import org.jboss.test.selenium.locator.ExtendedLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TreeNodeAttributes extends AbstractComponentAttributes {
-
- public TreeNodeAttributes() {
- }
-
- public <T extends ExtendedLocator<JQueryLocator>> TreeNodeAttributes(T root) {
- super(root);
- }
-
- public void setDir(String dir) {
- setProperty("dir", dir);
- }
-
- public void setIconCollapsed(String iconCollapsed) {
- setProperty("iconCollapsed", iconCollapsed);
- }
-
- public void setIconExpanded(String iconExpanded) {
- setProperty("iconExpanded", iconExpanded);
- }
-
- public void setIconLeaf(String iconLeaf) {
- setProperty("iconLeaf", iconLeaf);
- }
-
- public void setImmediate(Boolean immediate) {
- setProperty("immediate", immediate);
- }
-
- public void setLang(String lang) {
- setProperty("lang", lang);
- }
-
- public void setRendered(Boolean rendered) {
- setProperty("rendered", rendered);
- }
-
- public void setTitle(String title) {
- setProperty("title", title);
- }
-}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TestTreeNodeSimple.java 2011-02-02 16:01:36 UTC (rev 21394)
@@ -0,0 +1,297 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTreeNode;
+
+import static org.jboss.test.selenium.JQuerySelectors.append;
+import static org.jboss.test.selenium.JQuerySelectors.not;
+import static org.jboss.test.selenium.dom.Event.CLICK;
+import static org.jboss.test.selenium.dom.Event.DBLCLICK;
+import static org.jboss.test.selenium.dom.Event.KEYDOWN;
+import static org.jboss.test.selenium.dom.Event.KEYPRESS;
+import static org.jboss.test.selenium.dom.Event.KEYUP;
+import static org.jboss.test.selenium.dom.Event.MOUSEDOWN;
+import static org.jboss.test.selenium.dom.Event.MOUSEMOVE;
+import static org.jboss.test.selenium.dom.Event.MOUSEOUT;
+import static org.jboss.test.selenium.dom.Event.MOUSEOVER;
+import static org.jboss.test.selenium.dom.Event.MOUSEUP;
+import static org.jboss.test.selenium.locator.Attribute.SRC;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import javax.faces.event.PhaseId;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.geometry.Point;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.jboss.test.selenium.locator.ElementLocator;
+import org.jboss.test.selenium.waiting.EventFiredCondition;
+import org.jboss.test.selenium.waiting.retrievers.AttributeRetriever;
+import org.richfaces.component.SwitchType;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.richTree.TreeAttributes;
+import org.richfaces.tests.metamer.ftest.richTree.TreeModel;
+import org.richfaces.tests.metamer.ftest.richTree.TreeNodeModel;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestTreeNodeSimple extends AbstractMetamerTest {
+
+ private static final String SAMPLE_CLASS = "sample-class";
+ private static final String JQ_SAMPLE_CLASS = "[sample-class]";
+ private static final String IMAGE_URL = "/resources/images/loading.gif";
+
+ TreeAttributes attributesTree = new TreeAttributes(jq("span[id$=attributes:panel]"));
+ TreeNodeAttributes attributes = new TreeNodeAttributes(jq("span[id$=treeNode1Attributes:panel]"));
+ TreeNodeAttributes attributesLeaf = new TreeNodeAttributes(jq("span[id$=treeNode3Attributes:panel]"));
+
+ TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
+ TreeNodeModel treeNode = tree.getNode(1);
+ TreeNodeModel subTreeNode = treeNode.getNode(1);
+ TreeNodeModel leaf = subTreeNode.getNode(1);
+
+ @Inject
+ @Use(empty = true)
+ Event event = CLICK;
+ Event[] events = new Event[] { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE, MOUSEOUT,
+ MOUSEOVER, MOUSEUP };
+
+ @Inject
+ @Use(empty = true)
+ SwitchType toggleType;
+ SwitchType[] toggleTypes = new SwitchType[] { SwitchType.ajax, SwitchType.server };
+
+ @BeforeMethod
+ public void init() {
+ attributesRoot.setLocator(jq("span[id$=treeNode1Attributes:panel]"));
+ tree.setToggleType(SwitchType.ajax);
+ }
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "http://localhost:8080/metamer/faces/components/richTree/simple.xhtml");
+ }
+
+ @Test
+ public void testDir() {
+ super.testDir(treeNode.getTreeNode());
+ }
+
+ @Test
+ public void testHandleClass() {
+ assertEquals(selenium.getCount(not(tree.getAnyNode().getHandle(), JQ_SAMPLE_CLASS)), 4);
+
+ attributes.setHandleClass(SAMPLE_CLASS);
+
+ assertEquals(selenium.getCount(append(tree.getAnyNode().getHandle(), JQ_SAMPLE_CLASS)), 0);
+ assertEquals(selenium.getCount(not(tree.getAnyNode().getHandle(), JQ_SAMPLE_CLASS)), 4);
+ }
+
+ @Test
+ public void testIconClass() {
+ assertEquals(selenium.getCount(not(tree.getAnyNode().getIcon(), JQ_SAMPLE_CLASS)), 4);
+
+ attributes.setIconClass(SAMPLE_CLASS);
+
+ assertEquals(selenium.getCount(append(tree.getAnyNode().getIcon(), JQ_SAMPLE_CLASS)), 0);
+ assertEquals(selenium.getCount(not(tree.getAnyNode().getIcon(), JQ_SAMPLE_CLASS)), 4);
+ }
+
+ ElementLocator<?> iconImage = treeNode.getIcon();
+ AttributeLocator<?> imageSrc = iconImage.getAttribute(SRC);
+ AttributeRetriever retrieveImageSrc = retrieveAttribute.attributeLocator(imageSrc);
+
+ @Test
+ public void testIconCollapsed() {
+ assertTrue(selenium.isElementPresent(iconImage));
+ assertFalse(selenium.isAttributePresent(imageSrc));
+
+ attributes.setIconCollapsed(IMAGE_URL);
+
+ assertTrue(selenium.isElementPresent(iconImage));
+ assertTrue(selenium.isAttributePresent(imageSrc));
+
+ String url = retrieveImageSrc.retrieve();
+ assertTrue(url.endsWith(IMAGE_URL));
+ }
+
+ @Test
+ public void testIconExpanded() {
+ assertTrue(selenium.isElementPresent(iconImage));
+ assertFalse(selenium.isAttributePresent(imageSrc));
+
+ attributes.setIconExpanded(IMAGE_URL);
+
+ assertTrue(selenium.isElementPresent(iconImage));
+ assertFalse(selenium.isAttributePresent(imageSrc));
+
+ treeNode.expand();
+
+ assertTrue(selenium.isElementPresent(iconImage));
+ assertTrue(selenium.isAttributePresent(imageSrc));
+
+ String url = retrieveImageSrc.retrieve();
+ assertTrue(url.endsWith(IMAGE_URL));
+ }
+
+ @Test
+ public void testIconLeaf() {
+ treeNode.expand();
+ subTreeNode.expand();
+
+ ElementLocator<?> leafIcon = leaf.getIcon();
+ AttributeLocator<?> leafIconImageSrc = leaf.getIcon().getAttribute(SRC);
+
+ assertTrue(selenium.isElementPresent(leafIcon));
+ assertFalse(selenium.isAttributePresent(leafIconImageSrc));
+
+ attributesLeaf.setIconLeaf(IMAGE_URL);
+
+ assertTrue(selenium.isElementPresent(leafIcon));
+ assertTrue(selenium.isAttributePresent(leafIconImageSrc));
+
+ String url = selenium.getAttribute(leafIconImageSrc);
+ assertTrue(url.endsWith(IMAGE_URL));
+ }
+
+ @Test
+ @Use(field = "toggleType", value = "toggleTypes")
+ public void testImmediate() {
+ tree.setToggleType(toggleType);
+ attributesTree.setToggleType(toggleType);
+
+ treeNode.expand();
+
+ phaseInfo.assertPhases(PhaseId.ANY_PHASE);
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "tree toggle listener invoked");
+
+ attributes.setImmediate(true);
+
+ treeNode.expand();
+
+ phaseInfo.assertPhases(PhaseId.ANY_PHASE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "tree toggle listener invoked");
+ }
+
+ @Test
+ public void testLabelClass() {
+ assertEquals(selenium.getCount(not(tree.getAnyNode().getLabel(), JQ_SAMPLE_CLASS)), 4);
+
+ attributes.setLabelClass(SAMPLE_CLASS);
+
+ assertEquals(selenium.getCount(append(tree.getAnyNode().getLabel(), JQ_SAMPLE_CLASS)), 0);
+ assertEquals(selenium.getCount(not(tree.getAnyNode().getLabel(), JQ_SAMPLE_CLASS)), 4);
+ }
+
+ @Test
+ public void testLang() {
+ assertEquals(selenium.getCount(not(tree.getAnyNode(), "[lang=cs]")), 4);
+
+ attributes.setLang("cs");
+
+ assertEquals(selenium.getCount(append(tree.getAnyNode(), "[lang=cs]")), 0);
+ assertEquals(selenium.getCount(not(tree.getAnyNode(), "[lang=cs]")), 4);
+ }
+
+ @Test
+ @Use(field = "event", value = "events")
+ public void testClientEvents() {
+ String attributeName = event.getEventName();
+ ElementLocator<?> eventInput = pjq("span[id$=treeNode1Attributes:panel] input[id$=on" + attributeName
+ + "Input]");
+ String value = "metamerEvents += \"" + event.getEventName() + " \"";
+
+ selenium.type(eventInput, value);
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ fireEventAt(treeNode.getLabel(), event);
+
+ waitGui.failWith("Attribute on" + attributeName + " does not work correctly").until(
+ new EventFiredCondition(event));
+ }
+
+ @Test
+ public void testOnbeforetoggle() {
+ super.testRequestEventsBefore("beforetoggle", "toggle");
+ treeNode.expand();
+ super.testRequestEventsAfter("beforetoggle", "toggle");
+ }
+
+ @Test
+ public void testRendered() {
+ treeNode.expand();
+ subTreeNode.expand();
+
+ assertTrue(selenium.isElementPresent(leaf));
+
+ attributesLeaf.setRendered(false);
+
+ assertFalse(selenium.isElementPresent(leaf));
+ assertTrue(selenium.isElementPresent(subTreeNode));
+ }
+
+ @Test
+ public void testStyle() {
+ super.testStyle(treeNode.getTreeNode(), "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ super.testStyleClass(treeNode.getTreeNode(), "styleClass");
+ }
+
+ @Test
+ public void testTitle() {
+ super.testTitle(treeNode.getTreeNode());
+ }
+
+ private void fireEventAt(ElementLocator<?> element, Event event) {
+ Point coords = new Point(0, 0);
+ if (event == CLICK) {
+ selenium.clickAt(element, coords);
+ } else if (event == DBLCLICK) {
+ selenium.doubleClickAt(element, coords);
+ } else if (event == MOUSEDOWN) {
+ selenium.mouseDownAt(element, coords);
+ } else if (event == MOUSEMOVE) {
+ selenium.mouseMoveAt(element, coords);
+ } else if (event == MOUSEOUT) {
+ selenium.mouseOutAt(element, coords);
+ } else if (event == MOUSEOVER) {
+ selenium.mouseOverAt(element, coords);
+ } else if (event == MOUSEUP) {
+ selenium.mouseUpAt(element, coords);
+ } else {
+ selenium.fireEvent(element, event);
+ }
+ }
+}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TreeNodeAttributes.java (from rev 21393, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TreeNodeAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeNode/TreeNodeAttributes.java 2011-02-02 16:01:36 UTC (rev 21394)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richTreeNode;
+
+import org.jboss.test.selenium.locator.ExtendedLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeNodeAttributes extends AbstractComponentAttributes {
+
+ public TreeNodeAttributes() {
+ }
+
+ public <T extends ExtendedLocator<JQueryLocator>> TreeNodeAttributes(T root) {
+ super(root);
+ }
+
+ public void setDir(String dir) {
+ setProperty("dir", dir);
+ }
+
+ public void setHandleClass(String handleClass) {
+ setProperty("handleClass", handleClass);
+ }
+
+ public void setIconClass(String iconClass) {
+ setProperty("iconClass", iconClass);
+ }
+
+ public void setIconCollapsed(String iconCollapsed) {
+ setProperty("iconCollapsed", iconCollapsed);
+ }
+
+ public void setIconExpanded(String iconExpanded) {
+ setProperty("iconExpanded", iconExpanded);
+ }
+
+ public void setIconLeaf(String iconLeaf) {
+ setProperty("iconLeaf", iconLeaf);
+ }
+
+ public void setImmediate(Boolean immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setLabelClass(String labelClass) {
+ setProperty("labelClass", labelClass);
+ }
+
+ public void setLang(String lang) {
+ setProperty("lang", lang);
+ }
+
+ public void setOnbeforetoggle(String onbeforetoggle) {
+ setProperty("onbeforetoggle", onbeforetoggle);
+ }
+
+ public void setOntoggle(String ontoggle) {
+ setProperty("ontoggle", ontoggle);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setStyle(String style) {
+ setProperty("style", style);
+ }
+
+ public void setStyleClass(String styleClass) {
+ setProperty("styleClass", styleClass);
+ }
+
+ public void setTitle(String title) {
+ setProperty("title", title);
+ }
+}
13 years, 11 months