JBoss Rich Faces SVN: r8628 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-05-19 05:40:09 -0400 (Mon, 19 May 2008)
New Revision: 8628
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
http://jira.jboss.com/jira/browse/RF-3163
5.9.8. XCSS file format
5.9.9. Plug-n-Skin
added to the guide
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-05-16 21:04:44 UTC (rev 8627)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-05-19 09:40:09 UTC (rev 8628)
@@ -1607,7 +1607,7 @@
<section id="StControlsSkinning">
<title>Standard controls skinning</title>
<para>The feature is designed to unify the look and feel of standard HTML element and RichFaces components.
- Skinning can be applied to all controls on a page basing on element'
+ Skinning can be applied to all controls on a page basing on elements'
name and attribute type (where applicable). Also this feature
provides a set of CSS styles so that skinning can be applied
assigning rich-* classes to particular elements or to container of elements that nests controls.
@@ -2251,10 +2251,196 @@
</section>
-</section>
+ </section>
+ <section id="XCSSfile format">
+ <title>XCSS file format</title>
+
+ <para>XCSS files are the core of Richfaces components skinnability. </para>
+ <para>XCSS is an XML formatted CSS that adds extra functionality to the skinning process</para>
+
+
+ <para>XCSS extends skinning possibilities by parsing the XCSS file that contains all look-and-feel parameters of
+ a particular component into a standard CSS file that a web browser can recognize. </para>
+
+
+
+
+ <para>XCSS file contains CSS properties and skin parameters
+ mappings. Mapping of a CSS selector to a skin parameter
+ is performed using < u:selector > and < u:style> XML tags
+ that form the mapping structure. Please study the example below.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <u:selector name=".rich-component-name">
+ <u:style name="background-color" skin="additionalBackgroundColor" />
+ <u:style name="border-color" skin="tableBorderColor" />
+ <u:style name="border-width" skin="tableBorderWidth" />
+ <u:style name="border-style" value="solid" />
+ </u:selector>
+...
+]]></programlisting>
+
+ During processing the code in the shown example will be parsed into a standard CSS format.
+ <programlisting role="CSS"><![CDATA[...
+.rich-component-name {
+background-color: additionalBackgroundColor; /*the value of the constant defined by your skin*/
+border-color: tableBorderColor; /*the value of the constant defined by your skin*/
+border-width: tableBorderWidth /*the value of the constant defined by your skin*/
+border-style: solid;
+}
+...
+]]></programlisting>
+
+ <para>
+ The <property>name</property> attribute of <u:selector> tag defines the CSS selector, while <property>name</property> attribute of
+ the < u:style> tag defines what skin constant is mapped to a CSS property.
+ The <property>value</property> attribute of the < u:style> tag can also be used to assign a value to a CSS property.
+ </para>
+
+
+ <para>CSS selectors with identical skinning properties can be set as a comma separated list. </para>
+ <programlisting role="XML"><![CDATA[...
+<u:selector name=".rich-ordering-control-disabled, .rich-ordering-control-top, .rich-ordering-control-bottom, .rich-ordering-control-up, .rich-ordering-control-down">
+ <u:style name="border-color" skin="tableBorderColor" />
+</u:selector>
+...
+]]></programlisting>
+
+
+
+
+ </section>
+
+ <section id="StPluggableSkinnability">
+ <title>Plug-n-Skin</title>
+
+ <para>Plug-n-Skin feature is designed to extend and override the base skin you use,
+ it allows to redefine the look of a set of components by taking the base skin as basis and plugging-in custom styles.
+
+ </para>
+
+
+<para>Basically, implementation of this feature is performed the same way as you create your own custom skin.
+ For more information, please, read <link linkend="CreatingAndUsingYourOwnSkinFile"> "Creating and Using Your Own Skin File"</link> section of the guide.
+ The properties that are used to perform the redefinition of the
+ base skin are stored in <name>.skin.properties file (same type of file as you would use for creating your own skin). </para>
+
+
+ <para>These are the properties you need to set-up this feature:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><property>baseSkin</property> – the name of the base skin to be used as basis.
+ The look of the skin you define will be affected by new style properties.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para><property>generalStyleSheet</property> -
+ a path to the style sheet (<newskinname>.xcss) that imports style sheets of the components to be affected by the new skin
+ </para>
+
+ </listitem>
+
+ <listitem>
+ <para><property>extendedStyleSheet</property> - a path to a style sheet that is used to unify the appearance of RichFaces components and standard HTML controls.
+ For additional information please read <link linkend="StControlsSkinning">"Standard controls skinning"</link> chapter.
+ </para></listitem>
+
+
+ <listitem>
+ <para><property>gradientType</property> is a predefined property to set the type of gradient applied to the new skin. Possible values are glass, plastic, plain. More information on gradient implementation you can find further in this chapter.
+ </para>
+ </listitem>
+
+
+ </itemizedlist>
+
+<para>
+ As it has already been mentioned the <property><newskinname>.xcss</property> contains a list of style sheeted that the new skin affects.
+</para>
+ <para>Importing of the style sheets that redefine the appearance of component to the <newskinname>.xcss is performed using
+ <property><f:importResource></property> tag. Please see the example below.
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<f:importResource src="org/richfaces/newSkinName/componentName.xcss" />
+...
+]]></programlisting>
+
+ <para>Here is template of the <property><newskinname>.xcss</property> file.</para>
+ <programlisting role="XML"><![CDATA[
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml" >
+ <f:importResource src="org/richfaces/newSkinName/calendar.xcss" />
+ <f:importResource src="org/richfaces/newSkinName/combobox.xcss" />
+...
+ <f:importResource src="org/richfaces/newSkinName/tree.xcss" />
+ <f:importResource src="org/richfaces/newSkinName/virtualEarth.xcss" />
+</f:template>
+]]></programlisting>
+
+
+ <para>
+ So, now having imported the XCSS files with style sheets of components you want to be affected by the new skin, you can start redefining style properties for each component in the
+ <property> componentName.xcss</property> files. Please study the example below.</para>
+
+ <programlisting role="XML"><![CDATA[...
+ <u:selector name=".rich-combobox-item-selected">
+ <u:style name="border-width" value="1px" />
+ <u:style name="border-style" value="solid" />
+ <u:style name="border-color" skin="newBorder" />
+ <u:style name="background-position" value="0% 50%" />
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient">
+ <f:attribute name="valign" value="middle" />
+
+ <f:attribute name="gradientHeight" value="17px" />
+ <f:attribute name="baseColor" skin="headerBackgroundColor" />
+ </f:resource>
+ </u:style>
+ </u:selector>
+...
+]]></programlisting>
+
+ <para>In the shown example, new skin properties are applied to the <property>combobox</property> component.</para>
+ <para>Please notice that <property>background-image</property> can be used to set a predefined gradient by means of
+ <property><f:resource f:key="org.richfaces.renderkit.html.CustomizeableGradient"></property> and the <property>gradientType</property> constant set to one of the possible values.
+ </para>
+
+ <para>You can also apply these style properties to <property>background-image</property>:</para>
+ <itemizedlist>
+
+ <listitem><para> baseColor</para></listitem>
+ <listitem><para> gradientColor</para></listitem>
+ <listitem><para> gradientHeight</para></listitem>
+ <listitem><para> valign</para></listitem>
+ <listitem><para> gradientType</para></listitem>
+ </itemizedlist>
+
+ <para>The base skin and the new skin should be set in web.xml</para>
+
+
+ <programlisting role="XML"><![CDATA[...
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.BASE_SKIN</param-name>
+ <param-value>#{skinBean.baseSkin}</param-value>
+ </context-param>
+...
+]]></programlisting>
+
+ </section>
</section>
+
+
<!--section id="OtherRelevantResources">
<title>Other Relevant Resources</title>
16 years, 8 months
JBoss Rich Faces SVN: r8627 - in trunk: framework/impl/src/main/java/org/ajax4jsf/application and 24 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-05-16 17:04:44 -0400 (Fri, 16 May 2008)
New Revision: 8627
Added:
trunk/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java
trunk/sandbox/samples/state-sample/
trunk/sandbox/samples/state-sample/.metadata/
trunk/sandbox/samples/state-sample/.metadata/src/
trunk/sandbox/samples/state-sample/.metadata/src/main/
trunk/sandbox/samples/state-sample/.metadata/src/main/webapp/
trunk/sandbox/samples/state-sample/.metadata/src/main/webapp/WEB-INF/
trunk/sandbox/samples/state-sample/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow
trunk/sandbox/samples/state-sample/.svnignore
trunk/sandbox/samples/state-sample/pom.xml
trunk/sandbox/samples/state-sample/src/
trunk/sandbox/samples/state-sample/src/main/
trunk/sandbox/samples/state-sample/src/main/java/
trunk/sandbox/samples/state-sample/src/main/java/org/
trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/
trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Config.java
trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/LoginAction.java
trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/RegisterAction.java
trunk/sandbox/samples/state-sample/src/main/webapp/
trunk/sandbox/samples/state-sample/src/main/webapp/META-INF/
trunk/sandbox/samples/state-sample/src/main/webapp/META-INF/MANIFEST.MF
trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/
trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/lib/
trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/state-sample/src/main/webapp/images/
trunk/sandbox/samples/state-sample/src/main/webapp/images/Canon.jpg
trunk/sandbox/samples/state-sample/src/main/webapp/images/Nikon.jpg
trunk/sandbox/samples/state-sample/src/main/webapp/images/Olympus.jpg
trunk/sandbox/samples/state-sample/src/main/webapp/images/collapse.gif
trunk/sandbox/samples/state-sample/src/main/webapp/images/expand.gif
trunk/sandbox/samples/state-sample/src/main/webapp/index.jsp
trunk/sandbox/samples/state-sample/src/main/webapp/pages/
trunk/sandbox/samples/state-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/ui/state/src/main/java/org/richfaces/el/
trunk/sandbox/ui/state/src/main/java/org/richfaces/el/StateELResolver.java
trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java
trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java
trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java
trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/States.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
trunk/sandbox/ui/state/pom.xml
trunk/sandbox/ui/state/src/main/config/component/state.xml
trunk/sandbox/ui/state/src/main/config/component/states.xml
trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/State.java
Log:
Attnotation for a KeepAlive beans have been created.
Draft implementation of the state component.
Added: trunk/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java (rev 0)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,22 @@
+/**
+ *
+ */
+package org.ajax4jsf.model;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Marker annotation, to keep request-scope beans between requests in the view state.
+ * @author asmirnov
+ *
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface KeepAlive {
+
+}
Property changes on: trunk/framework/api/src/main/java/org/ajax4jsf/model/KeepAlive.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2008-05-16 19:23:08 UTC (rev 8626)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -23,11 +23,15 @@
import java.io.IOException;
import java.lang.reflect.Constructor;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
+import java.util.Map.Entry;
import javax.faces.FactoryFinder;
import javax.faces.application.StateManager;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
@@ -37,6 +41,7 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxPhaseListener;
+import org.ajax4jsf.model.KeepAlive;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -306,11 +311,32 @@
}
protected Object getAdditionalState(FacesContext context) {
- return null;
+ Map<String, Object> keepAliveBeans=new HashMap<String, Object>();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ // Save all objects form request map wich marked by @KeepAlive annotations
+ for (Entry<String, Object> requestEntry : requestMap.entrySet()) {
+ Object bean = requestEntry.getValue();
+ if (bean.getClass().isAnnotationPresent(KeepAlive.class)) {
+ keepAliveBeans.put(requestEntry.getKey(), bean);
+ }
+ }
+ if(keepAliveBeans.size()>0){
+ return UIComponentBase.saveAttachedState(context, keepAliveBeans);
+ } else {
+ return null;
+ }
}
+ @SuppressWarnings("unchecked")
protected void restoreAdditionalState(FacesContext context, Object state) {
-
+ if(null != state){
+ // Append all saved beans to the request map.
+ Map beansMap = (Map) UIComponentBase.restoreAttachedState(context, state);
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ for (Object key : beansMap.keySet()) {
+ requestMap.put((String) key, beansMap.get(key));
+ }
+ }
}
/**
Added: trunk/sandbox/samples/state-sample/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow
===================================================================
--- trunk/sandbox/samples/state-sample/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow (rev 0)
+++ trunk/sandbox/samples/state-sample/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pageflow:Pageflow xmlns:pageflow="http://www.sybase.com/suade/pageflow" id="pf12108743769720" configfile="/state-sample/src/main/webapp/WEB-INF/faces-config.xml"/>
Added: trunk/sandbox/samples/state-sample/.svnignore
===================================================================
--- trunk/sandbox/samples/state-sample/.svnignore (rev 0)
+++ trunk/sandbox/samples/state-sample/.svnignore 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,5 @@
+target
+
+.settings
+.classpath
+.project
Added: trunk/sandbox/samples/state-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/state-sample/pom.xml (rev 0)
+++ trunk/sandbox/samples/state-sample/pom.xml 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>state-sample</artifactId>
+ <packaging>war</packaging>
+ <name>webapp Maven Webapp</name>
+ <build>
+ <finalName>state-sample</finalName>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>state</artifactId>
+ <version>3.2.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>3.2.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>skins</artifactId>
+ <version>3.2.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Property changes on: trunk/sandbox/samples/state-sample/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Bean.java (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Bean.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,62 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import javax.faces.event.ActionEvent;
+
+
+/**
+ * @author $Autor$
+ */
+public class Bean {
+
+ private String name;
+
+ private String password;
+
+ private String confirmPassword;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getConfirmPassword() {
+ return confirmPassword;
+ }
+
+ public void setConfirmPassword(String confirmPassword) {
+ this.confirmPassword = confirmPassword;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Config.java
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Config.java (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Config.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,48 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.ui.model.States;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Config {
+
+ public States getStates(){
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ States states = new States();
+ states.setCurrentState("register");
+ states.put("showConfirm", Boolean.TRUE);
+ states.put("link", "To login");
+ states.put("okBtn", "Register");
+ ExpressionFactory expressionFactory = facesContext.getApplication().getExpressionFactory();
+ ValueExpression beanExpression = expressionFactory.createValueExpression(facesContext.getELContext(), "#{registerbean}", Bean.class);
+ states.put("bean", beanExpression);
+ beanExpression = expressionFactory.createValueExpression(facesContext.getELContext(), "#{registeraction}", RegisterAction.class);
+ states.put("action", beanExpression);
+ MethodExpression okExpression = expressionFactory.createMethodExpression(facesContext.getELContext(), "#{registeraction.ok}", String.class, new Class[] {});
+ states.put("ok", okExpression);
+ states.setNavigation("switch", "login");
+ states.setCurrentState("login");
+ states.put("showConfirm", Boolean.FALSE);
+ states.put("link", "To register");
+ states.put("okBtn", "Login");
+ beanExpression = expressionFactory.createValueExpression(facesContext.getELContext(), "#{loginbean}", Bean.class);
+ states.put("bean", beanExpression);
+ beanExpression = expressionFactory.createValueExpression(facesContext.getELContext(), "#{loginaction}", LoginAction.class);
+ states.put("action", beanExpression);
+ okExpression = expressionFactory.createMethodExpression(facesContext.getELContext(), "#{loginaction.ok}", String.class, new Class[] {});
+ states.put("ok", okExpression);
+ states.setNavigation("switch", "register");
+ return states;
+ }
+
+}
Property changes on: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/Config.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/LoginAction.java
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/LoginAction.java (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/LoginAction.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,39 @@
+package org.richfaces;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+
+
+
+
+public class LoginAction implements ActionListener
+{
+
+ private Bean bean;
+
+ public void processAction(ActionEvent event) throws AbortProcessingException
+ {
+ System.out.println("login action event");
+ }
+
+ public String ok() {
+ System.out.println("login action");
+ return "success";
+ }
+
+ /**
+ * @return the bean
+ */
+ public Bean getBean() {
+ return bean;
+ }
+
+ /**
+ * @param bean the bean to set
+ */
+ public void setBean(Bean bean) {
+ this.bean = bean;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/LoginAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/RegisterAction.java
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/RegisterAction.java (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/RegisterAction.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,38 @@
+package org.richfaces;
+
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+
+
+
+
+public class RegisterAction implements ActionListener
+{
+ private Bean bean;
+
+ public void processAction(ActionEvent event) throws AbortProcessingException
+ {
+ System.out.println("register action event");
+ }
+
+ public String ok() {
+ System.out.println("register action");
+ return "success";
+ }
+
+ /**
+ * @return the bean
+ */
+ public Bean getBean() {
+ return bean;
+ }
+
+ /**
+ * @param bean the bean to set
+ */
+ public void setBean(Bean bean) {
+ this.bean = bean;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/sandbox/samples/state-sample/src/main/java/org/richfaces/RegisterAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/webapp/META-INF/MANIFEST.MF 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+ <application>
+ <navigation-handler>
+ org.richfaces.ui.application.StateNavigationHandler</navigation-handler>
+ <el-resolver>org.richfaces.el.StateELResolver</el-resolver>
+ </application>
+ <managed-bean>
+ <managed-bean-name>loginbean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>registerbean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>loginaction</managed-bean-name>
+ <managed-bean-class>org.richfaces.LoginAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>
+ bean</property-name>
+ <property-class>
+ org.richfaces.Bean</property-class>
+ <value>
+ #{loginbean}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>registeraction</managed-bean-name>
+ <managed-bean-class>org.richfaces.RegisterAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>
+ bean</property-name>
+ <property-class>
+ org.richfaces.Bean</property-class>
+ <value>
+ #{registerbean}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>skinBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>
+ state</managed-bean-name>
+ <managed-bean-class>
+ org.richfaces.ui.model.States</managed-bean-class>
+ <managed-bean-scope>
+ request</managed-bean-scope>
+ <managed-property>
+ <property-name>
+ states</property-name>
+ <property-class>
+ org.richfaces.ui.model.States</property-class>
+ <value>#{config.states}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>
+ config</managed-bean-name>
+ <managed-bean-class>
+ org.richfaces.Config</managed-bean-class>
+ <managed-bean-scope>
+ none</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/web.xml 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/webapp/images/Canon.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/images/Canon.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/samples/state-sample/src/main/webapp/images/Nikon.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/images/Nikon.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/samples/state-sample/src/main/webapp/images/Olympus.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/images/Olympus.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/samples/state-sample/src/main/webapp/images/collapse.gif
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/images/collapse.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/samples/state-sample/src/main/webapp/images/expand.gif
===================================================================
(Binary files differ)
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/images/expand.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/sandbox/samples/state-sample/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/webapp/index.jsp 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,8 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+
+<body>
+ <jsp:forward page="/pages/index.jsf"/>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/samples/state-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/state-sample/src/main/webapp/pages/index.jsp (rev 0)
+++ trunk/sandbox/samples/state-sample/src/main/webapp/pages/index.jsp 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,39 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+<head>
+<title></title>
+
+<style type="text/css">
+.customHeader {
+ color: #000000;
+ background-image: url();
+ background-color: #32CD32;
+}
+</style>
+
+</head>
+
+<body>
+<f:view>
+ <h:form id="state_form">
+ <h:panelGrid columns="2">
+ <h:outputText value="username" />
+ <h:inputText value="#{state.bean.name}" />
+ <h:outputText value="password" />
+ <h:inputText value="#{state.bean.password}" />
+ <h:outputText value="confirm" rendered="#{state.showConfirm}" />
+ <h:inputText value="#{state.bean.confirmPassword}"
+ rendered="#{state.showConfirm}" />
+ <h:commandLink action="switch" value="#{state.link}" immediate="true"/>
+ <h:panelGroup>
+ <h:commandButton action="#{state.action.ok}" value="#{state.okBtn}"
+ />
+ <h:commandButton action="#{state.ok}" value="Action" />
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:messages></h:messages>
+ </h:form>
+</f:view>
+</body>
+</html>
Property changes on: trunk/sandbox/samples/state-sample/src/main/webapp/pages/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/ui/state/pom.xml
===================================================================
--- trunk/sandbox/ui/state/pom.xml 2008-05-16 19:23:08 UTC (rev 8626)
+++ trunk/sandbox/ui/state/pom.xml 2008-05-16 21:04:44 UTC (rev 8627)
@@ -5,7 +5,7 @@
<version>3.2.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui</groupId>
+ <groupId>org.richfaces.sandbox.ui</groupId>
<artifactId>state</artifactId>
<name>state</name>
<build>
Modified: trunk/sandbox/ui/state/src/main/config/component/state.xml
===================================================================
--- trunk/sandbox/ui/state/src/main/config/component/state.xml 2008-05-16 19:23:08 UTC (rev 8626)
+++ trunk/sandbox/ui/state/src/main/config/component/state.xml 2008-05-16 21:04:44 UTC (rev 8627)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd" >
<components>
<component>
<name>org.richfaces.ui.State</name>
Modified: trunk/sandbox/ui/state/src/main/config/component/states.xml
===================================================================
--- trunk/sandbox/ui/state/src/main/config/component/states.xml 2008-05-16 19:23:08 UTC (rev 8626)
+++ trunk/sandbox/ui/state/src/main/config/component/states.xml 2008-05-16 21:04:44 UTC (rev 8627)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd" >
<components>
<component>
<name>org.richfaces.ui.States</name>
Added: trunk/sandbox/ui/state/src/main/java/org/richfaces/el/StateELResolver.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/el/StateELResolver.java (rev 0)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/el/StateELResolver.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,222 @@
+/**
+ *
+ */
+package org.richfaces.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.ui.model.State;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateELResolver extends ELResolver {
+
+ private static final class ELContextWrapper extends ELContext {
+ private final ELContext context;
+
+ private boolean resolved = false;
+
+ private ELContextWrapper(ELContext context) {
+ this.context = context;
+ }
+
+ @Override
+ public ELResolver getELResolver() {
+ return context.getELResolver();
+ }
+
+ @Override
+ public FunctionMapper getFunctionMapper() {
+ return context.getFunctionMapper();
+ }
+
+ @Override
+ public VariableMapper getVariableMapper() {
+ return context.getVariableMapper();
+ }
+
+ /**
+ * @param key
+ * @return
+ * @see javax.el.ELContext#getContext(java.lang.Class)
+ */
+ public Object getContext(Class key) {
+ return context.getContext(key);
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getLocale()
+ */
+ public Locale getLocale() {
+ return context.getLocale();
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#isPropertyResolved()
+ */
+ public boolean isPropertyResolved() {
+ return resolved;
+ }
+
+ /**
+ * @param key
+ * @param contextObject
+ * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
+ */
+ public void putContext(Class key, Object contextObject) {
+ context.putContext(key, contextObject);
+ }
+
+ /**
+ * @param locale
+ * @see javax.el.ELContext#setLocale(java.util.Locale)
+ */
+ public void setLocale(Locale locale) {
+ context.setLocale(locale);
+ }
+
+ /**
+ * @param resolved
+ * @see javax.el.ELContext#setPropertyResolved(boolean)
+ */
+ public void setPropertyResolved(boolean resolved) {
+ this.resolved = resolved;
+ }
+ }
+
+ private static List<FeatureDescriptor> stateFeatureDescriptors;
+ static {
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setDisplayName("Page state");
+ descriptor.setExpert(false);
+ descriptor.setName("state");
+ descriptor.setHidden(false);
+ stateFeatureDescriptors = Collections.singletonList(descriptor);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ if (null != base && base instanceof State) {
+ return String.class;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
+ Object base) {
+ if (null != base && base instanceof State) {
+ return stateFeatureDescriptors.iterator();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ if (null != base && base instanceof State) {
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ State state = (State)base;
+ Object stateProperty = state.get(property.toString());
+ if (stateProperty == null) {
+ throw new PropertyNotFoundException("State Property ["+property+"] not found ");
+ }
+ context.setPropertyResolved(true);
+ if (stateProperty instanceof ValueExpression) {
+ ValueExpression propertyExpression = (ValueExpression) stateProperty;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ return propertyExpression.getType(facesContext.getELContext());
+ }
+ return stateProperty.getClass();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public Object getValue(final ELContext context, Object base, Object property) {
+ if (null != base && base instanceof State) {
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ State state = (State)base;
+ Object stateProperty = state.get(property.toString());
+ if (stateProperty == null) {
+ throw new PropertyNotFoundException("State Property ["+property+"] not found ");
+ }
+ context.setPropertyResolved(true);
+ if (stateProperty instanceof ValueExpression) {
+ ValueExpression propertyExpression = (ValueExpression) stateProperty;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ELContext tempContext = new ELContextWrapper(context);
+ return propertyExpression.getValue(tempContext);
+ }
+ return stateProperty;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ if (null != base && base instanceof State){
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ State state = (State)base;
+ Object stateProperty = state.get(property.toString());
+ if (stateProperty == null) {
+ throw new PropertyNotFoundException("State Property ["+property+"] not found ");
+ }
+ context.setPropertyResolved(true);
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void setValue(ELContext context, Object base, Object property,
+ Object value) {
+ if (null != base && base instanceof State){
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ throw new PropertyNotWritableException((String) property);
+ }
+ }
+
+}
Property changes on: trunk/sandbox/ui/state/src/main/java/org/richfaces/el/StateELResolver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java (rev 0)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,445 @@
+/**
+ *
+ */
+package org.richfaces.ui.application;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.el.ELContextListener;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.NavigationHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.PropertyResolver;
+import javax.faces.el.ReferenceSyntaxException;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.VariableResolver;
+import javax.faces.event.ActionListener;
+import javax.faces.validator.Validator;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateApplication extends Application {
+
+ private final Application parent;
+ private final ExpressionFactory exprFactory;
+
+ /**
+ * @param parent
+ */
+ public StateApplication(Application parent) {
+ super();
+ this.parent = parent;
+ this.exprFactory = new StateExpressionFactory(parent.getExpressionFactory());
+ }
+
+ /**
+ * @param componentType
+ * @param componentClass
+ * @see javax.faces.application.Application#addComponent(java.lang.String, java.lang.String)
+ */
+ public void addComponent(String componentType, String componentClass) {
+ parent.addComponent(componentType, componentClass);
+ }
+
+ /**
+ * @param targetClass
+ * @param converterClass
+ * @see javax.faces.application.Application#addConverter(java.lang.Class, java.lang.String)
+ */
+ public void addConverter(Class targetClass, String converterClass) {
+ parent.addConverter(targetClass, converterClass);
+ }
+
+ /**
+ * @param converterId
+ * @param converterClass
+ * @see javax.faces.application.Application#addConverter(java.lang.String, java.lang.String)
+ */
+ public void addConverter(String converterId, String converterClass) {
+ parent.addConverter(converterId, converterClass);
+ }
+
+ /**
+ * @param listener
+ * @see javax.faces.application.Application#addELContextListener(javax.el.ELContextListener)
+ */
+ public void addELContextListener(ELContextListener listener) {
+ parent.addELContextListener(listener);
+ }
+
+ /**
+ * @param resolver
+ * @see javax.faces.application.Application#addELResolver(javax.el.ELResolver)
+ */
+ public void addELResolver(ELResolver resolver) {
+ parent.addELResolver(resolver);
+ }
+
+ /**
+ * @param validatorId
+ * @param validatorClass
+ * @see javax.faces.application.Application#addValidator(java.lang.String, java.lang.String)
+ */
+ public void addValidator(String validatorId, String validatorClass) {
+ parent.addValidator(validatorId, validatorClass);
+ }
+
+ /**
+ * @param componentType
+ * @return
+ * @throws FacesException
+ * @see javax.faces.application.Application#createComponent(java.lang.String)
+ */
+ public UIComponent createComponent(String componentType)
+ throws FacesException {
+ return parent.createComponent(componentType);
+ }
+
+ /**
+ * @param componentBinding
+ * @param context
+ * @param componentType
+ * @return
+ * @throws FacesException
+ * @deprecated
+ * @see javax.faces.application.Application#createComponent(javax.faces.el.ValueBinding, javax.faces.context.FacesContext, java.lang.String)
+ */
+ public UIComponent createComponent(ValueBinding componentBinding,
+ FacesContext context, String componentType) throws FacesException {
+ return parent.createComponent(componentBinding, context, componentType);
+ }
+
+ /**
+ * @param componentExpression
+ * @param context
+ * @param componentType
+ * @return
+ * @throws FacesException
+ * @see javax.faces.application.Application#createComponent(javax.el.ValueExpression, javax.faces.context.FacesContext, java.lang.String)
+ */
+ public UIComponent createComponent(ValueExpression componentExpression,
+ FacesContext context, String componentType) throws FacesException {
+ return parent.createComponent(componentExpression, context,
+ componentType);
+ }
+
+ /**
+ * @param targetClass
+ * @return
+ * @see javax.faces.application.Application#createConverter(java.lang.Class)
+ */
+ public Converter createConverter(Class targetClass) {
+ return parent.createConverter(targetClass);
+ }
+
+ /**
+ * @param converterId
+ * @return
+ * @see javax.faces.application.Application#createConverter(java.lang.String)
+ */
+ public Converter createConverter(String converterId) {
+ return parent.createConverter(converterId);
+ }
+
+ /**
+ * @param ref
+ * @param params
+ * @return
+ * @throws ReferenceSyntaxException
+ * @deprecated
+ * @see javax.faces.application.Application#createMethodBinding(java.lang.String, java.lang.Class[])
+ */
+ public MethodBinding createMethodBinding(String ref, Class[] params)
+ throws ReferenceSyntaxException {
+ return parent.createMethodBinding(ref, params);
+ }
+
+ /**
+ * @param validatorId
+ * @return
+ * @throws FacesException
+ * @see javax.faces.application.Application#createValidator(java.lang.String)
+ */
+ public Validator createValidator(String validatorId) throws FacesException {
+ return parent.createValidator(validatorId);
+ }
+
+ /**
+ * @param ref
+ * @return
+ * @throws ReferenceSyntaxException
+ * @deprecated
+ * @see javax.faces.application.Application#createValueBinding(java.lang.String)
+ */
+ public ValueBinding createValueBinding(String ref)
+ throws ReferenceSyntaxException {
+ return parent.createValueBinding(ref);
+ }
+
+ /**
+ * @param context
+ * @param expression
+ * @param expectedType
+ * @return
+ * @throws ELException
+ * @see javax.faces.application.Application#evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class)
+ */
+ public Object evaluateExpressionGet(FacesContext context,
+ String expression, Class expectedType) throws ELException {
+ return parent.evaluateExpressionGet(context, expression, expectedType);
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getActionListener()
+ */
+ public ActionListener getActionListener() {
+ return parent.getActionListener();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getComponentTypes()
+ */
+ public Iterator<String> getComponentTypes() {
+ return parent.getComponentTypes();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getConverterIds()
+ */
+ public Iterator<String> getConverterIds() {
+ return parent.getConverterIds();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getConverterTypes()
+ */
+ public Iterator<Class> getConverterTypes() {
+ return parent.getConverterTypes();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getDefaultLocale()
+ */
+ public Locale getDefaultLocale() {
+ return parent.getDefaultLocale();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getDefaultRenderKitId()
+ */
+ public String getDefaultRenderKitId() {
+ return parent.getDefaultRenderKitId();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getELContextListeners()
+ */
+ public ELContextListener[] getELContextListeners() {
+ return parent.getELContextListeners();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getELResolver()
+ */
+ public ELResolver getELResolver() {
+ return parent.getELResolver();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getExpressionFactory()
+ */
+ public ExpressionFactory getExpressionFactory() {
+ return this.exprFactory;
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getMessageBundle()
+ */
+ public String getMessageBundle() {
+ return parent.getMessageBundle();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getNavigationHandler()
+ */
+ public NavigationHandler getNavigationHandler() {
+ return parent.getNavigationHandler();
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see javax.faces.application.Application#getPropertyResolver()
+ */
+ public PropertyResolver getPropertyResolver() {
+ return parent.getPropertyResolver();
+ }
+
+ /**
+ * @param ctx
+ * @param name
+ * @return
+ * @see javax.faces.application.Application#getResourceBundle(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public ResourceBundle getResourceBundle(FacesContext ctx, String name) {
+ return parent.getResourceBundle(ctx, name);
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getStateManager()
+ */
+ public StateManager getStateManager() {
+ return parent.getStateManager();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getSupportedLocales()
+ */
+ public Iterator<Locale> getSupportedLocales() {
+ return parent.getSupportedLocales();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getValidatorIds()
+ */
+ public Iterator<String> getValidatorIds() {
+ return parent.getValidatorIds();
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see javax.faces.application.Application#getVariableResolver()
+ */
+ public VariableResolver getVariableResolver() {
+ return parent.getVariableResolver();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getViewHandler()
+ */
+ public ViewHandler getViewHandler() {
+ return parent.getViewHandler();
+ }
+
+ /**
+ * @param listener
+ * @see javax.faces.application.Application#removeELContextListener(javax.el.ELContextListener)
+ */
+ public void removeELContextListener(ELContextListener listener) {
+ parent.removeELContextListener(listener);
+ }
+
+ /**
+ * @param listener
+ * @see javax.faces.application.Application#setActionListener(javax.faces.event.ActionListener)
+ */
+ public void setActionListener(ActionListener listener) {
+ parent.setActionListener(listener);
+ }
+
+ /**
+ * @param locale
+ * @see javax.faces.application.Application#setDefaultLocale(java.util.Locale)
+ */
+ public void setDefaultLocale(Locale locale) {
+ parent.setDefaultLocale(locale);
+ }
+
+ /**
+ * @param renderKitId
+ * @see javax.faces.application.Application#setDefaultRenderKitId(java.lang.String)
+ */
+ public void setDefaultRenderKitId(String renderKitId) {
+ parent.setDefaultRenderKitId(renderKitId);
+ }
+
+ /**
+ * @param bundle
+ * @see javax.faces.application.Application#setMessageBundle(java.lang.String)
+ */
+ public void setMessageBundle(String bundle) {
+ parent.setMessageBundle(bundle);
+ }
+
+ /**
+ * @param handler
+ * @see javax.faces.application.Application#setNavigationHandler(javax.faces.application.NavigationHandler)
+ */
+ public void setNavigationHandler(NavigationHandler handler) {
+ parent.setNavigationHandler(handler);
+ }
+
+ /**
+ * @param resolver
+ * @deprecated
+ * @see javax.faces.application.Application#setPropertyResolver(javax.faces.el.PropertyResolver)
+ */
+ public void setPropertyResolver(PropertyResolver resolver) {
+ parent.setPropertyResolver(resolver);
+ }
+
+ /**
+ * @param manager
+ * @see javax.faces.application.Application#setStateManager(javax.faces.application.StateManager)
+ */
+ public void setStateManager(StateManager manager) {
+ parent.setStateManager(manager);
+ }
+
+ /**
+ * @param locales
+ * @see javax.faces.application.Application#setSupportedLocales(java.util.Collection)
+ */
+ public void setSupportedLocales(Collection<Locale> locales) {
+ parent.setSupportedLocales(locales);
+ }
+
+ /**
+ * @param resolver
+ * @deprecated
+ * @see javax.faces.application.Application#setVariableResolver(javax.faces.el.VariableResolver)
+ */
+ public void setVariableResolver(VariableResolver resolver) {
+ parent.setVariableResolver(resolver);
+ }
+
+ /**
+ * @param handler
+ * @see javax.faces.application.Application#setViewHandler(javax.faces.application.ViewHandler)
+ */
+ public void setViewHandler(ViewHandler handler) {
+ parent.setViewHandler(handler);
+ }
+
+}
Property changes on: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java (rev 0)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,76 @@
+/**
+ *
+ */
+package org.richfaces.ui.application;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateExpressionFactory extends ExpressionFactory {
+
+ ExpressionFactory defaultFactory;
+
+ /**
+ * @param defaultFactory
+ */
+ public StateExpressionFactory(ExpressionFactory defaultFactory) {
+ super();
+ this.defaultFactory = defaultFactory;
+ }
+
+ /**
+ * @param obj
+ * @param targetType
+ * @return
+ * @see javax.el.ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class)
+ */
+ public Object coerceToType(Object obj, Class<?> targetType) {
+ return defaultFactory.coerceToType(obj, targetType);
+ }
+
+ /**
+ * @param context
+ * @param expression
+ * @param expectedReturnType
+ * @param expectedParamTypes
+ * @return
+ * @see javax.el.ExpressionFactory#createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class<?>[])
+ */
+ public MethodExpression createMethodExpression(ELContext context,
+ String expression, Class<?> expectedReturnType,
+ Class<?>[] expectedParamTypes) {
+ return defaultFactory.createMethodExpression(context, expression,
+ expectedReturnType, expectedParamTypes);
+ }
+
+ /**
+ * @param context
+ * @param expression
+ * @param expectedType
+ * @return
+ * @see javax.el.ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
+ */
+ public ValueExpression createValueExpression(ELContext context,
+ String expression, Class<?> expectedType) {
+ return defaultFactory.createValueExpression(context, expression,
+ expectedType);
+ }
+
+ /**
+ * @param instance
+ * @param expectedType
+ * @return
+ * @see javax.el.ExpressionFactory#createValueExpression(java.lang.Object, java.lang.Class)
+ */
+ public ValueExpression createValueExpression(Object instance,
+ Class<?> expectedType) {
+ return defaultFactory.createValueExpression(instance, expectedType);
+ }
+
+}
Property changes on: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java (rev 0)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.richfaces.ui.application;
+
+import java.util.Map;
+
+import javax.faces.application.NavigationHandler;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.ui.model.States;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateNavigationHandler extends NavigationHandler {
+
+ private NavigationHandler parent;
+
+ /**
+ * @param parent
+ */
+ public StateNavigationHandler(NavigationHandler parent) {
+ super();
+ this.parent = parent;
+ }
+
+ /**
+ * @param context
+ * @param fromAction
+ * @param outcome
+ * @see javax.faces.application.NavigationHandler#handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
+ */
+ public void handleNavigation(FacesContext context, String fromAction,
+ String outcome) {
+ if(null != outcome){
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ for (Object bean : requestMap.values()) {
+ if (bean instanceof States) {
+ States state = (States) bean;
+ String navigation = state.getNavigation(outcome);
+ if(null != navigation){
+ state.setCurrentState(navigation);
+ }
+ }
+ }
+ }
+ parent.handleNavigation(context, fromAction, outcome);
+ }
+
+}
Property changes on: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/State.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/State.java 2008-05-16 19:23:08 UTC (rev 8626)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/State.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -3,18 +3,18 @@
*/
package org.richfaces.ui.model;
-import javax.faces.el.MethodBinding;
+import java.util.Map;
+import javax.el.MethodExpression;
+
/**
* @author asmirnov
*
*/
-public interface State {
+public interface State extends Map<String, Object>{
+
+ public String getNavigation(String outcome);
- public Object getProperty(String name);
+ public void setNavigation(String outcome, String navigation);
- public MethodBinding getAction(String name);
-
- public String getNavigation(String outcome);
-
}
Added: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java (rev 0)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,41 @@
+/**
+ *
+ */
+package org.richfaces.ui.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.MethodExpression;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateImpl extends HashMap<String, Object> implements State {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5521648998682443502L;
+
+ private Map<String,String>navigations = new HashMap<String, String>();
+
+
+
+ /* (non-Javadoc)
+ * @see org.richfaces.ui.model.State#getNavigation(java.lang.String)
+ */
+ public String getNavigation(String outcome) {
+ // TODO Auto-generated method stub
+ return navigations.get(outcome);
+ }
+
+
+ public void setNavigation(String outcome, String navigation) {
+ navigations.put(outcome, navigation);
+
+ }
+
+
+}
Property changes on: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/States.java
===================================================================
--- trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/States.java (rev 0)
+++ trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/States.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,134 @@
+/**
+ *
+ */
+package org.richfaces.ui.model;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.el.MethodExpression;
+
+import org.ajax4jsf.model.KeepAlive;
+
+/**
+ * @author asmirnov
+ *
+ */
+@KeepAlive
+public class States implements State {
+
+ private static final String DEFAULT_STATE = "DEFAULT";
+ private final Map<String, State> states;
+
+ private State currentState;
+
+ private String currentStateName;
+
+ public States() {
+ states = new HashMap<String, State>();
+ }
+
+ /**
+ * HACK - bean property setter for a initialisation from faces-config.xml.
+ * @param stateConfig
+ */
+ public void setConfig(String stateConfig){
+ // TODO - parse configuration.
+ }
+
+ /**
+ * Copy all states from an initial state configuration. Use to init state bean from faces-config.xml
+ * @param initial
+ */
+ public void setStates(States initial){
+ this.states.clear();
+ this.states.putAll(initial.states);
+ this.currentState = initial.currentState;
+ this.currentStateName = initial.currentStateName;
+ }
+
+ public void setCurrentState(String name) {
+ State state = states.get(name);
+ if (null == state) {
+ state = new StateImpl();
+ states.put(name, state);
+ }
+ currentStateName = name;
+ currentState = state;
+ }
+
+ public String getCurrentState(){
+ return currentStateName;
+ }
+
+ public void setState(String name, State state) {
+ states.put(name, state);
+ currentStateName = name;
+ currentState = state;
+ }
+
+ public void clear() {
+ currentState.clear();
+ }
+
+ public boolean containsKey(Object key) {
+ return currentState.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+ return currentState.containsValue(value);
+ }
+
+ public Set<Entry<String, Object>> entrySet() {
+ return currentState.entrySet();
+ }
+
+ public Object get(Object key) {
+ return currentState.get(key);
+ }
+
+ public String getNavigation(String outcome) {
+ return currentState.getNavigation(outcome);
+ }
+
+ /**
+ * @param outcome
+ * @param navigation
+ * @see org.richfaces.ui.model.State#setNavigation(java.lang.String, java.lang.String)
+ */
+ public void setNavigation(String outcome, String navigation) {
+ currentState.setNavigation(outcome, navigation);
+ }
+
+ public boolean isEmpty() {
+ return currentState.isEmpty();
+ }
+
+ public Set<String> keySet() {
+ return currentState.keySet();
+ }
+
+ public Object put(String key, Object value) {
+ return currentState.put(key, value);
+ }
+
+ public void putAll(Map<? extends String, ? extends Object> t) {
+ currentState.putAll(t);
+ }
+
+ public Object remove(Object key) {
+ return currentState.remove(key);
+ }
+
+ public int size() {
+ return currentState.size();
+ }
+
+ public Collection<Object> values() {
+ return currentState.values();
+ }
+
+}
Property changes on: trunk/sandbox/ui/state/src/main/java/org/richfaces/ui/model/States.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java (rev 0)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java 2008-05-16 21:04:44 UTC (rev 8627)
@@ -0,0 +1,25 @@
+/**
+ *
+ */
+package org.ajax4jsf.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class KeepAlive extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.ajax4jsf.KeepAlive";
+ public static final String COMPONENT_FAMILY = "org.ajax4jsf.KeepAlive";
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponent#getFamily()
+ */
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+}
Property changes on: trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 8 months
JBoss Rich Faces SVN: r8626 - in trunk/test-applications/seleniumTest/src: main/webapp/pages/orderingList and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-05-16 15:23:08 -0400 (Fri, 16 May 2008)
New Revision: 8626
Modified:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/orderingList/orderingListTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
Log:
Selenium tests for ordering list component.
Modified: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java 2008-05-16 17:13:48 UTC (rev 8625)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/OrderingListTestBean.java 2008-05-16 19:23:08 UTC (rev 8626)
@@ -24,10 +24,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -128,7 +125,35 @@
public void setName(String name) {
this.name = name;
}
+
+ public String toString() {
+ return this.getClass().getSimpleName() + " [" + name + "]";
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Item other = (Item) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+
+ return true;
+ }
}
-
+
}
Modified: trunk/test-applications/seleniumTest/src/main/webapp/pages/orderingList/orderingListTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/orderingList/orderingListTest.xhtml 2008-05-16 17:13:48 UTC (rev 8625)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/orderingList/orderingListTest.xhtml 2008-05-16 19:23:08 UTC (rev 8626)
@@ -30,19 +30,20 @@
<f:facet name="header">
<h:outputText value="Ajax Action" />
</f:facet>
- <a4j:commandButton value="Ajax Action" reRender="actionResult"
- action="#{orderingListBean.action}" id="#{item.name}_ajax" />
+ <a4j:commandButton value="Ajax Action" reRender="actionResult,messages"
+ action="#{item.action}" id="#{item.name}_ajax" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Server Action" />
</f:facet>
- <h:commandLink value="Server Action" action="#{orderingListBean.action}" id="#{item.name}_server" />
+ <h:commandLink value="Server Action" action="#{item.action}" id="#{item.name}_server" />
</h:column>
</rich:orderingList>
<br/>
<h:outputText value="#{orderingListBean.actionResult}" id="actionResult" />
+ <rich:messages id="messages" />
<br/>
</h:form>
</ui:define>
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-16 17:13:48 UTC (rev 8625)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/OrderingListTest.java 2008-05-16 19:23:08 UTC (rev 8626)
@@ -31,14 +31,30 @@
import org.testng.annotations.Test;
public class OrderingListTest extends SeleniumTestBase implements RichSeleniumTest {
+ private String firstButton;
+ private String firstButtonDisabled;
+ private String upButton;
+ private String upButtonDisabled;
+
+ private String downButton;
+ private String downButtonDisabled;
+
+ private String lastButton;
+ private String lastButtonDisabled;
+
+ private String firstRow;
+
+ private String actionResult;
+ private String ajax;
+ private String server;
+
public OrderingListTest() {
super("http", "localhost", "8080");
}
public OrderingListTest(String protocol, String host, String port) {
super(protocol, host, port);
- // TODO Auto-generated constructor stub
}
/**
@@ -66,14 +82,45 @@
private void _testOrderingListComponent(Templates template) {
renderPage(getTestUrl(), template);
+ initFields();
- String firstRowPrefix = getParentId() + "_form:orderingList:0:";
- String textId = firstRowPrefix + "output";
+ writeStatus("Check if all buttons are disabled first time");
+ checkButtons(true, true, true, true);
- checkButtons(true, true, true, true);
- clickById(textId);
+ writeStatus("Click on first row");
+ clickById(firstRow);
checkButtons(true, true, false, false);
+ writeStatus("Click on down button");
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+ clickById(downButton);
+ checkButtons(false, false, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 1);
+
+ writeStatus("Click on last button");
+ clickById(lastButton);
+ checkButtons(false, false, true, true);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 3);
+
+ writeStatus("Click on first button");
+ clickById(firstButton);
+ checkButtons(true, true, false, false);
+ Assert.assertEquals(selenium.getElementIndex("id=" + firstRow), 0);
+
+ writeStatus("Unselect element");
+ selenium.controlKeyDown();
+ clickById(firstRow);
+ selenium.controlKeyUp();
+ checkButtons(true, true, true, true);
+
+ writeStatus("Click on ajax button");
+ clickById(ajax);
+ waitForAjaxCompletion();
+ AssertTextEquals(actionResult, "item0");
+
+ writeStatus("Click on server link");
+ clickCommandAndWait(server);
+ AssertTextEquals(actionResult, "item1");
}
public String getTestUrl() {
@@ -81,19 +128,6 @@
}
private void checkButtons(boolean firstDisabled, boolean upDisabled, boolean downDisabled, boolean lastDisabled) {
- String parentId = getParentId() + "_form:orderingList";
- String firstButton = parentId + "first";
- String firstButtonDisabled = parentId + "disfirst";
-
- String upButton = parentId + "up";
- String upButtonDisabled = parentId + "disup";
-
- String downButton = parentId + "down";
- String downButtonDisabled = parentId + "disdown";
-
- String lastButton = parentId + "last";
- String lastButtonDisabled = parentId + "dislast";
-
if (firstDisabled) {
Assert.assertTrue(isVisibleById(firstButtonDisabled));
Assert.assertFalse(isVisibleById(firstButton));
@@ -126,4 +160,25 @@
Assert.assertTrue(isVisibleById(lastButton));
}
}
+
+ private void initFields() {
+ String parentId = getParentId() + "_form:orderingList";
+
+ firstButton = parentId + "first";
+ firstButtonDisabled = parentId + "disfirst";
+
+ upButton = parentId + "up";
+ upButtonDisabled = parentId + "disup";
+
+ downButton = parentId + "down";
+ downButtonDisabled = parentId + "disdown";
+
+ lastButton = parentId + "last";
+ lastButtonDisabled = parentId + "dislast";
+
+ firstRow = parentId + ":0";
+ actionResult = getParentId() + "_form:actionResult";
+ ajax = firstRow + ":_ajax";
+ server = parentId + ":1:_server";
+ }
}
16 years, 8 months
JBoss Rich Faces SVN: r8625 - in trunk/cdk: maven-archetype-plug-n-skin and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-05-16 13:13:48 -0400 (Fri, 16 May 2008)
New Revision: 8625
Added:
trunk/cdk/maven-archetype-plug-n-skin/
Removed:
trunk/cdk/maven-archetype-skin-addon/
Modified:
trunk/cdk/maven-archetype-plug-n-skin/pom.xml
trunk/cdk/maven-archetype-plug-n-skin/src/main/resources/META-INF/maven/archetype-metadata.xml
trunk/cdk/maven-archetype-plug-n-skin/src/main/resources/META-INF/maven/archetype.xml
trunk/cdk/pom.xml
Log:
http://jira.jboss.com/jira/browse/RF-3450: skin-addon has been renamed into plug-n-skin
Copied: trunk/cdk/maven-archetype-plug-n-skin (from rev 8624, trunk/cdk/maven-archetype-skin-addon)
Modified: trunk/cdk/maven-archetype-plug-n-skin/pom.xml
===================================================================
--- trunk/cdk/maven-archetype-skin-addon/pom.xml 2008-05-16 16:42:34 UTC (rev 8624)
+++ trunk/cdk/maven-archetype-plug-n-skin/pom.xml 2008-05-16 17:13:48 UTC (rev 8625)
@@ -6,9 +6,9 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-archetype-skin-addon</artifactId>
+ <artifactId>maven-archetype-plug-n-skin</artifactId>
<version>${parent.version}</version>
- <name>Archetype - maven-archetype-skin-addon</name>
+ <name>Archetype - maven-archetype-plug-n-skin</name>
</project>
\ No newline at end of file
Modified: trunk/cdk/maven-archetype-plug-n-skin/src/main/resources/META-INF/maven/archetype-metadata.xml
===================================================================
--- trunk/cdk/maven-archetype-skin-addon/src/main/resources/META-INF/maven/archetype-metadata.xml 2008-05-16 16:42:34 UTC (rev 8624)
+++ trunk/cdk/maven-archetype-plug-n-skin/src/main/resources/META-INF/maven/archetype-metadata.xml 2008-05-16 17:13:48 UTC (rev 8625)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<archetype-descriptor name="maven-archetype-skin-addon">
+<archetype-descriptor name="maven-archetype-plug-n-skin">
<fileSets>
<fileSet filtered="true" packaged="false">
<directory>src/main/java</directory>
Modified: trunk/cdk/maven-archetype-plug-n-skin/src/main/resources/META-INF/maven/archetype.xml
===================================================================
--- trunk/cdk/maven-archetype-skin-addon/src/main/resources/META-INF/maven/archetype.xml 2008-05-16 16:42:34 UTC (rev 8624)
+++ trunk/cdk/maven-archetype-plug-n-skin/src/main/resources/META-INF/maven/archetype.xml 2008-05-16 17:13:48 UTC (rev 8625)
@@ -1,5 +1,5 @@
<archetype>
- <id>maven-archetype-skin-addon</id>
+ <id>maven-archetype-plug-n-skin</id>
<resources>
<resource>src/test/java/README.txt</resource>
<resource>src/main/java/README.txt</resource>
Modified: trunk/cdk/pom.xml
===================================================================
--- trunk/cdk/pom.xml 2008-05-16 16:42:34 UTC (rev 8624)
+++ trunk/cdk/pom.xml 2008-05-16 17:13:48 UTC (rev 8625)
@@ -32,7 +32,7 @@
<module>maven-javascript-plugin</module>
<module>maven-archetype-jsf-component</module>
<module>maven-archetype-jsfwebapp</module>
- <module>maven-archetype-skin-addon</module>
+ <module>maven-archetype-plug-n-skin</module>
</modules>
16 years, 8 months
JBoss Rich Faces SVN: r8624 - in trunk/cdk: maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-05-16 12:42:34 -0400 (Fri, 16 May 2008)
New Revision: 8624
Removed:
trunk/cdk/maven-cdk-plugin/src/main/resources/skin/pom/
Modified:
trunk/cdk/maven-archetype-skin-addon/
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java
Log:
http://jira.jboss.com/jira/browse/RF-3094
Property changes on: trunk/cdk/maven-archetype-skin-addon
___________________________________________________________________
Name: svn:ignore
- target
.settings
.project
+ target
.settings
.project
.classpath
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java 2008-05-16 16:07:50 UTC (rev 8623)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java 2008-05-16 16:42:34 UTC (rev 8624)
@@ -50,7 +50,7 @@
private static final String SRC_MAIN_RESOURCES = "src/main/resources";
- private static final String PROPERTIES = ".properties";
+ private static final String PROPERTIES = ".skin.properties";
private static final String XCSS = ".xcss";
16 years, 8 months
JBoss Rich Faces SVN: r8623 - in trunk/test-applications/facelets/src/main/java: custom and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-05-16 12:07:50 -0400 (Fri, 16 May 2008)
New Revision: 8623
Added:
trunk/test-applications/facelets/src/main/java/custom/
trunk/test-applications/facelets/src/main/java/custom/Custom.java
trunk/test-applications/facelets/src/main/java/custom/CustomList.java
Log:
Added: trunk/test-applications/facelets/src/main/java/custom/Custom.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/custom/Custom.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/custom/Custom.java 2008-05-16 16:07:50 UTC (rev 8623)
@@ -0,0 +1,138 @@
+package custom;
+
+public class Custom {
+
+ private int index;
+ private boolean b0;
+ private boolean b1;
+ private boolean b2;
+ private String s0;
+ private String s1;
+ private String s2;
+ private int i0;
+ private int i1;
+ private int i2;
+
+ public Custom() {
+ this.index = 0;
+ this.b0 = true;
+ this.b1 = true;
+ this.b2 = true;
+ this.s0 = "s0";
+ this.s1 = "s1";
+ this.s2 = "s2";
+ this.i0 = 0;
+ this.i1 = 1;
+ this.i2 = 2;
+ }
+
+ public Custom(int index) {
+ this.index = index;
+ this.b0 = true;
+ this.b1 = true;
+ this.b2 = true;
+ this.s0 = "s0";
+ this.s1 = "s1";
+ this.s2 = "s2";
+ this.i0 = 0;
+ this.i1 = 1;
+ this.i2 = 2;
+ }
+
+ public Custom(int index, boolean b0, boolean b1, boolean b2, String s0, String s1,
+ String s2, int i0, int i1, int i2) {
+ this.index = index;
+ this.b0 = b0;
+ this.b1 = b1;
+ this.b2 = b2;
+ this.s0 = s0;
+ this.s1 = s1;
+ this.s2 = s2;
+ this.i0 = i0;
+ this.i1 = i1;
+ this.i2 = i2;
+ }
+
+
+
+ public boolean isB0() {
+ return b0;
+ }
+
+ public void setB0(boolean b0) {
+ this.b0 = b0;
+ }
+
+ public boolean isB1() {
+ return b1;
+ }
+
+ public void setB1(boolean b1) {
+ this.b1 = b1;
+ }
+
+ public boolean isB2() {
+ return b2;
+ }
+
+ public void setB2(boolean b2) {
+ this.b2 = b2;
+ }
+
+ public String getS0() {
+ return s0;
+ }
+
+ public void setS0(String s0) {
+ this.s0 = s0;
+ }
+
+ public String getS1() {
+ return s1;
+ }
+
+ public void setS1(String s1) {
+ this.s1 = s1;
+ }
+
+ public String getS2() {
+ return s2;
+ }
+
+ public void setS2(String s2) {
+ this.s2 = s2;
+ }
+
+ public int getI0() {
+ return i0;
+ }
+
+ public void setI0(int i0) {
+ this.i0 = i0;
+ }
+
+ public int getI1() {
+ return i1;
+ }
+
+ public void setI1(int i1) {
+ this.i1 = i1;
+ }
+
+ public int getI2() {
+ return i2;
+ }
+
+ public void setI2(int i2) {
+ this.i2 = i2;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+}
Added: trunk/test-applications/facelets/src/main/java/custom/CustomList.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/custom/CustomList.java (rev 0)
+++ trunk/test-applications/facelets/src/main/java/custom/CustomList.java 2008-05-16 16:07:50 UTC (rev 8623)
@@ -0,0 +1,41 @@
+package custom;
+
+import java.util.ArrayList;
+
+public class CustomList {
+ private ArrayList<Custom> customList;
+ private int listSize;
+
+ public CustomList() {
+ listSize = 12;
+ customList = new ArrayList<Custom>();
+
+ for(int i = 0; i < listSize; i++) {
+ customList.add(new Custom(i));
+ }
+ }
+
+ public void resizeList(int elements){
+ customList.clear();
+ for(int i = 0; i < elements; i++){
+ customList.add(new Custom(i));
+ }
+ }
+
+ public int getListSize() {
+ return listSize;
+ }
+
+ public void setListSize(int listSize) {
+ this.listSize = listSize;
+ }
+
+ public ArrayList<Custom> getCustomList() {
+ return customList;
+ }
+
+ public void setCustomList(ArrayList<Custom> testList) {
+ this.customList = testList;
+ }
+
+}
16 years, 8 months
JBoss Rich Faces SVN: r8622 - trunk/test-applications/facelets/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-05-16 12:07:22 -0400 (Fri, 16 May 2008)
New Revision: 8622
Added:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Custom.xml
Modified:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
Log:
Added: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Custom.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Custom.xml (rev 0)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-Custom.xml 2008-05-16 16:07:22 UTC (rev 8622)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>custom</managed-bean-name>
+ <managed-bean-class>custom.Custom</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>customList</managed-bean-name>
+ <managed-bean-class>custom.CustomList</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-05-16 16:06:47 UTC (rev 8621)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/web.xml 2008-05-16 16:07:22 UTC (rev 8622)
@@ -41,7 +41,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml</param-value>
+ <param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
16 years, 8 months
JBoss Rich Faces SVN: r8621 - trunk/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-05-16 12:06:47 -0400 (Fri, 16 May 2008)
New Revision: 8621
Added:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Custom.xml
Modified:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
Added: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Custom.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Custom.xml (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Custom.xml 2008-05-16 16:06:47 UTC (rev 8621)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>custom</managed-bean-name>
+ <managed-bean-class>custom.Custom</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>customList</managed-bean-name>
+ <managed-bean-class>custom.CustomList</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-05-16 16:01:37 UTC (rev 8620)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-05-16 16:06:47 UTC (rev 8621)
@@ -20,7 +20,7 @@
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml</param-value>
+ <param-value>/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,/WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,/WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,/WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,/WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,/WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,/WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,/WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,/WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,/WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,!
/WEB-INF/faces-config-Insert.xml,/WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,/WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml,/WEB-INF/faces-config-ContextMenu.xml,/WEB-INF/faces-config-ListShuttle.xml,/WEB-INF/faces-config-Converter.xml,/WEB-INF/faces-config-ComponentControl.xml,/WEB-INF/faces-config-Columns.xml,/WEB-INF/faces-config-PickList.xml,/WEB-INF/faces-config-Combobox.xml,/WEB-INF/faces-config-PTComponent.xml,/WEB-INF/faces-config-Event.xml,/WEB-INF/faces-config-ProgressBar.xml,/WEB-INF/faces-config-Options.xml,/WEB-INF/faces-config-SortingAndFiltering.xml,/WEB-INF/faces-config-Style.xml,/WEB-INF/faces-config-FileUpload.xml,/WEB-INF/faces-config-InplaceSelect.xml,/WEB-INF/faces-config-InplaceInput.xml,/WEB-INF/faces-config-Skinning.xml,/WEB-INF/faces-config-Custom.xml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
16 years, 8 months
JBoss Rich Faces SVN: r8620 - in trunk/test-applications/jsp/src/main/java: custom and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-05-16 12:01:37 -0400 (Fri, 16 May 2008)
New Revision: 8620
Added:
trunk/test-applications/jsp/src/main/java/custom/
trunk/test-applications/jsp/src/main/java/custom/Custom.java
trunk/test-applications/jsp/src/main/java/custom/CustomList.java
Log:
Added: trunk/test-applications/jsp/src/main/java/custom/Custom.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/custom/Custom.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/custom/Custom.java 2008-05-16 16:01:37 UTC (rev 8620)
@@ -0,0 +1,138 @@
+package custom;
+
+public class Custom {
+
+ private int index;
+ private boolean b0;
+ private boolean b1;
+ private boolean b2;
+ private String s0;
+ private String s1;
+ private String s2;
+ private int i0;
+ private int i1;
+ private int i2;
+
+ public Custom() {
+ this.index = 0;
+ this.b0 = true;
+ this.b1 = true;
+ this.b2 = true;
+ this.s0 = "s0";
+ this.s1 = "s1";
+ this.s2 = "s2";
+ this.i0 = 0;
+ this.i1 = 1;
+ this.i2 = 2;
+ }
+
+ public Custom(int index) {
+ this.index = index;
+ this.b0 = true;
+ this.b1 = true;
+ this.b2 = true;
+ this.s0 = "s0";
+ this.s1 = "s1";
+ this.s2 = "s2";
+ this.i0 = 0;
+ this.i1 = 1;
+ this.i2 = 2;
+ }
+
+ public Custom(int index, boolean b0, boolean b1, boolean b2, String s0, String s1,
+ String s2, int i0, int i1, int i2) {
+ this.index = index;
+ this.b0 = b0;
+ this.b1 = b1;
+ this.b2 = b2;
+ this.s0 = s0;
+ this.s1 = s1;
+ this.s2 = s2;
+ this.i0 = i0;
+ this.i1 = i1;
+ this.i2 = i2;
+ }
+
+
+
+ public boolean isB0() {
+ return b0;
+ }
+
+ public void setB0(boolean b0) {
+ this.b0 = b0;
+ }
+
+ public boolean isB1() {
+ return b1;
+ }
+
+ public void setB1(boolean b1) {
+ this.b1 = b1;
+ }
+
+ public boolean isB2() {
+ return b2;
+ }
+
+ public void setB2(boolean b2) {
+ this.b2 = b2;
+ }
+
+ public String getS0() {
+ return s0;
+ }
+
+ public void setS0(String s0) {
+ this.s0 = s0;
+ }
+
+ public String getS1() {
+ return s1;
+ }
+
+ public void setS1(String s1) {
+ this.s1 = s1;
+ }
+
+ public String getS2() {
+ return s2;
+ }
+
+ public void setS2(String s2) {
+ this.s2 = s2;
+ }
+
+ public int getI0() {
+ return i0;
+ }
+
+ public void setI0(int i0) {
+ this.i0 = i0;
+ }
+
+ public int getI1() {
+ return i1;
+ }
+
+ public void setI1(int i1) {
+ this.i1 = i1;
+ }
+
+ public int getI2() {
+ return i2;
+ }
+
+ public void setI2(int i2) {
+ this.i2 = i2;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+}
Added: trunk/test-applications/jsp/src/main/java/custom/CustomList.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/custom/CustomList.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/custom/CustomList.java 2008-05-16 16:01:37 UTC (rev 8620)
@@ -0,0 +1,41 @@
+package custom;
+
+import java.util.ArrayList;
+
+public class CustomList {
+ private ArrayList<Custom> customList;
+ private int listSize;
+
+ public CustomList() {
+ listSize = 12;
+ customList = new ArrayList<Custom>();
+
+ for(int i = 0; i < listSize; i++) {
+ customList.add(new Custom(i));
+ }
+ }
+
+ public void resizeList(int elements){
+ customList.clear();
+ for(int i = 0; i < elements; i++){
+ customList.add(new Custom(i));
+ }
+ }
+
+ public int getListSize() {
+ return listSize;
+ }
+
+ public void setListSize(int listSize) {
+ this.listSize = listSize;
+ }
+
+ public ArrayList<Custom> getCustomList() {
+ return customList;
+ }
+
+ public void setCustomList(ArrayList<Custom> testList) {
+ this.customList = testList;
+ }
+
+}
16 years, 8 months
JBoss Rich Faces SVN: r8619 - in trunk/test-applications/seleniumTest/src: main/webapp/WEB-INF and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-05-16 11:48:06 -0400 (Fri, 16 May 2008)
New Revision: 8619
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceSelect/
trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceSelect/inplaceSelectTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
Log:
InplaceSelect component test
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java 2008-05-16 15:48:06 UTC (rev 8619)
@@ -0,0 +1,51 @@
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class InplaceSelectTestBean {
+
+ private List<SelectItem> treeItems = new ArrayList<SelectItem>();
+
+ private List<String> treeNames = Arrays.asList("Pine", "Birch", "Aspen", "Spruce", "Oak", "Maple", "Ash", "Lime");
+
+ private String tree = "";
+
+ /**
+ * Gets value of tree field.
+ *
+ * @return value of tree field
+ */
+ public String getTree() {
+ return tree;
+ }
+
+ /**
+ * Set a new value for tree field.
+ *
+ * @param tree
+ * a new value for tree field
+ */
+ public void setTree(String tree) {
+ this.tree = tree;
+ }
+
+ public InplaceSelectTestBean() {
+ for (String treeName : treeNames) {
+ treeItems.add(new SelectItem(treeName, treeName));
+ }
+ }
+
+ /**
+ * Gets value of treeItems field.
+ *
+ * @return value of treeItems field
+ */
+ public List<SelectItem> getTreeItems() {
+ return treeItems;
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/InplaceSelectTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-16 15:35:48 UTC (rev 8618)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-16 15:48:06 UTC (rev 8619)
@@ -91,6 +91,11 @@
<managed-bean-name>pickListBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.PickListTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>inplaceSelectBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.InplaceSelectTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>orderingListBean</managed-bean-name>
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceSelect/inplaceSelectTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/pages/inplaceSelect/inplaceSelectTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java 2008-05-16 15:48:06 UTC (rev 8619)
@@ -0,0 +1,115 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class InplaceSelectTest extends SeleniumTestBase {
+
+ public InplaceSelectTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testInplaceSelectComponent() throws Exception {
+ _testInplaceSelectComponent(Templates.SIMPLE);
+ _testInplaceSelectComponent(Templates.DATATABLE);
+ }
+
+ private void _testInplaceSelectComponent(Templates template) {
+ renderPage("/faces/pages/inplaceSelect/inplaceSelectTest.xhtml", template);
+
+ String parentId = getParentId() + "_form:";
+ String inplaceSelectId = parentId + "inplaceSelect";
+ String okButton = parentId + "inplaceSelect" + "ok";
+ //String inplaceTmpValueElemId = parentId + "inplaceSelect" + "inplaceTmpValue";
+ String cancelButton = parentId + "inplaceSelect" + "cancel";
+ String popupId = "list" + inplaceSelectId;
+
+ writeStatus("click the component");
+
+ clickById(inplaceSelectId);
+ Assert.assertFalse(isVisibleById(popupId), "Component pop-up should not show up on solitary click");
+
+ writeStatus("double click the component");
+
+ selenium.doubleClick(inplaceSelectId);
+ Assert.assertTrue(isVisibleById(popupId), "Component pop-up should show up on double click");
+
+ writeStatus("Check that controls buttons are present");
+
+ Assert.assertTrue(isPresentById(okButton));
+ Assert.assertTrue(isPresentById(cancelButton));
+
+ writeStatus("Select second element"); //Birch
+
+ selenium.mouseMove("dom=selenium.browserbot.getCurrentWindow().$('list" + inplaceSelectId
+ + "').down('span', 1)");
+ selenium.fireEvent(okButton, "mousedown");
+
+ writeStatus("Check that a new element is selected");
+
+ Assert.assertEquals(getValue(inplaceSelectId), "Birch");
+
+ writeStatus("Select another element"); // Aspen
+
+ selenium.doubleClick(inplaceSelectId);
+ selenium.mouseMove("dom=selenium.browserbot.getCurrentWindow().$('list" + inplaceSelectId
+ + "').down('span', 2)");
+ selenium.fireEvent(cancelButton, "mousedown");
+
+ writeStatus("Cancel selected value.");
+ Assert.assertEquals(getValue(inplaceSelectId), "Birch", "A value has not to be changed");
+
+ writeStatus("Verify javascript event triggering");
+
+ runScript("theLatestEvent='undefined'");
+
+ writeStatus("Double click the component");
+ selenium.doubleClick(inplaceSelectId);
+
+ Assert.assertEquals(runScript("theLatestEvent"), "editactivated", "editactivated event has not been triggered");
+
+ writeStatus("Stop editing with ok");
+ selenium.fireEvent(okButton, "mousedown");
+ Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
+
+// viewactivated event is not fired ... almost sure bug
+// writeStatus("Stop editing with cancel");
+// selenium.fireEvent(cancelButton, "mousedown");
+// Assert.assertEquals(runScript("theLatestEvent"), "viewactivated", "viewactivated event has not been triggered");
+
+ }
+
+ /**
+ * Gets component value.
+ * Note: JavaScript component API getValue() doesn't exit
+ * @param clientId
+ * @return
+ */
+ private String getValue(String clientId) {
+ return runScript("$('" + clientId + "inplaceValue').value;");
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/InplaceSelectTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 8 months