JBoss Rich Faces SVN: r17136 - root/build/resources/trunk/checkstyle/src/main/resources/richfaces-checkstyle.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-19 15:35:17 -0400 (Wed, 19 May 2010)
New Revision: 17136
Removed:
root/build/resources/trunk/checkstyle/src/main/resources/richfaces-checkstyle/exadel-checks.xml
Log:
Removed unsed checkstyle file
Deleted: root/build/resources/trunk/checkstyle/src/main/resources/richfaces-checkstyle/exadel-checks.xml
===================================================================
--- root/build/resources/trunk/checkstyle/src/main/resources/richfaces-checkstyle/exadel-checks.xml 2010-05-19 17:49:04 UTC (rev 17135)
+++ root/build/resources/trunk/checkstyle/src/main/resources/richfaces-checkstyle/exadel-checks.xml 2010-05-19 19:35:17 UTC (rev 17136)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- This configuration file was written by the eclipse-cs plugin configuration editor
--->
-<!--
- Checkstyle-Configuration: Exadel Checks
- Description: none
--->
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-<module name="Checker">
- <property name="severity" value="warning"/>
- <module name="TreeWalker">
- <module name="JavadocMethod">
- <property name="scope" value="public"/>
- </module>
- <module name="JavadocType"/>
- <module name="JavadocVariable">
- <property name="scope" value="public"/>
- </module>
- <module name="JavadocStyle">
- <property name="checkEmptyJavadoc" value="true"/>
- <property name="checkFirstSentence" value="false"/>
- </module>
- <module name="ConstantName"/>
- <module name="LocalFinalVariableName"/>
- <module name="LocalVariableName"/>
- <module name="MemberName"/>
- <module name="MethodName"/>
- <module name="PackageName"/>
- <module name="StaticVariableName"/>
- <module name="TypeName"/>
- <module name="AvoidStarImport"/>
- <module name="IllegalImport"/>
- <module name="RedundantImport"/>
- <module name="UnusedImports"/>
- <module name="FileLength"/>
- <module name="EmptyForIteratorPad"/>
- <module name="MethodParamPad"/>
- <module name="NoWhitespaceAfter"/>
- <module name="NoWhitespaceBefore"/>
- <module name="OperatorWrap"/>
- <module name="ParenPad"/>
- <module name="TypecastParenPad">
- <property name="tokens" value="RPAREN,TYPECAST"/>
- </module>
- <module name="WhitespaceAfter"/>
- <module name="WhitespaceAround">
- <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND"/>
- </module>
- <module name="ModifierOrder"/>
- <module name="RedundantModifier"/>
- <module name="AvoidNestedBlocks"/>
- <module name="EmptyBlock"/>
- <module name="LeftCurly">
- <property name="maxLineLength" value="1000"/>
- </module>
- <module name="NeedBraces"/>
- <module name="RightCurly"/>
- <module name="EmptyStatement"/>
- <module name="InnerAssignment"/>
- <module name="MagicNumber">
- <property name="ignoreNumbers" value="-1, 0, 1"/>
- </module>
- <module name="MissingSwitchDefault"/>
- <module name="RedundantThrows"/>
- <module name="SimplifyBooleanExpression"/>
- <module name="SimplifyBooleanReturn"/>
- <module name="InterfaceIsType"/>
- <module name="VisibilityModifier">
- <property name="packageAllowed" value="true"/>
- <property name="protectedAllowed" value="true"/>
- </module>
- <module name="ArrayTypeStyle"/>
- <module name="UpperEll"/>
- <module name="ParameterName"/>
- <module name="DeclarationOrder"/>
- <module name="FallThrough"/>
- <module name="HiddenField">
- <property name="tokens" value="VARIABLE_DEF"/>
- </module>
- <module name="MultipleVariableDeclarations"/>
- <module name="Indentation">
- <property name="caseIndent" value="0"/>
- </module>
- </module>
-</module>
\ No newline at end of file
15 years, 7 months
JBoss Rich Faces SVN: r17135 - in root/ui-sandbox/componentcontrol/trunk: ui and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-19 13:49:04 -0400 (Wed, 19 May 2010)
New Revision: 17135
Modified:
root/ui-sandbox/componentcontrol/trunk/bom/pom.xml
root/ui-sandbox/componentcontrol/trunk/ui/pom.xml
Log:
Updated because ui-core artifactId change
Modified: root/ui-sandbox/componentcontrol/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/bom/pom.xml 2010-05-19 17:41:32 UTC (rev 17134)
+++ root/ui-sandbox/componentcontrol/trunk/bom/pom.xml 2010-05-19 17:49:04 UTC (rev 17135)
@@ -52,7 +52,7 @@
<dependency>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-api</artifactId>
+ <artifactId>richfaces-ui-core-api</artifactId>
<version>${richfaces.core.api.version}</version>
</dependency>
<dependency>
Modified: root/ui-sandbox/componentcontrol/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/ui/pom.xml 2010-05-19 17:41:32 UTC (rev 17134)
+++ root/ui-sandbox/componentcontrol/trunk/ui/pom.xml 2010-05-19 17:49:04 UTC (rev 17135)
@@ -38,7 +38,7 @@
<dependencies>
<dependency>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-api</artifactId>
+ <artifactId>richfaces-ui-core-api</artifactId>
</dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
15 years, 7 months
JBoss Rich Faces SVN: r17134 - in root/ui/core/trunk: api and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-19 13:41:32 -0400 (Wed, 19 May 2010)
New Revision: 17134
Modified:
root/ui/core/trunk/api/pom.xml
root/ui/core/trunk/bom/pom.xml
root/ui/core/trunk/parent/pom.xml
root/ui/core/trunk/pom.xml
Log:
Updated ui core artifact ids to richfaces-ui-core-*
Modified: root/ui/core/trunk/api/pom.xml
===================================================================
--- root/ui/core/trunk/api/pom.xml 2010-05-19 17:09:54 UTC (rev 17133)
+++ root/ui/core/trunk/api/pom.xml 2010-05-19 17:41:32 UTC (rev 17134)
@@ -22,13 +22,13 @@
<parent>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-parent</artifactId>
+ <artifactId>richfaces-ui-core-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-api</artifactId>
+ <artifactId>richfaces-ui-core-api</artifactId>
<name>Richfaces UI Components: Core API</name>
<packaging>jar</packaging>
Modified: root/ui/core/trunk/bom/pom.xml
===================================================================
--- root/ui/core/trunk/bom/pom.xml 2010-05-19 17:09:54 UTC (rev 17133)
+++ root/ui/core/trunk/bom/pom.xml 2010-05-19 17:41:32 UTC (rev 17134)
@@ -31,7 +31,7 @@
</parent>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-bom</artifactId>
+ <artifactId>richfaces-ui-core-bom</artifactId>
<version>4.0.0-SNAPSHOT</version>
<name>Richfaces UI Components: Core BOM</name>
<packaging>pom</packaging>
@@ -52,7 +52,7 @@
<dependency>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-api</artifactId>
+ <artifactId>richfaces-ui-core-api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Modified: root/ui/core/trunk/parent/pom.xml
===================================================================
--- root/ui/core/trunk/parent/pom.xml 2010-05-19 17:09:54 UTC (rev 17133)
+++ root/ui/core/trunk/parent/pom.xml 2010-05-19 17:41:32 UTC (rev 17134)
@@ -31,7 +31,7 @@
</parent>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-parent</artifactId>
+ <artifactId>richfaces-ui-core-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<name>Richfaces UI Components: Core Parent</name>
<packaging>pom</packaging>
@@ -40,7 +40,7 @@
<dependencies>
<dependency>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-bom</artifactId>
+ <artifactId>richfaces-ui-core-bom</artifactId>
<version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
Modified: root/ui/core/trunk/pom.xml
===================================================================
--- root/ui/core/trunk/pom.xml 2010-05-19 17:09:54 UTC (rev 17133)
+++ root/ui/core/trunk/pom.xml 2010-05-19 17:41:32 UTC (rev 17134)
@@ -31,7 +31,7 @@
</parent>
<groupId>org.richfaces.ui</groupId>
- <artifactId>core-aggregator</artifactId>
+ <artifactId>richfaces-ui-core-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Core Aggregator</name>
15 years, 7 months
JBoss Rich Faces SVN: r17133 - in root/examples-sandbox/trunk/components/tables/src/main: webapp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-19 13:09:54 -0400 (Wed, 19 May 2010)
New Revision: 17133
Added:
root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/SkinBean.java
root/examples-sandbox/trunk/components/tables/src/main/webapp/dataTable.xhtml
root/examples-sandbox/trunk/components/tables/src/main/webapp/index.xhtml
Removed:
root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
Modified:
root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml
root/examples-sandbox/trunk/components/tables/src/main/webapp/index.jsp
Log:
Added: root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/SkinBean.java
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/SkinBean.java (rev 0)
+++ root/examples-sandbox/trunk/components/tables/src/main/java/org/richfaces/demo/SkinBean.java 2010-05-19 17:09:54 UTC (rev 17133)
@@ -0,0 +1,18 @@
+package org.richfaces.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean(name = "skinBean")
+@SessionScoped
+public class SkinBean {
+ private String skin = "classic";
+
+ public String getSkin() {
+ return skin;
+ }
+
+ public void setSkin(String skin) {
+ this.skin = skin;
+ }
+}
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml 2010-05-19 16:46:24 UTC (rev 17132)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml 2010-05-19 17:09:54 UTC (rev 17133)
@@ -1,110 +1,108 @@
<?xml version='1.0' encoding='UTF-8'?>
-<!--
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ <!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright
+ 1997-2007 Sun Microsystems, Inc. All rights reserved. The contents of
+ this file are subject to the terms of either the GNU General Public
+ License Version 2 only ("GPL") or the Common Development and
+ Distribution License("CDDL") (collectively, the "License"). You may
+ not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL.html or
+ glassfish/bootstrap/legal/LICENSE.txt. See the License for the
+ specific language governing permissions and limitations under the
+ License. When distributing the software, include this License Header
+ Notice in each file and include the License file at
+ glassfish/bootstrap/legal/LICENSE.txt. Sun designates this particular
+ file as subject to the "Classpath" exception as provided by Sun in the
+ GPL Version 2 section of the License file that accompanied this code.
+ If applicable, add the following below the License Header, with the
+ fields enclosed by brackets [] replaced by your own identifying
+ information: "Portions Copyrighted [year] [name of copyright owner]"
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ Contributor(s): If you wish your version of this file to be governed
+ by only the CDDL or only the GPL Version 2, indicate your decision by
+ adding "[Contributor] elects to include this software in this
+ distribution under the [CDDL or GPL Version 2] license." If you don't
+ indicate a single choice of license, a recipient has the option to
+ distribute your version of this file under either the CDDL, the GPL
+ Version 2 or to extend the choice of license to its licensees as
+ provided above. However, if you add GPL Version 2 code and therefore,
+ elected the GPL Version 2 license, then the option applies only if the
+ new code is made subject to such option by the copyright holder.
+ -->
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can obtain
- a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
+<web-app version="2.5" 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-app_2_5.xsd">
- When distributing the software, include this License Header Notice in each
- file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- Sun designates this particular file as subject to the "Classpath" exception
- as provided by Sun in the GPL Version 2 section of the License file that
- accompanied this code. If applicable, add the following below the License
- Header, with the fields enclosed by brackets [] replaced by your own
- identifying information: "Portions Copyrighted [year]
- [name of copyright owner]"
+ <display-name></display-name>
+ <description></description>
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
- Contributor(s):
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
--->
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING</param-name>
+ <param-value>enable</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
+ <param-value>enable</param-value>
+ </context-param>
-<web-app version="2.5"
- 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-app_2_5.xsd">
- <display-name></display-name>
- <description></description>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
<context-param>
- <param-name>org.richfaces.SKIN</param-name>
- <param-value>blueSky</param-value>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
</context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
- <context-param>
- <param-name>org.richfaces.CONTROL_SKINNING</param-name>
- <param-value>enable</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
- <param-value>enable</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>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
+ <context-param>
+ <description>
Set this flag to true if you want the JavaServer Faces
Reference Implementation to validate the XML in your
faces-config.xml resources against the DTD. Default
value is false.
</description>
- <param-name>com.sun.faces.validateXml</param-name>
- <param-value>true</param-value>
- </context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
- <!-- Faces Servlet -->
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
- <!-- Faces Servlet Mapping -->
- <!--
+ <!-- Faces Servlet Mapping -->
+ <!--
- This mapping identifies a jsp page as having JSF content. If a
- request comes to the server for foo.faces, the container will
- send the request to the FacesServlet, which will expect a
- corresponding foo.jsp page to exist containing the content.
+ This mapping identifies a jsp page as having JSF content. If a request
+ comes to the server for foo.faces, the container will send the request
+ to the FacesServlet, which will expect a corresponding foo.jsp page to
+ exist containing the content.
+ -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
- -->
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
-
</web-app>
Added: root/examples-sandbox/trunk/components/tables/src/main/webapp/dataTable.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/dataTable.xhtml (rev 0)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/dataTable.xhtml 2010-05-19 17:09:54 UTC (rev 17133)
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:ds="http://richfaces.org/datascroller"
+ xmlns:cc="http://richfaces.org/componentControl">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces Tables</title>
+</h:head>
+
+<h:body>
+ <h:form id="form1">
+ <ds:dataScroller id="scroller1" for="richTable"
+ page="#{dataBean.page}" maxPages="7"></ds:dataScroller>
+
+ <rich:dataTable keepSaved="true" id="richTable" var="record"
+ rowKeyVar="rowKey" value="#{dataBean.employeeList}" rows="20"
+ sortMode="single">
+ <f:facet name="caption">
+ <h:outputText id="captioFacet1" value="Caption Facet" />
+ </f:facet>
+ <f:facet name="header">
+ <h:outputText value="header facet" />
+ </f:facet>
+ <rich:column id="column_name" sortBy="#{record.name}"
+ sortIconAsc="resources/images/asc.gif"
+ sortIconDesc="resources/images/desc.gif"
+ sortIconUnsort="resources/images/unsort.gif">
+ <f:facet name="header">
+ <h:outputText id="columnHeader1" value="Column Header Facet" />
+ </f:facet>
+
+ <rich:toggleControl for="expandedSubTable"
+ expandControl="resources/images/+.gif"
+ collapseControl="resources/images/-.gif">
+
+ </rich:toggleControl>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooter1" value="Column Footer Facet 1" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="column_title" sortBy="#{record.title}"
+ sortIconAsc="resources/images/asc.gif"
+ sortIconDesc="resources/images/desc.gif"
+ sortIconUnsort="resources/images/unsort.gif">
+ <f:facet name="header">
+ <h:outputText id="columnHeader2" value="Column Header Facet 2" />
+ </f:facet>
+ <h:outputText value="#{record.title}" />
+ </rich:column>
+
+ <rich:column id="column_email">
+ <h:outputText value="#{record.EMail}" />
+ </rich:column>
+
+ <rich:subTable id="expandedSubTable" var="company"
+ value="#{record.companies}" rows="1" switchType="ajax"
+ expanded="true">
+ <f:facet name="header">
+ <ds:dataScroller id="subscroller" for="expandedSubTable"
+ maxPages="3"></ds:dataScroller>
+ </f:facet>
+
+ <f:facet name="footer">
+ <h:outputText value="footer" />
+ </f:facet>
+
+ <rich:column id="column_company_name">
+ <h:outputText value="#{company.name}" />
+ </rich:column>
+
+ <rich:column id="column_company_state">
+ <h:outputText value="#{company.state}" />
+ </rich:column>
+
+ <rich:column id="column_company_phone">
+ <h:outputText value="#{company.phone}" />
+ </rich:column>
+ </rich:subTable>
+
+ <f:facet name="footer">
+ <ds:dataScroller id="scroller3" for="richTable"
+ page="#{dataBean.page}" maxPages="7"></ds:dataScroller>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <br />
+
+ <!-- cc:componentControl event="click" target="#{dataBean.target}" operation="#{dataBean.operation}">
+ <f:param name="event" value="event"/>
+ <cc:hashParam>
+ <f:param name="key1" value="value1"/>
+ <f:param name="key2" value="value2"/>
+ <f:param name="key3" value="value3"/>
+ <cc:hashParam name="nested1">
+ <f:param name="key11" value="value11"/>
+ </cc:hashParam>
+ </cc:hashParam>
+ <cc:hashParameter name="hashkey1">
+ <f:param name="keyhash1" value="value1"/>
+ <f:param name="keyhash2" value="value2"/>
+ </cc:hashParameter>
+ <h:commandButton value="richfaces1"/>
+ <h:commandButton value="richfaces2"/>
+ </cc:componentControl -->
+
+
+ <h:commandButton value="next">
+ <cc:componentControl event="click" target="form1:scroller1"
+ operation="switchToPage">
+ <f:param value="fastforward" />
+ </cc:componentControl>
+ </h:commandButton>
+
+ <h:commandButton value="previous">
+ <cc:componentControl event="click" target="form1:scroller1"
+ operation="previous" />
+ </h:commandButton>
+
+ <h:commandButton value="sort">
+ <cc:componentControl event="click" target="form1:richTable"
+ operation="sort">
+ <f:param value="column_title" />
+ </cc:componentControl>
+ </h:commandButton>
+
+ <h:commandButton value="unsort">
+ <cc:componentControl event="click" target="form1:richTable"
+ operation="sort">
+ </cc:componentControl>
+ </h:commandButton>
+
+ </h:form>
+</h:body>
+</html>
Deleted: root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2010-05-19 16:46:24 UTC (rev 17132)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2010-05-19 17:09:54 UTC (rev 17133)
@@ -1,126 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:ds="http://richfaces.org/datascroller"
- xmlns:cc="http://richfaces.org/componentControl"
-
- >
- <f:view contentType="text/html"/>
-
- <h:head>
- <title>Richfaces Tables</title>
- </h:head>
-
- <h:body>
- <h:form id="form1">
- <ds:dataScroller id="scroller1" for="richTable" page="#{dataBean.page}" maxPages="7"></ds:dataScroller >
-
- <rich:dataTable keepSaved="true" id="richTable" var="record" rowKeyVar="rowKey" value="#{dataBean.employeeList}" rows="20" sortMode="single">
- <f:facet name="caption">
- <h:outputText id="captioFacet1" value="Caption Facet" />
- </f:facet>
- <f:facet name="header">
- <h:outputText value="header facet"/>
- </f:facet>
- <rich:column id="column_name" sortBy="#{record.name}" sortIconAsc="resources/images/asc.gif" sortIconDesc="resources/images/desc.gif" sortIconUnsort="resources/images/unsort.gif">
- <f:facet name="header">
- <h:outputText id="columnHeader1" value="Column Header Facet"/>
- </f:facet>
-
- <rich:toggleControl for="expandedSubTable" expandControl="resources/images/+.gif" collapseControl="resources/images/-.gif">
-
- </rich:toggleControl>
-
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooter1" value="Column Footer Facet 1"/>
- </f:facet>
- </rich:column>
-
- <rich:column id="column_title" sortBy="#{record.title}" sortIconAsc="resources/images/asc.gif" sortIconDesc="resources/images/desc.gif" sortIconUnsort="resources/images/unsort.gif">
- <f:facet name="header">
- <h:outputText id="columnHeader2" value="Column Header Facet 2"/>
- </f:facet>
- <h:outputText value="#{record.title}" />
- </rich:column>
-
- <rich:column id="column_email">
- <h:outputText value="#{record.EMail}" />
- </rich:column>
-
- <rich:subTable id="expandedSubTable" var="company" value="#{record.companies}" rows="1" switchType="ajax" expanded="true">
- <f:facet name="header">
- <ds:dataScroller id="subscroller" for="expandedSubTable" maxPages="3"></ds:dataScroller >
- </f:facet>
-
- <f:facet name="footer">
- <h:outputText value="footer"/>
- </f:facet>
-
- <rich:column id="column_company_name">
- <h:outputText value="#{company.name}" />
- </rich:column>
-
- <rich:column id="column_company_state">
- <h:outputText value="#{company.state}" />
- </rich:column>
-
- <rich:column id="column_company_phone">
- <h:outputText value="#{company.phone}" />
- </rich:column>
- </rich:subTable>
-
- <f:facet name="footer">
- <ds:dataScroller id="scroller3" for="richTable" page="#{dataBean.page}" maxPages="7"></ds:dataScroller >
- </f:facet>
-
- </rich:dataTable>
-
- <br/>
-
- <!-- cc:componentControl event="click" target="#{dataBean.target}" operation="#{dataBean.operation}">
- <f:param name="event" value="event"/>
- <cc:hashParam>
- <f:param name="key1" value="value1"/>
- <f:param name="key2" value="value2"/>
- <f:param name="key3" value="value3"/>
- <cc:hashParam name="nested1">
- <f:param name="key11" value="value11"/>
- </cc:hashParam>
- </cc:hashParam>
- <cc:hashParameter name="hashkey1">
- <f:param name="keyhash1" value="value1"/>
- <f:param name="keyhash2" value="value2"/>
- </cc:hashParameter>
- <h:commandButton value="richfaces1"/>
- <h:commandButton value="richfaces2"/>
- </cc:componentControl -->
-
-
- <h:commandButton value="next">
- <cc:componentControl event="click" target="form1:scroller1" operation="switchToPage">
- <f:param value="fastforward"/>
- </cc:componentControl>
- </h:commandButton>
-
- <h:commandButton value="previous">
- <cc:componentControl event="click" target="form1:scroller1" operation="previous"/>
- </h:commandButton>
-
- <h:commandButton value="sort">
- <cc:componentControl event="click" target="form1:richTable" operation="sort">
- <f:param value="column_title"/>
- </cc:componentControl>
- </h:commandButton>
-
- <h:commandButton value="unsort">
- <cc:componentControl event="click" target="form1:richTable" operation="sort">
- </cc:componentControl>
- </h:commandButton>
-
- </h:form>
- </h:body>
-</html>
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/index.jsp
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/index.jsp 2010-05-19 16:46:24 UTC (rev 17132)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/index.jsp 2010-05-19 17:09:54 UTC (rev 17133)
@@ -1,5 +1,4 @@
<html>
<body>
-<h2>Hello World!</h2>
-</body>
+ <jsp:forward page="index.jsf" /></body>
</html>
Added: root/examples-sandbox/trunk/components/tables/src/main/webapp/index.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/index.xhtml (rev 0)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/index.xhtml 2010-05-19 17:09:54 UTC (rev 17133)
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<h:head>
+</h:head>
+<h:body>
+ <h4>Iteration Components Sample</h4>
+ <ul>
+ <li><h:link outcome="dataTable">rich:DataTable</h:link></li>
+ <li><h:link outcome="extendedtable">rich:extendedDataTable</h:link></li>
+ <li><h:link outcome="filteringAndSorting">filtering and sorting feature</h:link></li>
+ </ul>
+
+ <h:form>
+ <h:panelGrid columns="3">
+ <h:commandButton value="Classic">
+ <f:setPropertyActionListener target="#{skinBean.skin}"
+ value="classic" />
+ </h:commandButton>
+ <h:commandButton value="BlueSky">
+ <f:setPropertyActionListener target="#{skinBean.skin}"
+ value="blueSky" />
+ </h:commandButton>
+ <h:commandButton value="DeepMarine">
+ <f:setPropertyActionListener target="#{skinBean.skin}"
+ value="deepMarine" />
+ </h:commandButton>
+ </h:panelGrid>
+ </h:form>
+</h:body>
+</html>
\ No newline at end of file
15 years, 7 months
JBoss Rich Faces SVN: r17132 - root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-19 12:46:24 -0400 (Wed, 19 May 2010)
New Revision: 17132
Modified:
root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml
Log:
enable 'blueSky' skin
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml 2010-05-19 16:41:26 UTC (rev 17131)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/WEB-INF/web.xml 2010-05-19 16:46:24 UTC (rev 17132)
@@ -44,6 +44,21 @@
<display-name></display-name>
<description></description>
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>blueSky</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING</param-name>
+ <param-value>enable</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
+ <param-value>enable</param-value>
+ </context-param>
+
+
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
15 years, 7 months
JBoss Rich Faces SVN: r17131 - in root/ui-sandbox/datascroller/trunk/ui/src/main: java/org/richfaces/renderkit/html and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-19 12:41:26 -0400 (Wed, 19 May 2010)
New Revision: 17131
Added:
root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/
root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/
root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonGradientImage.java
root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonOverGradientImage.java
root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSDigitalGradientImage.java
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/org.richfaces.renderkit.html.images.DSButtonGradientImage.resource.properties
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/org.richfaces.renderkit.html.images.DSButtonOverGradientImage.resource.properties
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/org.richfaces.renderkit.html.images.DSDigitalGradientImage.resource.properties
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.ecss
Removed:
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.css
Modified:
root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/dataTable.faces-config.xml
root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/script/datascroller.js
root/ui-sandbox/datascroller/trunk/ui/src/main/templates/datascroller.template.xml
Log:
skinning, add gradient image generation classes
Modified: root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-05-19 16:38:35 UTC (rev 17130)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/DataScrollerBaseRenderer.java 2010-05-19 16:41:26 UTC (rev 17131)
@@ -48,7 +48,7 @@
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-event.js"), @ResourceDependency(name = "richfaces-queue.js"),
@ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "script/datascroller.js"),
- @ResourceDependency(name = "css/datascroller.css")
+ @ResourceDependency(name = "css/datascroller.ecss")
})
public class DataScrollerBaseRenderer extends RendererBase {
@@ -201,15 +201,16 @@
styleClass = "";
}
- out.startElement(HTML.A_ELEMENT, component);
if (isCurrentPage) {
+ out.startElement(HTML.SPAN_ELEM, component);
out.writeAttribute(HTML.CLASS_ATTRIBUTE, "ds_digital ds_current " + styleClass, null);
} else {
+ out.startElement(HTML.A_ELEMENT, component);
out.writeAttribute(HTML.CLASS_ATTRIBUTE, "ds_digital " + styleClass, null);
+ out.writeAttribute(HTML.HREF_ATTR, "javascript:void(0);", null);
}
- out.writeAttribute(HTML.HREF_ATTR, "javascript:void(0);", null);
if (null != style) {
out.writeAttribute(HTML.STYLE_ATTRIBUTE, style, null);
@@ -223,7 +224,12 @@
digital.put(id, page);
out.writeText(page, null);
- out.endElement(HTML.A_ELEMENT);
+
+ if(isCurrentPage) {
+ out.endElement(HTML.SPAN_ELEM);
+ } else {
+ out.endElement(HTML.A_ELEMENT);
+ }
}
return digital;
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonGradientImage.java
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonGradientImage.java (rev 0)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonGradientImage.java 2010-05-19 16:41:26 UTC (rev 17131)
@@ -0,0 +1,9 @@
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class DSButtonGradientImage extends BaseGradient {
+ public DSButtonGradientImage() {
+ super("headerGradientColor", "headerBackgroundColor");
+ }
+}
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonOverGradientImage.java
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonOverGradientImage.java (rev 0)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSButtonOverGradientImage.java 2010-05-19 16:41:26 UTC (rev 17131)
@@ -0,0 +1,9 @@
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class DSButtonOverGradientImage extends BaseGradient{
+ public DSButtonOverGradientImage() {
+ super("additionalBackgroundColor", "tableBackgroundColor");
+ }
+}
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSDigitalGradientImage.java
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSDigitalGradientImage.java (rev 0)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/java/org/richfaces/renderkit/html/images/DSDigitalGradientImage.java 2010-05-19 16:41:26 UTC (rev 17131)
@@ -0,0 +1,9 @@
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class DSDigitalGradientImage extends BaseGradient {
+ public DSDigitalGradientImage() {
+ super("additionalBackgroundColor", "tableBackgroundColor");
+ }
+}
Modified: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/dataTable.faces-config.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/dataTable.faces-config.xml 2010-05-19 16:38:35 UTC (rev 17130)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/dataTable.faces-config.xml 2010-05-19 16:41:26 UTC (rev 17131)
@@ -7,4 +7,12 @@
<system-event-class>javax.faces.event.PreRenderComponentEvent</system-event-class>
</system-event-listener>
</application>
+ <render-kit>
+ <render-kit-id>HTML_BASIC</render-kit-id>
+ <renderer>
+ <component-family>org.richfaces.DataScroller</component-family>
+ <renderer-type>org.richfaces.DataScrollerRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.DataScrollerRenderer</renderer-class>
+ </renderer>
+ </render-kit>
</faces-config>
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/org.richfaces.renderkit.html.images.DSButtonGradientImage.resource.properties
===================================================================
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/org.richfaces.renderkit.html.images.DSButtonOverGradientImage.resource.properties
===================================================================
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/org.richfaces.renderkit.html.images.DSDigitalGradientImage.resource.properties
===================================================================
Deleted: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.css
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.css 2010-05-19 16:38:35 UTC (rev 17130)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.css 2010-05-19 16:41:26 UTC (rev 17131)
@@ -1,75 +0,0 @@
-.ds_container{
- white-space : nowrap;
- display : inline-block;
- font-size : 11px/*generalSizeFont*/;
- padding : 1px;
- font-family : verdana/*generalFamilyFont*/;
- background : #ffffff/*background-color - tableBackgroundColor*/;
-}
-
-.ds_container_decor{
- border : 1px solid #A6A6A6/*tableBorderColor*/;
-}
-
-.ds_button{
- cursor : pointer;
- padding : 2px 10px 3px 10px;
- border : 1px solid #A6A6A6/*tableBorderColor*/;
- display : inline-block;
- background : url(images/bg_btn.png) top left repeat-x #C0D1E7/*gradient - from headerGradientColor to headerBackgroundColor, background-color - headerBackgroundColor*/;
- font-size : 11px/*generalSizeFont*/;
- font-family : verdana/*generalFamilyFont*/;
- color : #000000/*generalTextColor*/;
- text-decoration:none;
- font-weight: normal;
-}
-
-.ds_left{
- margin-right : 1px;
-}
-
-.ds_right{
- margin-left : 1px;
-}
-
-.ds_digital{
- cursor : pointer;
- width : 2em;
- text-align : center;
- margin-left : 1px;
- margin-right : 1px;
- padding : 2px 2px 3px 2px;
- border : 1px solid transparent;
- border-top : 1px solid #A6A6A6/*tableBorderColor*/;
- background : url(images/bg_field.png) top left repeat-x/*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/;
- display : inline-block;
- font-size : 11px/*generalSizeFont*/;
- font-family : verdana/*generalFamilyFont*/;
- text-decoration:none;
- color : #000000/*generalTextColor*/;
- font-weight: normal;
-
-}
-
-.ds_over{
- border : 1px solid #A6A6A6/*tableBorderColor*/;
- background : url(images/bg_field.png) top left repeat-x #FFFFFF; /*gradient - from additionalBackgroundColor to tableBackgroundColor, background-color - tableBackgroundColor*/;
-}
-
-.ds_press{
- border : 1px solid #A6A6A6/*tableBorderColor*/;
- background : #ECF3FA; /*background-color - additionalBackgroundColor*/;
-}
-
-.ds_current{
- cursor : default;
- font-weight : bold;
- border : 1px solid transparent;
- border-bottom : 1px solid #A6A6A6/*tableBorderColor*/;
- background : none;
-}
-
-.ds_disabled{
- color : #A6A6A6/*tableBorderColor*/;
- cursor : default;
-}
\ No newline at end of file
Added: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.ecss
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.ecss (rev 0)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/css/datascroller.ecss 2010-05-19 16:41:26 UTC (rev 17131)
@@ -0,0 +1,114 @@
+a.ds_digital {
+ color: '#{richSkin.generalTextColor}';
+}
+
+a.ds_button {
+ color: '#{richSkin.generalTextColor}';
+}
+
+.ds_container {
+ white-space: nowrap;
+ display: inline-block;
+ font-size: '#{richSkin.generalSizeFont}';
+ padding: 1px;
+ font-family: '#{richSkin.generalFamilyFont}';
+ background: '#{richSkin.tableBackgroundColor}';
+}
+
+.ds_container_decor {
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+}
+
+.ds_button {
+ cursor: pointer;
+ padding: 2px 10px 3px 10px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+ display: inline-block;
+
+ background-position: top left;
+ background-repeat: repeat-x;
+ background-color: '#{richSkin.headerBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.DSButtonGradientImage']})";
+
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ color: '#{richSkin.generalTextColor}';
+ text-decoration: none;
+ font-weight: normal;
+}
+
+.ds_left {
+ margin-right: 1px;
+}
+
+.ds_right {
+ margin-left: 1px;
+}
+
+.ds_digital {
+ cursor: pointer;
+ width: 2em;
+ text-align: center;
+ margin-left: 1px;
+ margin-right: 1px;
+ padding: 2px 2px 3px 2px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: transparent;
+ border-top-width: 1px;
+ border-top-style: solid;
+ border-top-color: '#{richSkin.tableBorderColor}';
+
+ background-color: '#{richSkin.tableBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.DSDigitalGradientImage']})";
+
+
+ background-position: top left;
+ background-repeat: repeat-x;
+
+ display: inline-block;
+ font-size: '#{richSkin.generalSizeFont}';
+ font-family: '#{richSkin.generalFamilyFont}';
+ text-decoration: none;
+ color: '#{richSkin.generalTextColor}';
+ font-weight: normal;
+
+}
+
+.ds_over {
+ border-width : 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+ background-position: top left;
+ background-repeat: repeat-x;
+ background-color: '#{richSkin.tableBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.DSButtonOverGradientImage']})";
+}
+
+.ds_press {
+ border-width: 1px;
+ border-style: solid;
+ border-color: '#{richSkin.tableBorderColor}';
+ background: '#{richSkin.additionalBackgroundColor}';
+}
+
+.ds_current {
+ cursor: default;
+ font-weight: bold;
+ border-width: 1px;
+ bordr-style: solid;
+ border-color: transparent;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-bottom-color: '#{richSkin.tableBorderColor}';
+ background: none;
+}
+
+.ds_disabled{
+ color: '#{richSkin.tableBorderColor}';
+ cursor: default;
+}
\ No newline at end of file
Modified: root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/script/datascroller.js
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-05-19 16:38:35 UTC (rev 17130)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/resources/META-INF/resources/script/datascroller.js 2010-05-19 16:41:26 UTC (rev 17131)
@@ -69,14 +69,14 @@
if(buttons) {
var leftButtons = buttons.left;
- css.mouseover = "ds_button ds_left ds_over";
+ css.mouseover = "ds_button ds_left";
css.mouseup = "ds_button ds_left";
css.mouseout = "ds_button ds_left";
css.mousedown = "ds_button ds_left ds_over";
initButtons(leftButtons,css, this);
var rightButtons = buttons.right;
- css.mouseover = "ds_button ds_right ds_over";
+ css.mouseover = "ds_button ds_right";
css.mouseup = "ds_button ds_right";
css.mouseout = "ds_button ds_right";
css.mousedown = "ds_button ds_right ds_over";
Modified: root/ui-sandbox/datascroller/trunk/ui/src/main/templates/datascroller.template.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/src/main/templates/datascroller.template.xml 2010-05-19 16:38:35 UTC (rev 17130)
+++ root/ui-sandbox/datascroller/trunk/ui/src/main/templates/datascroller.template.xml 2010-05-19 16:41:26 UTC (rev 17131)
@@ -25,9 +25,9 @@
</a>
</c:when>
<c:otherwise>
- <a id="#{clientId}_ds_f" class="ds_button ds_left ds_disabled" href="javascript:void(0)">
+ <span id="#{clientId}_ds_f" class="ds_button ds_left ds_disabled">
««
- </a>
+ </span>
</c:otherwise>
</c:choose>
</c:if>
@@ -41,9 +41,9 @@
</a>
</c:when>
<c:otherwise>
- <a id="#{clientId}_ds_fr" class="ds_button ds_left ds_disabled" href="javascript:void(0)">
+ <span id="#{clientId}_ds_fr" class="ds_button ds_left ds_disabled">
«
- </a>
+ </span>
</c:otherwise>
</c:choose>
</c:if>
@@ -58,9 +58,9 @@
</a>
</c:when>
<c:otherwise>
- <a id="#{clientId}_ds_ff" class="ds_button ds_right ds_disabled" href="javascript:void(0)">
+ <span id="#{clientId}_ds_ff" class="ds_button ds_right ds_disabled">
»
- </a>
+ </span>
</c:otherwise>
</c:choose>
</c:if>
@@ -73,9 +73,9 @@
</a>
</c:when>
<c:otherwise>
- <a id="#{clientId}_ds_l" class="ds_button ds_right ds_disabled" href="javascript:void(0)">
+ <span id="#{clientId}_ds_l" class="ds_button ds_right ds_disabled">
»»
- </a>
+ </span>
</c:otherwise>
</c:choose>
</c:if>
15 years, 7 months
JBoss Rich Faces SVN: r17130 - root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-19 12:38:35 -0400 (Wed, 19 May 2010)
New Revision: 17130
Modified:
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
Log:
fix script loading order
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-05-19 16:19:06 UTC (rev 17129)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-05-19 16:38:35 UTC (rev 17130)
@@ -44,8 +44,8 @@
@ResourceDependencies( { @ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name= "richfaces-event.js"), @ResourceDependency(name = "datatable.js"),
- @ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "table.css") })
+ @ResourceDependency(name= "richfaces-event.js"),@ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(name = "datatable.js"), @ResourceDependency(name = "table.css") })
public class DataTableRenderer extends AbstractTableRenderer {
public void encodeTableStructure(ResponseWriter writer, FacesContext context, UIDataTableBase dataTable)
15 years, 7 months
JBoss Rich Faces SVN: r17129 - in root/core/trunk/impl/src: test/resources/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-05-19 12:19:06 -0400 (Wed, 19 May 2010)
New Revision: 17129
Modified:
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
root/core/trunk/impl/src/test/resources/javascript/richfaces-client-api.html
root/core/trunk/impl/src/test/resources/javascript/richfaces-jsf-ajax-qunit.js
root/core/trunk/impl/src/test/resources/javascript/richfaces-queue-qunit-request.js
Log:
https://jira.jboss.org/browse/RF-8258
broken tests fix
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-05-19 14:51:23 UTC (rev 17128)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-05-19 16:19:06 UTC (rev 17129)
@@ -142,6 +142,16 @@
* */
getEventElement: function() {
return this.id;
+ },
+
+ /**
+ * Destroy method. Will be called before remove component from the page
+ *
+ * @function
+ * @name RichFaces.BaseComponent#destroy
+ *
+ * */
+ destroy: function() {
}
};
})(params));
Modified: root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-19 14:51:23 UTC (rev 17128)
+++ root/core/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-05-19 16:19:06 UTC (rev 17129)
@@ -9,7 +9,7 @@
* */
window.RichFaces = {};
-(function(richfaces, jQuery) {
+(function(jQuery, richfaces) {
// get DOM element by id or DOM element or jQuery object
richfaces.getDomElement = function (source) {
@@ -40,6 +40,30 @@
}
}
+ // find component and call his method
+ richfaces.invokeMethod = function(source, method) {
+ var c = richfaces.$(source);
+ if (c) {
+ var f = c[method];
+ if (typeof f == "function") {
+ return f.apply(c, Array.prototype.slice.call(arguments, 2));
+ }
+ }
+ }
+
+ //dom cleaner
+ richfaces.cleanDom = function(id) {
+ var e = document.getElementById(id);
+ var elements = e.getElementsByTagName("*");
+ jQuery.cleanData(elements);
+ jQuery.cleanData([e]);
+ jQuery.each(elements, function(index) {
+ richfaces.invokeMethod(this, "destroy");
+ });
+ richfaces.invokeMethod(e, "destroy");
+
+ }
+
//form.js
richfaces.submitForm = function(form, parameters, target) {
if (typeof form === "string") { form = jQuery(form) };
@@ -705,6 +729,24 @@
}
};
}()));
+
+ richfaces.ajax.onComplete = function (data) {
+ var type = data.type;
+ var responseXML = data.responseXML;
-}(RichFaces, jQuery));
+ if (type == 'complete' && responseXML) {
+ var partialResponse = jQuery(responseXML).children("partial-response");
+ if (partialResponse && partialResponse.length) {
+ var elements = partialResponse.children('changes').children('update, delete');
+ jQuery.each(elements, function () {
+ richfaces.cleanDom(this.id);
+ });
+ }
+ }
+ };
+ // move this code to somewhere
+ if (typeof jsf != 'undefined') {
+ jsf.ajax.addOnEvent(richfaces.ajax.onComplete);
+ }
+}(jQuery, RichFaces));
Modified: root/core/trunk/impl/src/test/resources/javascript/richfaces-client-api.html
===================================================================
--- root/core/trunk/impl/src/test/resources/javascript/richfaces-client-api.html 2010-05-19 14:51:23 UTC (rev 17128)
+++ root/core/trunk/impl/src/test/resources/javascript/richfaces-client-api.html 2010-05-19 16:19:06 UTC (rev 17129)
@@ -8,10 +8,21 @@
<script type="text/javascript" src="../../classes/META-INF/resources/jquery.js"></script>
<script type="text/javascript" src="qunit/qunit.js"></script>
<script type="text/javascript" src="timer-simulation.js"></script>
+ <script type="text/javascript" src="richfaces-jsf-ajax-qunit.js"></script>
<script type="text/javascript" src="../../classes/META-INF/resources/richfaces.js"></script>
- <script type="text/javascript" src="richfaces-jsf-ajax-qunit.js"></script>
<script type="text/javascript" src="../../classes/META-INF/resources/jquery.position.js"></script>
+ <script type="text/javascript">
+ // save handlers counter
+ jsf.ajax.__data = {};
+ jsf.ajax.__data.beforeEventHandlers = jsf.ajax.eventHandlerCounter;
+ jsf.ajax.__data.beforeErrorHandlers = jsf.ajax.errorHandlerCounter;
+ </script>
<script type="text/javascript" src="../../classes/META-INF/resources/richfaces-queue.js"></script>
+ <script type="text/javascript">
+ // save handlers counter
+ jsf.ajax.__data.afterEventHandlers = jsf.ajax.eventHandlerCounter;
+ jsf.ajax.__data.afterErrorHandlers = jsf.ajax.errorHandlerCounter;
+ </script>
<script type="text/javascript" src="../../classes/META-INF/resources/richfaces-base-component.js"></script>
<script type="text/javascript" src="../../classes/META-INF/resources/richfaces-event.js"></script>
<script type="text/javascript" src="richfaces-qunit.js"></script>
Modified: root/core/trunk/impl/src/test/resources/javascript/richfaces-jsf-ajax-qunit.js
===================================================================
--- root/core/trunk/impl/src/test/resources/javascript/richfaces-jsf-ajax-qunit.js 2010-05-19 14:51:23 UTC (rev 17128)
+++ root/core/trunk/impl/src/test/resources/javascript/richfaces-jsf-ajax-qunit.js 2010-05-19 16:19:06 UTC (rev 17129)
@@ -3,6 +3,8 @@
return {
eventHandlers:[],
errorHandlers:[],
+ eventHandlerCounter:0,
+ errorHandlerCounter:0,
request:function (source, event, options) {
for (var i=0; i<jsf.ajax.eventHandlers.length;i++) {
jsf.ajax.eventHandlers[i]({type:"event", status:"success"});
@@ -10,9 +12,11 @@
},
addOnEvent: function (handler) {
jsf.ajax.eventHandlers.push(handler);
+ this.eventHandlerCounter++;
},
addOnError: function (handler) {
jsf.ajax.errorHandlers.push(handler);
+ this.errorHandlerCounter++;
}
}
})();
Modified: root/core/trunk/impl/src/test/resources/javascript/richfaces-queue-qunit-request.js
===================================================================
--- root/core/trunk/impl/src/test/resources/javascript/richfaces-queue-qunit-request.js 2010-05-19 14:51:23 UTC (rev 17128)
+++ root/core/trunk/impl/src/test/resources/javascript/richfaces-queue-qunit-request.js 2010-05-19 16:19:06 UTC (rev 17129)
@@ -56,10 +56,10 @@
// queue handlers
test("queue event and error handlers", function() {
expect(4);
- equals(jsf.ajax.eventHandlers.length, 1, "one event handler");
- equals(typeof jsf.ajax.eventHandlers[0], "function", "event handler is function");
- equals(jsf.ajax.errorHandlers.length, 1, "one error handler");
- equals(typeof jsf.ajax.errorHandlers[0], "function", "error handler is function");
+ equals(jsf.ajax.__data.afterEventHandlers - jsf.ajax.__data.beforeEventHandlers, 1, "one event handler");
+ equals(typeof jsf.ajax.eventHandlers[jsf.ajax.__data.beforeEventHandlers], "function", "event handler is function");
+ equals(jsf.ajax.__data.afterErrorHandlers - jsf.ajax.__data.beforeErrorHandlers, 1, "one error handler");
+ equals(typeof jsf.ajax.errorHandlers[jsf.ajax.__data.beforeErrorHandlers], "function", "error handler is function");
});
//jsf.ajax.request - parameters test
15 years, 7 months
JBoss Rich Faces SVN: r17128 - in root/examples/richfaces-showcase/trunk/src/main: resources/org/richfaces/demo/data/common and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-05-19 10:51:23 -0400 (Wed, 19 May 2010)
New Revision: 17128
Modified:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
https://jira.jboss.org/browse/RF-8663
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java 2010-05-19 14:21:23 UTC (rev 17127)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java 2010-05-19 14:51:23 UTC (rev 17128)
@@ -7,7 +7,6 @@
public class DemoDescriptor extends BaseDescriptor {
private static final String BASE_SAMPLES_DIR = "/richfaces/";
- private String samplesFolder;
private List<SampleDescriptor> samples;
public SampleDescriptor getSampleById(String id) {
@@ -29,13 +28,4 @@
this.samples = samples;
}
- @XmlElement(name = "samples-folder")
- public String getSamplesFolder() {
- return samplesFolder;
- }
-
- public void setSamplesFolder(String samplesFolder) {
- this.samplesFolder = samplesFolder;
- }
-
}
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java 2010-05-19 14:21:23 UTC (rev 17127)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java 2010-05-19 14:51:23 UTC (rev 17128)
@@ -16,6 +16,7 @@
public class DemoNavigator {
private static final String DEMO_VIEW_PARAMETER = "demo";
private static final String SAMPLE_VIEW_PARAMETER = "sample";
+ private static final String SEPARATOR = "/";
@ManagedProperty(value = "#{navigationParser.groupsList}")
private List<GroupDescriptor> groups;
@@ -84,7 +85,8 @@
if (handler instanceof ConfigurableNavigationHandler) {
ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) handler;
- NavigationCase navCase = navigationHandler.getNavigationCase(context, null, currentDemo.getSamplesFolder()
+ NavigationCase navCase = navigationHandler.getNavigationCase(context, null, currentDemo.getId()
+ + SEPARATOR
+ getCurrentSample().getId());
return navCase.getToViewId(context);
Modified: root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-05-19 14:21:23 UTC (rev 17127)
+++ root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-05-19 14:51:23 UTC (rev 17128)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- NOTES(TODO: move to some readme in future): id for sample should equals to xhtml page name with the sample -->
+<!-- NOTES(TODO: move to some readme in future): id for sample should equals to xhtml page name with the sample
+the same for demo id - it should be equals to name of the folder where samples placed -->
<root>
<group>
<name>Ajax Action</name>
@@ -7,7 +8,6 @@
<demo>
<id>ajax</id>
<name>a4j:ajax</name>
- <samples-folder>ajax/</samples-folder>
<samples>
<sample>
<id>ajax</id>
@@ -22,7 +22,6 @@
<demo new="true">
<id>commandButton</id>
<name>a4j:commandButton</name>
- <samples-folder>commandButton/</samples-folder>
<samples>
<sample>
<id>commandButton</id>
@@ -32,8 +31,7 @@
</demo>
<demo new="true">
<id>commandLink</id>
- <name>a4j:commandLink</name>
- <samples-folder>commandLink/</samples-folder>
+ <name>a4j:commandLink</name>
<samples>
<sample>
<id>commandLink</id>
@@ -43,8 +41,7 @@
</demo>
<demo new="true">
<id>jsFunction</id>
- <name>a4j:jsFunction</name>
- <samples-folder>jsFunction/</samples-folder>
+ <name>a4j:jsFunction</name>
<samples>
<sample>
<id>jsFunction</id>
@@ -55,7 +52,6 @@
<demo new="true">
<id>poll</id>
<name>a4j:poll</name>
- <samples-folder>poll/</samples-folder>
<samples>
<sample>
<id>poll</id>
@@ -66,7 +62,6 @@
<demo new="true">
<id>push</id>
<name>a4j:push</name>
- <samples-folder>push/</samples-folder>
<samples>
<sample>
<id>push</id>
@@ -82,7 +77,6 @@
<demo new="true">
<id>queue</id>
<name>a4j:queue</name>
- <samples-folder>queue/</samples-folder>
<samples>
<sample>
<id>queue</id>
@@ -93,7 +87,6 @@
<demo new="true">
<id>attachQueue</id>
<name>a4j:attachQueue</name>
- <samples-folder>attachQueue/</samples-folder>
<samples>
<sample>
<id>attachQueue</id>
@@ -109,7 +102,6 @@
<demo new="true">
<id>outputPanel</id>
<name>a4j:outputPanel</name>
- <samples-folder>outputPanel/</samples-folder>
<samples>
<sample>
<id>simple</id>
@@ -124,7 +116,6 @@
<demo new="true">
<id>status</id>
<name>a4j:status</name>
- <samples-folder>status</samples-folder>
<samples>
<sample>
<id>simple</id>
@@ -141,9 +132,8 @@
</samples>
</demo>
<demo new="true">
- <id>mediaoutput</id>
+ <id>mediaOutput</id>
<name>a4j:mediaOutput</name>
- <samples-folder>mediaOutput</samples-folder>
<samples>
<sample>
<id>imgUsage</id>
@@ -158,7 +148,6 @@
<demo new="true">
<id>log</id>
<name>a4j:log</name>
- <samples-folder>log</samples-folder>
<samples>
<sample>
<id>log</id>
@@ -176,9 +165,11 @@
<name>rich:dataTable</name>
<samples>
<sample>
+ <id>simpleTable</id>
<name>Data Table Basic</name>
</sample>
<sample>
+ <id>tableSorting</id>
<name>Data Table Sorting</name>
</sample>
</samples>
15 years, 7 months
JBoss Rich Faces SVN: r17127 - root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-05-19 10:21:23 -0400 (Wed, 19 May 2010)
New Revision: 17127
Modified:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/BaseDescriptor.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/SampleDescriptor.java
Log:
https://jira.jboss.org/browse/RF-8663
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/BaseDescriptor.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/BaseDescriptor.java 2010-05-19 14:12:29 UTC (rev 17126)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/BaseDescriptor.java 2010-05-19 14:21:23 UTC (rev 17127)
@@ -27,7 +27,6 @@
this.newItem = newItem;
}
- @XmlAttribute(name = "current")
public boolean isCurrentItem() {
return currentItem;
}
@@ -35,6 +34,7 @@
public void setCurrentItem(boolean currentItem) {
this.currentItem = currentItem;
}
+
@XmlElement
public String getId() {
return id;
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java 2010-05-19 14:12:29 UTC (rev 17126)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoDescriptor.java 2010-05-19 14:21:23 UTC (rev 17127)
@@ -7,42 +7,18 @@
public class DemoDescriptor extends BaseDescriptor {
private static final String BASE_SAMPLES_DIR = "/richfaces/";
-
- private String page;
- private boolean current;
- private SampleDescriptor activeSample;
+ private String samplesFolder;
private List<SampleDescriptor> samples;
- private SampleDescriptor getSampleById(String id) {
+ public SampleDescriptor getSampleById(String id) {
for (SampleDescriptor sample : getSamples()) {
if (sample.getId().equals(id)) {
return sample;
}
}
- return null;
+ return samples.get(0);
}
-
- public void setActiveSampleById(String id) {
- setActiveSample(getSampleById(id));
- }
-
- public String getSampleURI() {
- return BASE_SAMPLES_DIR + activeSample.getSrc();
- }
-
- public String getDemoURI() {
- return BASE_SAMPLES_DIR + getPage();
- }
-
- @XmlElement
- public String getPage() {
- return page;
- }
-
- public void setPage(String page) {
- this.page = page;
- }
-
+
@XmlElementWrapper(name = "samples")
@XmlElement(name = "sample")
public List<SampleDescriptor> getSamples() {
@@ -53,20 +29,13 @@
this.samples = samples;
}
- public boolean isCurrent() {
- return current;
+ @XmlElement(name = "samples-folder")
+ public String getSamplesFolder() {
+ return samplesFolder;
}
- public void setCurrent(boolean current) {
- this.current = current;
+ public void setSamplesFolder(String samplesFolder) {
+ this.samplesFolder = samplesFolder;
}
- public SampleDescriptor getActiveSample() {
- return activeSample;
- }
-
- public void setActiveSample(SampleDescriptor activeSample) {
- this.activeSample = activeSample;
- }
-
}
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java 2010-05-19 14:12:29 UTC (rev 17126)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/DemoNavigator.java 2010-05-19 14:21:23 UTC (rev 17127)
@@ -9,71 +9,48 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
-import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.event.ComponentSystemEvent;
-import javax.servlet.http.HttpServletRequest;
@ManagedBean
@SessionScoped
public class DemoNavigator {
-
- private static Converter demoViewConverter = new Converter() {
-
- public String getAsString(FacesContext context, UIComponent component, Object value) {
- return (String) value;
- }
-
- public Object getAsObject(FacesContext context, UIComponent component, String value) {
- NavigationHandler handler = context.getApplication().getNavigationHandler();
-
- if (handler instanceof ConfigurableNavigationHandler) {
- ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) handler;
-
- NavigationCase navCase = navigationHandler.getNavigationCase(context, null, "/richfaces/" + value);
-
- return navCase.getToViewId(context);
- }
-
- return null;
- }
- };
+ private static final String DEMO_VIEW_PARAMETER = "demo";
+ private static final String SAMPLE_VIEW_PARAMETER = "sample";
@ManagedProperty(value = "#{navigationParser.groupsList}")
private List<GroupDescriptor> groups;
private DemoDescriptor currentDemo = null;
- private String currentSample;
-
- private String demoName;
-
+ private SampleDescriptor currentSample = null;
+ private String sample;
+ private String demo;
+
public DemoDescriptor getCurrentDemo() {
- String id = getDemoParam("demo");
- if (id != null) {
- setCurrentDemo(findDemoById(id));
- } else {
- String uri = getDemoUri();
- setCurrentDemo(findDemoByUri(uri));
- }
- // set active sample for current component if any
- if (null != currentDemo) {
- if (null != currentSample) {
- currentDemo.setActiveSampleById(currentSample);
- } else {
- currentDemo.setActiveSample(currentDemo.getSamples().get(0));
- currentSample = currentDemo.getActiveSample().getId();
+ String id = getViewParameter(DEMO_VIEW_PARAMETER);
+ if (currentDemo == null || !currentDemo.getId().equals(id)) {
+ if (id != null) {
+ currentDemo = findDemoById(id);
}
+ if (currentDemo == null) {
+ currentDemo = groups.get(0).getDemos().get(0);
+ }
}
-
return currentDemo;
}
-
- private String getDemoUri() {
- FacesContext fc = FacesContext.getCurrentInstance();
- return ((HttpServletRequest) fc.getExternalContext().getRequest()).getRequestURI();
+
+ public SampleDescriptor getCurrentSample() {
+ String id = getViewParameter(SAMPLE_VIEW_PARAMETER);
+ if (currentSample == null || !currentSample.getId().equals(id)) {
+ if (id != null) {
+ currentSample = getCurrentDemo().getSampleById(id);
+ }
+ if (currentSample == null || id==null) {
+ currentSample = getCurrentDemo().getSamples().get(0);
+ }
+ }
+ return currentSample;
}
-
- private String getDemoParam(String name) {
+
+ private String getViewParameter(String name) {
FacesContext fc = FacesContext.getCurrentInstance();
String param = (String) fc.getExternalContext().getRequestParameterMap().get(name);
if (param != null && param.trim().length() > 0) {
@@ -83,21 +60,6 @@
}
}
- public DemoDescriptor findDemoByUri(String uri) {
- Iterator<GroupDescriptor> it = groups.iterator();
- while (it.hasNext()) {
- GroupDescriptor group = it.next();
- Iterator<DemoDescriptor> dit = group.getDemos().iterator();
- while (dit.hasNext()) {
- DemoDescriptor demo = dit.next();
- if (uri.endsWith(demo.getDemoURI())) {
- return demo;
- }
- }
- }
- return null;
- }
-
public DemoDescriptor findDemoById(String id) {
Iterator<GroupDescriptor> it = groups.iterator();
while (it.hasNext()) {
@@ -113,11 +75,22 @@
return null;
}
- public void setCurrentDemo(DemoDescriptor currentDemo) {
- if (currentDemo == null) {
- this.currentDemo = (DemoDescriptor) groups.get(0).getDemos().get(0);
+ public String getSampleURI() {
+ DemoDescriptor currentDemo = getCurrentDemo();
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ NavigationHandler handler = context.getApplication().getNavigationHandler();
+
+ if (handler instanceof ConfigurableNavigationHandler) {
+ ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) handler;
+
+ NavigationCase navCase = navigationHandler.getNavigationCase(context, null, currentDemo.getSamplesFolder()
+ + getCurrentSample().getId());
+
+ return navCase.getToViewId(context);
}
- this.currentDemo = currentDemo;
+
+ return null;
}
public List<GroupDescriptor> getGroups() {
@@ -128,27 +101,19 @@
this.groups = groups;
}
- public String getCurrentSample() {
- return currentSample;
+ public String getSample() {
+ return sample;
}
- public void setCurrentSample(String currentSample) {
- this.currentSample = currentSample;
+ public void setSample(String sample) {
+ this.sample = sample;
}
- public String getDemoName() {
- return demoName;
+ public String getDemo() {
+ return demo;
}
- public void setDemoName(String demoName) {
- this.demoName = demoName;
+ public void setDemo(String demo) {
+ this.demo = demo;
}
-
- public void preRenderEvent(ComponentSystemEvent event) {
- System.out.println("DemoNavigator.preRenderEvent()");
- }
-
- public Converter getDemoViewConverter() {
- return demoViewConverter;
- }
}
Modified: root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/SampleDescriptor.java
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/SampleDescriptor.java 2010-05-19 14:12:29 UTC (rev 17126)
+++ root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/navigation/SampleDescriptor.java 2010-05-19 14:21:23 UTC (rev 17127)
@@ -1,16 +1,5 @@
package org.richfaces.demo.common.navigation;
-import javax.xml.bind.annotation.XmlElement;
-
-
public class SampleDescriptor extends BaseDescriptor{
- private String src;
- @XmlElement
- public String getSrc() {
- return src;
- }
- public void setSrc(String src) {
- this.src = src;
- }
}
15 years, 7 months