JBoss Rich Faces SVN: r19595 - sandbox/trunk/ui/fileupload.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-10-18 12:03:06 -0400 (Mon, 18 Oct 2010)
New Revision: 19595
Added:
sandbox/trunk/ui/fileupload/pom.xml
Log:
RF-9495
Added: sandbox/trunk/ui/fileupload/pom.xml
===================================================================
--- sandbox/trunk/ui/fileupload/pom.xml (rev 0)
+++ sandbox/trunk/ui/fileupload/pom.xml 2010-10-18 16:03:06 UTC (rev 19595)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.fileupload</groupId>
+ <artifactId>richfaces-ui-fileupload-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: FileUpload Aggregator</name>
+
+ <modules>
+ <module>ui</module>
+ </modules>
+</project>
13 years, 8 months
JBoss Rich Faces SVN: r19593 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-10-18 11:22:42 -0400 (Mon, 18 Oct 2010)
New Revision: 19593
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/jquery.position.js
Log:
https://jira.jboss.org/browse/RF-9152
https://jira.jboss.org/browse/RF-9168
Modified: trunk/core/impl/src/main/resources/META-INF/resources/jquery.position.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/jquery.position.js 2010-10-18 10:30:07 UTC (rev 19592)
+++ trunk/core/impl/src/main/resources/META-INF/resources/jquery.position.js 2010-10-18 15:22:42 UTC (rev 19593)
@@ -67,7 +67,7 @@
var stype = typeof source;
if (stype == "object" || stype == "string") {
var rect = {};
- if (stype == "string" || source.nodeType || source instanceof jQuery) {
+ if (stype == "string" || source.nodeType || source instanceof jQuery || typeof source.length!="undefined") {
rect = getElementRect(source);
} else if (source.type) {
rect = getPointerRect(source);
@@ -135,7 +135,34 @@
function getElementRect (element) {
var jqe = $(element);
var offset = jqe.offset();
- return {width: jqe.width(), height: jqe.height(), left: Math.floor(offset.left), top: Math.floor(offset.top)};
+ var rect = {width: jqe.outerWidth(), height: jqe.outerHeight(), left: Math.floor(offset.left), top: Math.floor(offset.top)};
+ if (jqe.length>1) {
+ var width, height, offset;
+ var e;
+ for (var i=1;i<jqe.length;i++) {
+ e = jqe.eq(i);
+ if (e.css('display')=="none") continue;
+ width = e.outerWidth();
+ height = e.outerHeight();
+ offset = e.offset();
+ var d = rect.left - offset.left;
+ if (d<0) {
+ rect.width = (width > rect.width) ? width : rect.width - d;
+ } else {
+ if (d + width > rect.width) rect.width = d + width;
+ }
+ var d = rect.top - offset.top;
+ if (d<0) {
+ rect.height = (height > rect.height) ? height : rect.height - d;
+ } else {
+ if (d + height > rect.height) rect.height = d + height;
+ }
+ if (offset.left < rect.left) rect.left = offset.left;
+ if (offset.top < rect.top) rect.top = offset.top;
+ }
+ }
+
+ return rect;
/*
var jqe = $(element);
var offset = jqe.offset();
13 years, 8 months
JBoss Rich Faces SVN: r19592 - in trunk/examples/output-demo/src/main: webapp/WEB-INF and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-10-18 06:30:07 -0400 (Mon, 18 Oct 2010)
New Revision: 19592
Added:
trunk/examples/output-demo/src/main/java/org/richfaces/ModalPanel.java
trunk/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java
trunk/examples/output-demo/src/main/webapp/examples/panel.xhtml
trunk/examples/output-demo/src/main/webapp/examples/popupPanel.xhtml
trunk/examples/output-demo/src/main/webapp/examples/progressbar.xhtml
Modified:
trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
Log:
RF-8927, RF-8929
Added: trunk/examples/output-demo/src/main/java/org/richfaces/ModalPanel.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/ModalPanel.java (rev 0)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/ModalPanel.java 2010-10-18 10:30:07 UTC (rev 19592)
@@ -0,0 +1,196 @@
+package org.richfaces;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+@ManagedBean
+@RequestScoped
+public class ModalPanel {
+ private boolean autosized;
+ private boolean keepVisualState;
+ private String left;
+ private String top;
+ private boolean rendered;
+ private String shadowDepth;
+ private String shadowOpacity;
+ private boolean show;
+ private int zindex;
+ private int minHeight;
+ private int minWidth;
+ private int maxHeight;
+ private int maxWidth;
+ private int height;
+ private int width;
+ private boolean moveable;
+ private boolean resizeable;
+ private String inputTextTest;
+ private String domElementAttachment;
+
+
+ public String getInputTextTest() {
+ return inputTextTest;
+ }
+
+ public void setInputTextTest(String inputTextTest) {
+ this.inputTextTest = inputTextTest;
+ }
+
+ public ModalPanel() {
+ this.inputTextTest = "text";
+ this.minHeight = 100;
+ this.minWidth = 100;
+ this.height = 300;
+ this.width = 300;
+ this.maxWidth = -1;
+ this.maxHeight = -1;
+ this.moveable=true;
+ this.resizeable=true;
+ this.autosized = false;
+ this.keepVisualState = false;
+ this.left = "auto";
+ this.top = "auto";
+ this.rendered = true;
+ this.shadowDepth = "3";
+ this.shadowOpacity = "3";
+ this.show = false;
+ this.domElementAttachment = "body";
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public int getMinHeight() {
+ return minHeight;
+ }
+
+ public void setMinHeight(int minHeight) {
+ this.minHeight = minHeight;
+ }
+
+ public int getMaxWidth() {
+ return maxWidth;
+ }
+
+ public void setMaxWidth(int maxWidth) {
+ this.maxWidth = minWidth;
+ }
+
+ public int getMaxHeight() {
+ return maxHeight;
+ }
+
+ public void setMaxHeight(int maxHeight) {
+ this.maxHeight = maxHeight;
+ }
+
+ public int getMinWidth() {
+ return minWidth;
+ }
+
+ public void setMinWidth(int minWidth) {
+ this.minWidth = minWidth;
+ }
+
+ public boolean isMoveable() {
+ return moveable;
+ }
+
+ public void setMoveable(boolean moveable) {
+ this.moveable = moveable;
+ }
+
+ public boolean isResizeable() {
+ return resizeable;
+ }
+
+ public void setResizeable(boolean resizeable) {
+ this.resizeable = resizeable;
+ }
+
+ public void setAutosized(boolean autosized) {
+ this.autosized = autosized;
+ }
+
+
+ public int getWidth() {
+ return width;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public boolean isAutosized() {
+ return autosized;
+ }
+
+ public boolean isKeepVisualState() {
+ return keepVisualState;
+ }
+
+ public void setKeepVisualState(boolean keepVisualState) {
+ this.keepVisualState = keepVisualState;
+ }
+
+ public String getLeft() {
+ return left;
+ }
+
+ public void setLeft(String left) {
+ this.left = left;
+ }
+
+ public String getTop() {
+ return top;
+ }
+
+ public void setTop(String top) {
+ this.top = top;
+ }
+
+ public boolean getRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public String getShadowDepth() {
+ return shadowDepth;
+ }
+
+ public void setShadowDepth(String shadowDepth) {
+ this.shadowDepth = shadowDepth;
+ }
+
+ public String getShadowOpacity() {
+ return shadowOpacity;
+ }
+
+ public void setShadowOpacity(String shadowOpacity) {
+ this.shadowOpacity = shadowOpacity;
+ }
+
+ public boolean isShow() {
+ return show;
+ }
+
+ public void setShow(boolean show) {
+ this.show = show;
+ }
+
+ public String getDomElementAttachment() {
+ return domElementAttachment;
+ }
+
+ public void setDomElementAttachment(String domElementAttachment) {
+ this.domElementAttachment = domElementAttachment;
+ }
+}
\ No newline at end of file
Added: trunk/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java (rev 0)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/ProgressBarBean.java 2010-10-18 10:30:07 UTC (rev 19592)
@@ -0,0 +1,71 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import java.util.Date;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+@ManagedBean
+@ViewScoped
+public class ProgressBarBean {
+
+ private boolean buttonRendered = true;
+ private boolean enabled=false;
+ private Long startTime;
+
+ public String startProcess() {
+ setEnabled(true);
+ setButtonRendered(false);
+ setStartTime(new Date().getTime());
+ return null;
+ }
+
+ public Long getCurrentValue(){
+ if (isEnabled()) {
+ Long current = (new Date().getTime() - startTime)/1000;
+ if (current>100){
+ setButtonRendered(true);
+ } else if (current.equals(0)) {
+ return new Long(1);
+ }
+ return (new Date().getTime() - startTime)/1000;
+ }
+ if (startTime == null) {
+ return Long.valueOf(-1);
+ } else {
+ return Long.valueOf(101);
+ }
+
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public Long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Long startTime) {
+ this.startTime = startTime;
+ }
+
+ public boolean isButtonRendered() {
+ return buttonRendered;
+ }
+
+ public void setButtonRendered(boolean buttonRendered) {
+ this.buttonRendered = buttonRendered;
+ }
+}
\ No newline at end of file
Modified: trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-18 06:53:34 UTC (rev 19591)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-10-18 10:30:07 UTC (rev 19592)
@@ -42,6 +42,18 @@
<from-outcome>tabPanel</from-outcome>
<to-view-id>/examples/tabPanel.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>panel</from-outcome>
+ <to-view-id>/examples/panel.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>popup</from-outcome>
+ <to-view-id>/examples/popupPanel.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>progressbar</from-outcome>
+ <to-view-id>/examples/progressbar.xhtml</to-view-id>
+ </navigation-case>
<!-- QUnit -->
<navigation-case>
Added: trunk/examples/output-demo/src/main/webapp/examples/panel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/panel.xhtml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/panel.xhtml 2010-10-18 10:30:07 UTC (rev 19592)
@@ -0,0 +1,44 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:pn="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+<ui:define name="body">
+ <pn:panel>
+ <f:facet name="header">
+ Test
+ </f:facet>
+ <pn:panel>
+ <f:facet name="header">
+ Test
+ </f:facet>
+ <pn:panel>
+ <f:facet name="header">
+ Test
+ </f:facet>
+ Body text
+ </pn:panel>
+ </pn:panel>
+ </pn:panel>
+ <br/>
+ <pn:panel>
+ <f:facet name="header">
+ Test<br/>
+ Test<br/>
+ Test<br/>
+ Test<br/>
+ Test<br/>
+ </f:facet>
+ <h:form>
+ <h:outputText value="inside the form"/>
+ </h:form>
+ </pn:panel>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
\ No newline at end of file
Added: trunk/examples/output-demo/src/main/webapp/examples/popupPanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/popupPanel.xhtml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/popupPanel.xhtml 2010-10-18 10:30:07 UTC (rev 19592)
@@ -0,0 +1,75 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/output" template="/templates/template.xhtml">
+
+ <ui:define name="body">
+
+<h:form id="form">
+<h:outputLink value="#"
+ onclick="RichFaces.$('form:popup').show(); return false;">
+ Open popup
+ </h:outputLink>
+<rich:popupPanel id="popup" left="#{modalPanel.left}"
+ top="#{modalPanel.top}" height="#{modalPanel.height}"
+ width="#{modalPanel.width}"
+ minHeight="#{modalPanel.minHeight}"
+ minWidth="#{modalPanel.minWidth}"
+ maxHeight="#{modalPanel.maxHeight}"
+ maxWidth="#{modalPanel.maxWidth}"
+ moveable="#{modalPanel.moveable}"
+ resizeable="#{modalPanel.resizeable}"
+ keepVisualState="#{modalPanel.keepVisualState}"
+ rendered="#{modalPanel.rendered}"
+ autosized="#{modalPanel.autosized}"
+ shadowDepth="#{modalPanel.shadowDepth}"
+ shadowOpacity="#{modalPanel.shadowOpacity}"
+ show="#{modalPanel.show}"
+ domElementAttachment="#{modalPanel.domElementAttachment}"
+ >
+ <f:facet name="header">
+ <h:outputText value="HEADER for popup" />
+ </f:facet>
+ <f:facet name="controls">
+ <h:outputLink value="#"
+ onclick="RichFaces.$('form:popup').hide(); return false;">
+ X
+ </h:outputLink>
+ </f:facet>
+ <p>Any content might be inside the panel.</p>
+ <p>Consider inclusion of the form elements into the popup or
+ redefinition of <b>domElementAttachment</b> attribute.</p>
+ <p>The popup panel is open and closed from the javascript function
+ of component client side object. The following code <a href="#"
+ onclick="RichFaces.$('form:popup').hide()">hide this panel</a>: <f:verbatim>#</f:verbatim>RichFaces.$('form:popup').hide()</p>
+
+ <h:inputText value="#{modalPanel.inputTextTest}" />
+
+ </rich:popupPanel>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Left: "/><h:inputText value="#{modalPanel.left}"/>
+ <h:outputText value="Top: "/><h:inputText value="#{modalPanel.top}"/>
+ <h:outputText value="Height: "/><h:inputText value="#{modalPanel.height}"/>
+ <h:outputText value="Width: "/><h:inputText value="#{modalPanel.width}"/>
+ <h:outputText value="MinHeight: "/><h:inputText value="#{modalPanel.minHeight}"/>
+ <h:outputText value="MinWidth: "/><h:inputText value="#{modalPanel.minWidth}"/>
+ <h:outputText value="MaxHeight: "/><h:inputText value="#{modalPanel.maxHeight}"/>
+ <h:outputText value="MaxWidth: "/><h:inputText value="#{modalPanel.maxWidth}"/>
+ <h:outputText value="Shadow depth: "/><h:inputText value="#{modalPanel.shadowDepth}"/>
+ <h:outputText value="Shadow opacity: "/><h:inputText value="#{modalPanel.shadowOpacity}"/>
+ <h:outputText value="Rendered: "/><h:selectBooleanCheckbox value="#{modalPanel.rendered}"/>
+ <h:outputText value="Moveable: "/><h:selectBooleanCheckbox value="#{modalPanel.moveable}"/>
+ <h:outputText value="Resizeable: "/><h:selectBooleanCheckbox value="#{modalPanel.resizeable}"/>
+ <h:outputText value="Autosized: "/><h:selectBooleanCheckbox value="#{modalPanel.autosized}"/>
+ <h:outputText value="Show: "/><h:selectBooleanCheckbox value="#{modalPanel.show}"/>
+ <h:outputText value="keepVisualState: "/><h:selectBooleanCheckbox value="#{modalPanel.keepVisualState}"/>
+ </h:panelGrid>
+ <h:commandButton value="Apply changes"/>
+</h:form>
+</ui:define>
+</ui:composition>
+
+
Added: trunk/examples/output-demo/src/main/webapp/examples/progressbar.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/progressbar.xhtml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/progressbar.xhtml 2010-10-18 10:30:07 UTC (rev 19592)
@@ -0,0 +1,79 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/output" template="/templates/template.xhtml">
+
+ <ui:define name="body">
+ <script>
+//<![CDATA[
+ var counter = 1;
+ var intervalID;
+ function updateProgress(i) {
+ RichFaces.$('form2:progressBar').setValue(counter*5);
+ if ((counter++)>20){
+ clearInterval(intervalID);
+ document.getElementById('button').disabled=false;
+ }
+ }
+
+ function startProgress(){
+ counter=1;
+ document.getElementById('button').disabled=true;
+ RichFaces.$('form2:progressBar').enable();
+ RichFaces.$('form2:progressBar').setValue(1);
+ intervalID = setInterval(updateProgress,5000);
+ }
+//]]>
+ </script>
+ <h:form id="form">
+ Ajax mode:
+ <rich:progressBar mode="ajax" value="#{progressBarBean.currentValue}"
+ interval="2000"
+ enabled="#{progressBarBean.enabled}" minValue="-1" maxValue="100"
+ reRenderAfterComplete="progressPanel">
+ <f:facet name="initial">
+ <br />
+ <h:outputText value="Process doesn't started yet" />
+ <a4j:commandButton action="#{progressBarBean.startProcess}"
+ value="Start Process"
+ render="form"
+ style="margin: 9px 0px 5px;" />
+ </f:facet>
+ <f:facet name="complete">
+ <br />
+ <h:outputText value="Process Done" />
+ <a4j:commandButton action="#{progressBarBean.startProcess}"
+ value="Restart Process" execute="@form"
+ rendered="#{progressBarBean.buttonRendered}"
+ style="margin: 9px 0px 5px;" />
+ </f:facet>
+ <h:outputText value="#{progressBarBean.currentValue} %"/>
+ </rich:progressBar>
+ <h:panelGroup id="progressPanel">
+ <h:outputText value="#{progressBarBean.currentValue}"/>
+ </h:panelGroup>
+ </h:form>
+
+
+
+ Client mode:
+
+
+ <h:form id="form2">
+ <rich:progressBar mode="client" id="progressBar">
+ <f:facet name="initial">
+ <h:outputText value="Process doesn't started yet"/>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process Done"/>
+ </f:facet>
+ </rich:progressBar>
+ <button type="button" onclick="startProgress();" style="margin: 9px 0px 5px;" id="button">Start Progress</button>
+ </h:form>
+ </ui:define>
+</ui:composition>
+
+
+
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-10-18 06:53:34 UTC (rev 19591)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-10-18 10:30:07 UTC (rev 19592)
@@ -16,19 +16,6 @@
<ui:insert name="scripts" ></ui:insert>
-
- <h:form>
- <h:commandButton value="Classic">
- <f:setPropertyActionListener target="#{skinBean.skin}" value="classic"/>
- </h:commandButton>
- <h:commandButton value="BlueSky">
- <f:setPropertyActionListener target="#{skinBean.skin}" value="blueSky"/>
- </h:commandButton>
- <h:commandButton value="DeepMarine">
- <f:setPropertyActionListener target="#{skinBean.skin}" value="deepMarine"/>
- </h:commandButton>
- </h:form>
-
<table width="100%">
<thead>
<tr>
@@ -60,6 +47,24 @@
<li><h:commandLink value="accordion" action="accordion" /></li>
</ul>
</li>
+ <li>
+ <p>Panel</p>
+ <ul>
+ <li><h:commandLink value="panel" action="panel" /></li>
+ </ul>
+ </li>
+ <li>
+ <p>Popup panel</p>
+ <ul>
+ <li><h:commandLink value="popup" action="popup" /></li>
+ </ul>
+ </li>
+ <li>
+ <p>ProgressBar</p>
+ <ul>
+ <li><h:commandLink value="progressbar" action="progressbar" /></li>
+ </ul>
+ </li>
<li>
<p>Collapsible Panel</p>
<ul>
13 years, 8 months
JBoss Rich Faces SVN: r19591 - in modules/docs/branches/m4: Migration_Guide/src/main/docbook/en-US and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-10-18 02:53:34 -0400 (Mon, 18 Oct 2010)
New Revision: 19591
Modified:
modules/docs/branches/m4/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml
modules/docs/branches/m4/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml
Log:
Started rich:selectOne and rich:calendar
Modified: modules/docs/branches/m4/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml
===================================================================
--- modules/docs/branches/m4/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml 2010-10-18 01:36:56 UTC (rev 19590)
+++ modules/docs/branches/m4/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml 2010-10-18 06:53:34 UTC (rev 19591)
@@ -11,89 +11,143 @@
</para>
</important>
<para>
- This chapter details those components which act as panels and containers to hold groups of other components.
+ This chapter details rich components for user input and interaction.
</para>
- <!-- TODO not in M3 -->
- <!--
- <para>
- This chapter details rich components for user input and interaction.
- </para>
+ <!-- <rich:calendar> -->
+ <!-- TODO in M4
<section id="sect-Component_Reference-Rich_inputs-richcalendar">
<title><sgmltag><rich:calendar></sgmltag></title>
<para>
The <sgmltag><rich:calendar></sgmltag> component allows the user to enter a date and time through an in-line or pop-up calendar. The pop-up calendar can navigate through months and years, and its look and feel can be highly customized.
</para>
- <para>
- The <sgmltag><rich:calendar></sgmltag> component supports two different ways of loading data through defining the <varname>mode</varname> attribute. When not specified, the component uses <literal>client</literal> mode, which loads an initial portion of data within a set date range. The range can be defined by using the <varname>preloadDateRangeBegin</varname> and <varname>preloadDateRangeEnd</varname> attributes. Additional data requests are not sent. Alternatively, with <code>mode="ajax"</code> the <sgmltag><rich:calendar></sgmltag> requests portions of data for rendering from a special data model. The data model can be defined through the <varname>dataModel</varname> attribute, which points to an object that implements the <classname>CalendarDataModel</classname> interface. If the <varname>dataModel</varname> attribute is not defined or has a value of <literal>null</literal>, the <literal>ajax</literal> mode functions the same as the <literal>client</liter!
al> mode.
- </para>
- <para>
- The <sgmltag><rich:calendar></sgmltag> component is presented as a pop-up by default, appearing as a text field with a button to expand the full pop-up calendar. Specifying <code>popup="false</code> will render the calendar in-line on the page instead, which displays the full calendar without the text field or display button. The appearance of the display button can be altered from the standard calendar icon by defining the <varname>buttonIcon</varname> and <varname>buttonIconDisabled</varname> attributes to replace the icon with a specified file, or by defining the <varname>buttonLabel</varname> attribute to display text on the button without an icon. If <varname>buttonLabel</varname> is specified then both <varname>buttonIcon</varname> and <varname>buttonIconDisabled</varname> attributes are ignored. The text field box can also be hidden by setting <code>showInput="false"</code>.
- </para>
- <para>
- The position at which the pop-up calendar displays relative to the text field and button can be configured using the <varname>jointPoint</varname> and <varname>direction</varname> attributes. The <varname>jointPoint</varname> attribute refers to the corner of the text field and button with which the calendar will be aligned and the <varname>direction</varname> specifies which direction the pop-up calendar will span relative to the joint point. The default settings are <code>jointPoint="bottom-left"</code> and <code>direction="bottom-right"</code>, causing the pop-up calendar to align with the bottom-left corner of the text field and span to the bottom-right, underneath the text field and button. The diagram shows the joint points and directions that can be used. Alternatively, both <varname>jointPoint</varname> and <varname>direction</varname> can be set to <literal>auto</literal> to allow smart pop-up positioning.
- </para>
- <para>
- The calendar features a <guibutton>Today</guibutton> button for locating today's date on the calendar. This can be set to three different values using the <varname>todayControlMode</varname> attribute:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>hidden</literal>, which does not display the button;
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>select</literal>, the default setting, which scrolls the calendar to the current month and selects today's date; and
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>scroll</literal>, which scrolls the calendar to the current month but does not select today's date.
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The <sgmltag><rich:calendar></sgmltag> component can additionally allow a time of day to be specified with the date. After selecting a date the option to set a time becomes available. The default time can be set with the <varname>defaultTime</varname> attribute. If the time is altered and a new date is selected, it will not reset unless <code>resetTimeOnDateSelect="true"</code> is specified.
- </para>
- <para>
- There are several event handlers that are unique to the <sgmltag><rich:calendar></sgmltag> component.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <varname>ondateselect</varname> is triggered when the date is selected by the user, before the update request is sent.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>ondateselected</varname> is triggered after the date is selected by the user.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>oncurrentdateselect</varname> is triggered when any of the year- or month-changing buttons are pressed, before the update request is sent.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>oncurrentdateselected</varname> is triggered after any of the year- or month-changing buttons are pressed.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>ontimeselect</varname> is triggered when the time is set by the user, before the update request is sent.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>ontimeselected</varname> is triggered after the time has been set by the user.
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The entire calendar can be set as read-only with <code>readonly="true"</code>. This allows months and years to be browsed through with the arrow controls, but dates and times cannot be selected.
- </para>
+
+ <section id="sect-Component_Reference-richcalendar-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <sgmltag><rich:calendar></sgmltag> component supports two different ways of loading data through defining the <varname>mode</varname> attribute. When not specified, the component uses <literal>client</literal> mode, which loads an initial portion of data within a set date range. The range can be defined by using the <varname>preloadDateRangeBegin</varname> and <varname>preloadDateRangeEnd</varname> attributes. Additional data requests are not sent.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richcalendar-Using_a_data_model">
+ <title>Using a data model</title>
+ <para>
+ Alternatively, with <code>mode="ajax"</code> the <sgmltag><rich:calendar></sgmltag> requests portions of data for rendering from a special data model. The data model can be defined through the <varname>dataModel</varname> attribute, which points to an object that implements the <classname>CalendarDataModel</classname> interface. If the <varname>dataModel</varname> attribute is not defined or has a value of <literal>null</literal>, the <literal>ajax</literal> mode functions the same as the <literal>client</literal> mode.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richcalendar-Behavior_and_appearance">
+ <title>Behavior and appearance</title>
+ <para>
+ The <sgmltag><rich:calendar></sgmltag> component is presented as a pop-up by default, appearing as a text field with a button to expand the full pop-up calendar. To render the calendar in-line on the page instead, set <code>popup="false</code>. This displays the full calendar without the text field or display button.
+ </para>
+ <para>
+ To change the appearance of the display button from the standard calendar icon, use the <varname>buttonIcon</varname> and <varname>buttonIconDisabled</varname> attributes to replace the icon with a specified file. Alternatively, use the <varname>buttonLabel</varname> attribute to display text on the button without an icon. If <varname>buttonLabel</varname> is specified then both the <varname>buttonIcon</varname> and <varname>buttonIconDisabled</varname> attributes are ignored. To hide the text field box, set <code>showInput="false"</code>.
+ </para>
+ <para>
+ To change the default position at which the pop-up calendar is shown relative to the text field and button, use the <varname>jointPoint</varname> and <varname>direction</varname> attributes. The <varname>jointPoint</varname> attribute refers to the corner of the text field and button with which the calendar will be aligned and the <varname>direction</varname> specifies which direction the pop-up calendar will span relative to the joint point. The default settings are <code>jointPoint="bottom-left"</code> and <code>direction="bottom-right"</code>, causing the pop-up calendar to align with the bottom-left corner of the text field and span to the bottom-right, underneath the text field and button. The diagram shows the joint points and directions that can be used. Alternatively, set both <varname>jointPoint</varname> and <varname>direction</varname> attributes to <literal>auto</literal> to allow smart pop-up positioning.
+ </para>
+ <para>
+ The calendar features a <guibutton>Today</guibutton> button for locating today's date on the calendar. This can be set to three different values using the <varname>todayControlMode</varname> attribute:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>hidden</literal>, which does not display the button;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>select</literal>, the default setting, which scrolls the calendar to the current month and selects today's date; and
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>scroll</literal>, which scrolls the calendar to the current month but does not select today's date.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ To make the entire calendar read-only, set <code>readonly="true"</code>. This allows months and years to be browsed through with the arrow controls, but dates and times cannot be selected.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richcalendar-Time_of_day">
+ <title>Time of day</title>
+ <para>
+ The <sgmltag><rich:calendar></sgmltag> component can additionally allow a time of day to be specified with the date. After selecting a date the option to set a time becomes available. The default time can be set with the <varname>defaultTime</varname> attribute. If the time is altered and a new date is selected, it will not reset unless <code>resetTimeOnDateSelect="true"</code> is specified.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richcalendar-richcalendar_events">
+ <title><sgmltag><rich:calendar></sgmltag> events</title>
+ <para>
+ There are several event handlers that are unique to the <sgmltag><rich:calendar></sgmltag> component.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <varname>ondateselect</varname> is triggered when the date is selected by the user, before the update request is sent.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>ondateselected</varname> is triggered after the date is selected by the user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>oncurrentdateselect</varname> is triggered when any of the year- or month-changing buttons are pressed, before the update request is sent.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>oncurrentdateselected</varname> is triggered after any of the year- or month-changing buttons are pressed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>ontimeselect</varname> is triggered when the time is set by the user, before the update request is sent.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>ontimeselected</varname> is triggered after the time has been set by the user.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Component_Reference-richcalendar-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.calendar</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlCalendar</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.calendar</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.renderkit.calendarRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.calendarTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
-->
@@ -725,32 +779,55 @@
</itemizedlist>
</section>
</section>
-
- <!-- TODO not in M3 -->
- <!--<rich:suggestionBox>-->
- <!--
- <section id="sect-Component_Reference-Rich_inputs-richsuggestionBox">
- <title><sgmltag><rich:suggestionBox></sgmltag></title>
+
+ <!-- <rich:selectOne> -->
+ <section id="sect-Component_Reference-Rich_inputs-richselectOne">
+ <title><sgmltag><rich:selectOne></sgmltag></title>
<para>
- The <sgmltag><rich:suggestionBox></sgmltag> component adds a feature-rich drop-down list of suggestions to any text input component.
+ The <sgmltag><rich:selectOne></sgmltag> component provides a drop-down list box for selecting a single value from multiple options. The component supports keyboard navigation and can optionally accept typed input as a combo-box.
</para>
- <para>
- The <sgmltag><rich:suggestionBox></sgmltag> component needs the attributes defined for basic use: <varname>for</varname>, which identifies the component to attach the suggestion box to; <varname>suggestionAction</varname>, which defines the method for getting the collection of suggestion data; and <varname>var</varname>, which defines a collection name for access to the currently highlighted row. Typically the suggestions are presented as a list with one or more columns of suggestion data; the layout of these columns is defined inside the <sgmltag><rich:suggestionBox></sgmltag> tags using <sgmltag><h:column></sgmltag> and other <acronym>JSF</acronym> components.
- </para>
- <para>
- For suggestion lists with multiple columns, the <varname>fetchValue</varname> attribute can be used to specify which column is used when selecting the value for the input component.
- </para>
- <para>
- The <varname>tokens</varname> attribute can be used to define separator characters, which are used when multiple values need to be entered and a new suggestion made for each value. For example, <code>tokens=","</code> (a comma) will begin a new suggestion query each time a comma is typed. Multiple separators can be defined with spaces in between (<code>tokens=", . ; [ ]"</code>) or linking to a bean property that holds the collection of separator tokens.
- </para>
- <para>
- The <varname>minChars</varname> attribute can be used to limit sending the Ajax request until a certain amount of characters has been entered. If the query returns no results, an appropriate message to display can be set with the <varname>nothingLabel</varname> attribute.
- </para>
- <para>
- Instead of returning just one value from an object, the entire object can be returned to the client and handled appropriately. This is done by specifying <code>usingSuggestObjects="true"</code> and setting the <varname>onobjectchange</varname> attribute to a JavaScript method to handle the object, passing the <literal>suggestion</literal> object as a parameter.
- </para>
+
+ <section id="sect-Component_Reference-richselectOne-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ Simple usage of the <sgmltag><rich:selectOne></sgmltag> component does not need any attributes declared, but child tags to manage the list of selections are required. An <sgmltag><f:selectItem></sgmltag> tag manages the currently selected value, while an <sgmltag><f:selectItems></sgmltag> tag points to the list of selection items.
+ </para>
+ </section>
+
+ <!--FIXME: finish draft -->
+
+ <section id="sect-Component_Reference-richselectOne-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.selectOne</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlSelectOne</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.selectOne</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.renderkit.selectOneRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.selectOneTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
</section>
- -->
</chapter>
Modified: modules/docs/branches/m4/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml
===================================================================
--- modules/docs/branches/m4/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml 2010-10-18 01:36:56 UTC (rev 19590)
+++ modules/docs/branches/m4/Migration_Guide/src/main/docbook/en-US/Changes_and_new_features.xml 2010-10-18 06:53:34 UTC (rev 19591)
@@ -949,7 +949,7 @@
<section id="sect-Migration_Guide-Consolidated_or_renamed_components-richautocomplete">
<title><sgmltag><rich:autocomplete></sgmltag></title>
<para>
- The <sgmltag><rich:autocomplete></sgmltag> component combines and replaces the old <sgmltag><rich:comboBox></sgmltag> and <sgmltag><rich:suggestionBox></sgmltag> components.
+ The <sgmltag><rich:autocomplete></sgmltag> component replaces the old <sgmltag><rich:suggestionBox></sgmltag> component.
</para>
</section>
@@ -993,6 +993,13 @@
The <sgmltag><rich:popupPanel></sgmltag> component replaces the old <sgmltag><rich:modalPanel></sgmltag> component.
</para>
</section>
+
+ <section id="sect-Migration_Guide-Consolidated_or_renamed_components-richselectOne">
+ <title><sgmltag><rich:selectOne></sgmltag></title>
+ <para>
+ The <sgmltag><rich:selectOne></sgmltag> component replaces the old <sgmltag><rich:comboBox></sgmltag> component.
+ </para>
+ </section>
<section id="sect-Migration_Guide-Consolidated_or_renamed_components-richtogglePanel_and_richtogglePanelItem">
<title><sgmltag><rich:togglePanel></sgmltag> and <sgmltag><rich:togglePanelItem></sgmltag></title>
@@ -1037,10 +1044,10 @@
</para>
</section>
- <section id="sect-Migration_Guide-Deprecated_components_and_behaviors-richcomboBox_and_richsuggestionBox">
- <title><sgmltag><rich:comboBox></sgmltag> and <sgmltag><rich:suggestionBox></sgmltag></title>
+ <section id="sect-Migration_Guide-Deprecated_components_and_behaviors-richcomboBox">
+ <title><sgmltag><rich:comboBox></sgmltag></title>
<para>
- The functionality of the old <sgmltag><rich:comboBox></sgmltag> and <sgmltag><rich:suggestionBox></sgmltag> components is now available through the <sgmltag><rich:autocomplete></sgmltag> component.
+ The functionality of the old <sgmltag><rich:comboBox></sgmltag> component is now available through the <sgmltag><rich:selectOne></sgmltag> component.
</para>
</section>
@@ -1079,6 +1086,13 @@
</para>
</section>
+ <section id="sect-Migration_Guide-Deprecated_components_and_behaviors-richsuggestionBox">
+ <title><sgmltag><rich:suggestionBox></sgmltag></title>
+ <para>
+ The functionality of the old <sgmltag><rich:suggestionBox></sgmltag> component is now available through the <sgmltag><rich:autocomplete></sgmltag> component.
+ </para>
+ </section>
+
</section>
</chapter>
13 years, 8 months
JBoss Rich Faces SVN: r19589 - modules/docs/branches.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-10-17 21:31:13 -0400 (Sun, 17 Oct 2010)
New Revision: 19589
Added:
modules/docs/branches/m4/
Log:
Creating M4 draft branch
Copied: modules/docs/branches/m4 (from rev 19588, modules/docs/trunk)
13 years, 8 months
JBoss Rich Faces SVN: r19587 - in branches/RF-8742/ui/validator/ui/src: test/java/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-10-15 19:58:54 -0400 (Fri, 15 Oct 2010)
New Revision: 19587
Added:
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ComponentValidatorScript.java
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ScriptObject.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/ValidatorRendererTest.java
Modified:
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
Log:
OPEN - issue RF-9507: ClientValidatorRendererunit tests and implementation.
https://jira.jboss.org/browse/RF-9507
Modified: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java 2010-10-15 19:19:49 UTC (rev 19586)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java 2010-10-15 23:58:54 UTC (rev 19587)
@@ -3,10 +3,16 @@
//
// Imports
//
+import javax.faces.FacesException;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
+import org.richfaces.component.UIValidatorScript;
+import org.richfaces.component.behavior.ClientValidatorBehavior;
+import org.richfaces.validator.ScriptNotFoundException;
+import org.richfaces.validator.ValidatorDescriptor;
+
/**
* Renderer for component class org.richfaces.renderkit.html.AjaxValidatorRenderer
*/
@@ -20,6 +26,36 @@
@Override
public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
+ if (behavior instanceof ClientValidatorBehavior) {
+ ClientValidatorBehavior clientValidator = (ClientValidatorBehavior) behavior;
+
+ } else {
+ throw new FacesException(
+ "ClientBehavior for ClientValidatorRenderer does not implement ClientValidatorBehavior interface");
+ }
return null;
}
+
+ String buildValidatorScript(ClientBehaviorContext behaviorContext, ClientValidatorBehavior behavior){
+ return null;
+ }
+
+ UIValidatorScript getOrCreateValidatorScriptComponent(ClientBehaviorContext behaviorContext, ClientValidatorBehavior behavior){
+ return null;
+ }
+
+ ComponentValidatorScript createValidatorScript(ClientBehaviorContext behaviorContext,
+ ClientValidatorBehavior behavior) {
+ return null;
+ }
+
+ ScriptObject getConverterScript(ClientBehaviorContext behaviorContext, ClientValidatorBehavior behavior)
+ throws ScriptNotFoundException {
+ return null;
+ }
+
+ ScriptObject getValidatorScript(ClientBehaviorContext behaviorContext, ValidatorDescriptor validator)
+ throws ScriptNotFoundException {
+ return null;
+ }
}
Added: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ComponentValidatorScript.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ComponentValidatorScript.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ComponentValidatorScript.java 2010-10-15 23:58:54 UTC (rev 19587)
@@ -0,0 +1,5 @@
+package org.richfaces.renderkit.html;
+
+public class ComponentValidatorScript {
+
+}
Property changes on: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ComponentValidatorScript.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ScriptObject.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ScriptObject.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ScriptObject.java 2010-10-15 23:58:54 UTC (rev 19587)
@@ -0,0 +1,73 @@
+/*
+ * $Id$
+ * 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.renderkit.html;
+
+import java.util.Collection;
+
+import org.richfaces.validator.ClientScript;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ScriptObject {
+
+ private ClientScript script;
+
+ private Collection<Object> parameters;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the script
+ */
+ public ClientScript getScript() {
+ return this.script;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param script the script to set
+ */
+ public void setScript(ClientScript script) {
+ this.script = script;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the parameters
+ */
+ public Collection<Object> getParameters() {
+ return this.parameters;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param parameters the parameters to set
+ */
+ public void setParameters(Collection<Object> parameters) {
+ this.parameters = parameters;
+ }
+
+}
Property changes on: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ScriptObject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-10-15 19:19:49 UTC (rev 19586)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-10-15 23:58:54 UTC (rev 19587)
@@ -29,7 +29,7 @@
@Mock
protected ClientBehaviorRenderer behaviorRenderer;
protected MockController controller;
- protected ClientValidatorImpl behavior;
+ protected ClientValidatorBehavior behavior;
@Mock
protected ValueExpression expression;
@Stub
@@ -50,7 +50,7 @@
return behaviorContext;
}
- private ClientValidatorImpl createBehavior() {
+ protected ClientValidatorBehavior createBehavior() {
return new ClientValidatorImpl();
}
Added: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-15 23:58:54 UTC (rev 19587)
@@ -0,0 +1,19 @@
+package org.richfaces.renderkit.html;
+
+import org.richfaces.component.behavior.BehaviorTestBase;
+import org.richfaces.component.behavior.ClientValidatorBehavior;
+
+public class RendererTestBase extends BehaviorTestBase {
+
+ protected ClientValidatorRenderer renderer = new ClientValidatorRenderer();
+
+ public RendererTestBase() {
+ super();
+ }
+
+ @Override
+ protected ClientValidatorBehavior createBehavior() {
+ return controller.createMock(ClientValidatorBehavior.class);
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/ValidatorRendererTest.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/ValidatorRendererTest.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/ValidatorRendererTest.java 2010-10-15 23:58:54 UTC (rev 19587)
@@ -0,0 +1,31 @@
+package org.richfaces.renderkit.html;
+
+import javax.faces.FacesException;
+import javax.faces.component.behavior.ClientBehavior;
+
+import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * <p class="changed_added_4_0">Test getScript method for wrong parameters.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)RunWith(MockTestRunner.class)
+public class ValidatorRendererTest extends RendererTestBase {
+
+ @Test(expected=NullPointerException.class)
+ public void testGetScriptNullContext() {
+ renderer.getScript(null, behavior);
+ }
+ @Test(expected=NullPointerException.class)
+ public void testGetScriptNullBehavior() {
+ renderer.getScript(setupBehaviorContext(input), null);
+ }
+
+ @Test(expected=FacesException.class)
+ public void testGetScriptWrongBehavior() {
+ renderer.getScript(null, controller.createNiceMock(ClientBehavior.class));
+ }
+}
Property changes on: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/ValidatorRendererTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 8 months
JBoss Rich Faces SVN: r19586 - in branches/RF-8742/ui/validator: impl/src/main/java/org/richfaces/validator and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-10-15 15:19:49 -0400 (Fri, 15 Oct 2010)
New Revision: 19586
Added:
branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ConverterDescriptor.java
branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/FacesConverterService.java
branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorDescriptor.java
Removed:
branches/RF-8742/ui/validator/impl/src/main/java/org/richfaces/validator/ValidatorDescriptor.java
Modified:
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
Log:
RESOLVED - issue RF-9506: ClientValidatorBehavior unit tests and implementation.
https://jira.jboss.org/browse/RF-9506
Added: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ConverterDescriptor.java
===================================================================
--- branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ConverterDescriptor.java (rev 0)
+++ branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ConverterDescriptor.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -0,0 +1,5 @@
+package org.richfaces.validator;
+
+public interface ConverterDescriptor extends ValidatorDescriptor {
+
+}
Property changes on: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ConverterDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/FacesConverterService.java
===================================================================
--- branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/FacesConverterService.java (rev 0)
+++ branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/FacesConverterService.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -0,0 +1,16 @@
+package org.richfaces.validator;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+
+/**
+ * <p class="changed_added_4_0">This service extract information from Converter instance.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface FacesConverterService {
+
+ ConverterDescriptor getConverterDescription(FacesContext context,Converter validator);
+
+}
Property changes on: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/FacesConverterService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorDescriptor.java (from rev 19584, branches/RF-8742/ui/validator/impl/src/main/java/org/richfaces/validator/ValidatorDescriptor.java)
===================================================================
--- branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorDescriptor.java (rev 0)
+++ branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorDescriptor.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -0,0 +1,42 @@
+package org.richfaces.validator;
+
+import java.util.Map;
+
+/**
+ * <p class="changed_added_4_0">
+ * Inmlementations of this interface describe JSF or JSR-303 validators. Because JSF supports 2 types of validators,
+ * this interface unifies access to them.
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface ValidatorDescriptor {
+
+ /**
+ * <p class="changed_added_4_0">
+ * Returns JSF {@link javax.faces.validator.Validator} implementation class or JSR-303 annotation class.
+ * </p>
+ *
+ * @return
+ */
+ Class<?> getValidatorClass();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Concrete validator parameters
+ * </p>
+ *
+ * @return non null map with validator instance parameters.
+ */
+ Map<String, Object> getValidatorParameters();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Localized validator message
+ * </p>
+ *
+ * @return
+ */
+ String getMessage();
+}
Property changes on: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: branches/RF-8742/ui/validator/impl/src/main/java/org/richfaces/validator/ValidatorDescriptor.java
===================================================================
--- branches/RF-8742/ui/validator/impl/src/main/java/org/richfaces/validator/ValidatorDescriptor.java 2010-10-15 18:47:06 UTC (rev 19585)
+++ branches/RF-8742/ui/validator/impl/src/main/java/org/richfaces/validator/ValidatorDescriptor.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -1,42 +0,0 @@
-package org.richfaces.validator;
-
-import java.util.Map;
-
-/**
- * <p class="changed_added_4_0">
- * Inmlementations of this interface describe JSF or JSR-303 validators. Because JSF supports 2 types of validators,
- * this interface unifies access to them.
- * </p>
- *
- * @author asmirnov(a)exadel.com
- *
- */
-public interface ValidatorDescriptor {
-
- /**
- * <p class="changed_added_4_0">
- * Returns JSF {@link javax.faces.validator.Validator} implementation class or JSR-303 annotation class.
- * </p>
- *
- * @return
- */
- Class<?> getValidatorClass();
-
- /**
- * <p class="changed_added_4_0">
- * Concrete validator parameters
- * </p>
- *
- * @return non null map with validator instance parameters.
- */
- Map<String, Object> getValidatorParameters();
-
- /**
- * <p class="changed_added_4_0">
- * Localized validator message
- * </p>
- *
- * @return
- */
- String getMessage();
-}
Modified: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java 2010-10-15 18:47:06 UTC (rev 19585)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -4,8 +4,8 @@
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
-import javax.faces.convert.Converter;
+import org.richfaces.validator.ConverterDescriptor;
import org.richfaces.validator.ValidatorDescriptor;
/**
@@ -32,7 +32,7 @@
* @param context
* @return {@link Converter} instance or null if conversion not required.
*/
- Converter getConverter(ClientBehaviorContext context) throws ConverterNotFoundException;
+ ConverterDescriptor getConverter(ClientBehaviorContext context) throws ConverterNotFoundException;
/**
* <p class="changed_added_4_0"></p>
@@ -41,6 +41,10 @@
*/
Collection<ValidatorDescriptor> getValidators(ClientBehaviorContext context);
+ /**
+ * <p class="changed_added_4_0">Returns array of classes that represents JSR-303 validation groups.</p>
+ * @return
+ */
Class<?>[] getGroups();
void setGroups(Class<?> ...groups);
Modified: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2010-10-15 18:47:06 UTC (rev 19585)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -45,6 +45,8 @@
import org.richfaces.renderkit.html.ClientValidatorRenderer;
import org.richfaces.renderkit.html.FormClientValidatorRenderer;
import org.richfaces.validator.BeanValidatorService;
+import org.richfaces.validator.ConverterDescriptor;
+import org.richfaces.validator.FacesConverterService;
import org.richfaces.validator.FacesValidatorService;
import org.richfaces.validator.ValidatorDescriptor;
@@ -130,33 +132,45 @@
* @see org.richfaces.component.behavior.ClientValidatorBehavior#getConverter(javax.faces.component.behavior.
* ClientBehaviorContext)
*/
- public Converter getConverter(ClientBehaviorContext context) throws ConverterNotFoundException {
+ public ConverterDescriptor getConverter(ClientBehaviorContext context) throws ConverterNotFoundException {
UIComponent component = context.getComponent();
if (component instanceof EditableValueHolder) {
EditableValueHolder input = (EditableValueHolder) component;
+ FacesContext facesContext = context.getFacesContext();
Converter converter = input.getConverter();
if (null == converter) {
Class<?> valueType;
ValueExpression valueExpression = component.getValueExpression(VALUE);
if (null != valueExpression) {
- FacesContext facesContext = context.getFacesContext();
valueType = valueExpression.getType(facesContext.getELContext());
- if (valueType != null && valueType != Object.class) {
- Application application = facesContext.getApplication();
- converter = application.createConverter(valueType);
- if (null == converter && valueType != String.class) {
- throw new ConverterNotFoundException("No converter registered for type "
- + valueType.getName());
- }
- }
+ converter = createConverterByType(facesContext, valueType);
}
}
- return converter;
+ if(null != converter){
+ FacesConverterService converterService = ServiceTracker.getService(facesContext, FacesConverterService.class);
+ return converterService.getConverterDescription(facesContext, converter);
+ } else {
+ return null;
+ }
} else {
throw new ConverterNotFoundException("Component does not implement EditableValueHolder" + component);
}
}
+ Converter createConverterByType(FacesContext facesContext, Class<?> valueType)
+ throws ConverterNotFoundException {
+ Converter converter = null;
+ if (valueType != null && valueType != Object.class) {
+ Application application = facesContext.getApplication();
+ converter = application.createConverter(valueType);
+ if (null == converter && valueType != String.class) {
+ throw new ConverterNotFoundException("No converter registered for type "
+ + valueType.getName());
+ }
+ }
+ return converter;
+ }
+
/*
* (non-Javadoc)
*
Modified: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java 2010-10-15 18:47:06 UTC (rev 19585)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -1,32 +1,65 @@
package org.richfaces.component.behavior;
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
import javax.faces.convert.Converter;
import javax.faces.convert.NumberConverter;
+import org.easymock.Capture;
import org.jboss.test.faces.mock.Mock;
import org.jboss.test.faces.mock.MockTestRunner;
+import org.jboss.test.faces.mock.Stub;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.richfaces.application.ServiceTracker;
+import org.richfaces.validator.ConverterDescriptor;
+import org.richfaces.validator.FacesConverterService;
-
/**
- * <p class="changed_added_4_0">This class tests client validator behavior.
- * as it described at https://community.jboss.org/wiki/ClientSideValidation # Server-side rendering algorithm</p>
+ * <p class="changed_added_4_0">
+ * This class tests client validator behavior. as it described at https://community.jboss.org/wiki/ClientSideValidation
+ * # Server-side rendering algorithm
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
@RunWith(MockTestRunner.class)
public class BehaviorGetConverterTest extends BehaviorTestBase {
-
@Mock
private Converter converter;
+ @Mock
+ private FacesConverterService converterService;
+
+ @Stub
+ private ConverterDescriptor descriptor;
+
+ private Capture<Converter> converterCapture;
+
+ @Before
+ public void setupService() {
+ expect(factory.getInstance(FacesConverterService.class)).andStubReturn(converterService);
+ converterCapture = new Capture<Converter>();
+ expect(converterService.getConverterDescription(eq(environment.getFacesContext()), capture(converterCapture)))
+ .andStubReturn(descriptor);
+ ServiceTracker.setFactory(factory);
+ }
+
+ @After
+ public void releaseService() {
+ ServiceTracker.release();
+ }
+
/**
- * <p class="changed_added_4_0">Server-side rendering algorithm .3 - determine client-side converter</p>
+ * <p class="changed_added_4_0">
+ * Server-side rendering algorithm .3 - determine client-side converter
+ * </p>
+ *
* @throws Exception
*/
@Test
@@ -37,7 +70,10 @@
}
/**
- * <p class="changed_added_4_0">Server-side rendering algorithm .3 - determine client-side converter</p>
+ * <p class="changed_added_4_0">
+ * Server-side rendering algorithm .3 - determine client-side converter
+ * </p>
+ *
* @throws Exception
*/
@Test
@@ -49,11 +85,11 @@
private void setupConverterFromApplication(Converter converter) {
expect(input.getConverter()).andReturn(null);
expect(input.getValueExpression("value")).andReturn(expression);
- expect((Class)(expression.getType(environment.getElContext()))).andReturn(Number.class);
+ expect((Class) (expression.getType(environment.getElContext()))).andReturn(Number.class);
expect(environment.getApplication().createConverter(Number.class)).andReturn(converter);
}
-
- @Test(expected=ConverterNotFoundException.class)
+
+ @Test(expected = ConverterNotFoundException.class)
public void testGetConverterNotExists() throws Exception {
setupConverterFromApplication(null);
checkConverter(null);
@@ -63,22 +99,22 @@
public void testSetConverterForString() throws Exception {
expect(input.getConverter()).andReturn(null);
expect(input.getValueExpression("value")).andReturn(expression);
- expect((Class)(expression.getType(environment.getElContext()))).andReturn(String.class);
+ expect((Class) (expression.getType(environment.getElContext()))).andReturn(String.class);
expect(environment.getApplication().createConverter(String.class)).andReturn(null);
checkConverter(null);
}
-
+
private void checkConverter(Converter converter) throws ConverterNotFoundException {
setupBehaviorContext(input);
controller.replay();
- Converter converter2 = behavior.getConverter(behaviorContext);
+ ConverterDescriptor converter2 = behavior.getConverter(behaviorContext);
controller.verify();
- if(null == converter){
+ if (null == converter) {
assertNull(converter2);
} else {
- assertSame(converter,converter2);
+ assertNotNull(converter2);
+ assertSame(converter, converterCapture.getValue());
}
}
-
}
Modified: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java 2010-10-15 18:47:06 UTC (rev 19585)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -19,7 +19,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.application.ServiceTracker;
-import org.richfaces.application.ServicesFactory;
import org.richfaces.validator.BeanValidatorService;
import org.richfaces.validator.FacesValidatorService;
import org.richfaces.validator.ValidatorDescriptor;
@@ -56,9 +55,6 @@
private FacesValidatorService facesValidatorService;
@Stub
- private ServicesFactory factory;
-
- @Stub
private ValueExpression expression;
@Before
Modified: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-10-15 18:47:06 UTC (rev 19585)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-10-15 19:19:49 UTC (rev 19586)
@@ -13,7 +13,9 @@
import org.jboss.test.faces.mock.Mock;
import org.jboss.test.faces.mock.MockController;
import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.jboss.test.faces.mock.Stub;
import org.junit.Before;
+import org.richfaces.application.ServicesFactory;
public class BehaviorTestBase {
@@ -30,6 +32,8 @@
protected ClientValidatorImpl behavior;
@Mock
protected ValueExpression expression;
+ @Stub
+ protected ServicesFactory factory;
public BehaviorTestBase() {
super();
13 years, 8 months