Author: d.bulahov
Date: 2007-04-27 08:57:39 -0400 (Fri, 27 Apr 2007)
New Revision: 585
Added:
trunk/sandbox/panel2/
trunk/sandbox/panel2/pom.xml
trunk/sandbox/panel2/pom.xml.prev
trunk/sandbox/panel2/src/
trunk/sandbox/panel2/src/main/
trunk/sandbox/panel2/src/main/config/
trunk/sandbox/panel2/src/main/config/component/
trunk/sandbox/panel2/src/main/config/component/panel2.xml
trunk/sandbox/panel2/src/main/java/
trunk/sandbox/panel2/src/main/java/org/
trunk/sandbox/panel2/src/main/java/org/richfaces/
trunk/sandbox/panel2/src/main/java/org/richfaces/component/
trunk/sandbox/panel2/src/main/java/org/richfaces/component/UIPanel2.java
trunk/sandbox/panel2/src/main/resources/
trunk/sandbox/panel2/src/main/resources/org/
trunk/sandbox/panel2/src/main/resources/org/richfaces/
trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/
trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/html/
trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/html/css/
trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/html/css/panel2.xcss
trunk/sandbox/panel2/src/main/templates/
trunk/sandbox/panel2/src/main/templates/panel2.jspx
trunk/sandbox/panel2/src/test/
trunk/sandbox/panel2/src/test/java/
trunk/sandbox/panel2/src/test/java/org/
trunk/sandbox/panel2/src/test/java/org/richfaces/
trunk/sandbox/panel2/src/test/java/org/richfaces/component/
trunk/sandbox/panel2/src/test/java/org/richfaces/component/html/
trunk/sandbox/panel2/src/test/java/org/richfaces/component/html/HtmlPanel2Test.java
trunk/sandbox/panel2/src/test/java/org/richfaces/taglib/
trunk/sandbox/panel2/src/test/java/org/richfaces/taglib/Panel2TagTest.java
trunk/sandbox/panel2/src/test/resources/
trunk/sandbox/panel2/src/test/resources/WEB-INF/
trunk/sandbox/panel2/src/test/resources/WEB-INF/web.xml
Log:
New panel rendering
Added: trunk/sandbox/panel2/pom.xml
===================================================================
--- trunk/sandbox/panel2/pom.xml (rev 0)
+++ trunk/sandbox/panel2/pom.xml 2007-04-27 12:57:39 UTC (rev 585)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>richfaces-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>panel2</artifactId>
+ <name>Panel2</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ajax4jsf.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>1.1.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>generate-tests</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>panel2</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
+
Added: trunk/sandbox/panel2/pom.xml.prev
===================================================================
--- trunk/sandbox/panel2/pom.xml.prev (rev 0)
+++ trunk/sandbox/panel2/pom.xml.prev 2007-04-27 12:57:39 UTC (rev 585)
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<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>richfaces-parent</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>panel</artifactId>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ajax4jsf.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>1.1.0</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>panel</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/panel2/src/main/config/component/panel2.xml
===================================================================
--- trunk/sandbox/panel2/src/main/config/component/panel2.xml (rev
0)
+++ trunk/sandbox/panel2/src/main/config/component/panel2.xml 2007-04-27 12:57:39 UTC (rev
585)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.panel2</name>
+ <family>org.richfaces.panel2</family>
+ <classname>org.richfaces.component.html.HtmlPanel2</classname>
+ <superclass>org.richfaces.component.UIPanel2</superclass>
+ <test>
+ <classname>org.richfaces.component.html.HtmlPanel2ComponentTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+ <description>
+ <![CDATA[A skinnable panel that is rendered as a bordered rectangle. The header is
+ added using a facet with the attribute, name="header".
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.Panel2Renderer</name>
+ <template>panel2.jspx</template>
+ </renderer>
+ <tag>
+ <name>panel2</name>
+ <classname>org.richfaces.taglib.Panel2Tag</classname>
+ <superclass>
+ org.ajax4jsf.framework.taglib.HtmlComponentTagBase
+ </superclass>
+ <test>
+ <classname>org.richfaces.taglib.HtmlPanel2TagTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+
+ </tag>
+ &ui_component_attributes;
+ &html_events;
+ &html_style_attributes;
+ <property>
+ <name>headerClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ A class that defines a style for a panel header
+ </description>
+ </property>
+ <property>
+ <name>bodyClass</name>
+ <classname>java.lang.String</classname>
+ <description>
+ A class that defines a style for a panel content
+ </description>
+ </property>
+ </component>
+</components>
Added: trunk/sandbox/panel2/src/main/java/org/richfaces/component/UIPanel2.java
===================================================================
--- trunk/sandbox/panel2/src/main/java/org/richfaces/component/UIPanel2.java
(rev 0)
+++ trunk/sandbox/panel2/src/main/java/org/richfaces/component/UIPanel2.java 2007-04-27
12:57:39 UTC (rev 585)
@@ -0,0 +1,35 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIPanel2 extends UIComponentBase
+{
+ public boolean getRendersChildren() {
+ return true;
+ }
+}
Added:
trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/html/css/panel2.xcss
===================================================================
--- trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/html/css/panel2.xcss
(rev 0)
+++
trunk/sandbox/panel2/src/main/resources/org/richfaces/renderkit/html/css/panel2.xcss 2007-04-27
12:57:39 UTC (rev 585)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:verbatim>
+<![CDATA[
+.dr-pnl{
+ width: 100%;
+}
+
+.dr-pnl1{
+ border-width: 1px;
+ border-style: solid;
+ padding : 1px;
+}
+
+.dr-pnl-h{
+ padding : 2px;
+ border-width: 1px;
+ border-style: solid;
+ background-position : top left;
+ background-repeat : repeat-x;
+}
+
+.dr-pnl-b{
+ padding : 10px;
+}
+]]>
+</f:verbatim>
+<u:selector name=".dr-pnl1">
+ <u:style name="background-color" skin="generalBackgroundColor"
/>
+ <u:style name="border-color" skin="panelBorderColor" />
+</u:selector>
+<u:selector name=".dr-pnl-h">
+ <u:style name="background-color" skin="headerBackgroundColor"
/>
+ <u:style name="border-color" skin="headerBackgroundColor" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="background-image" >
+ <f:resource f:key="org.richfaces.renderkit.html.GradientA"/>
+ </u:style>
+
+</u:selector>
+<u:selector name=".dr-pnl-b">
+ <u:style name="font-size" skin="generalSizeFont" />
+ <u:style name="color" skin="generalTextColor" />
+ <u:style name="font-family" skin="generalFamilyFont" />
+</u:selector>
+</f:template>
Added: trunk/sandbox/panel2/src/main/templates/panel2.jspx
===================================================================
--- trunk/sandbox/panel2/src/main/templates/panel2.jspx (rev 0)
+++ trunk/sandbox/panel2/src/main/templates/panel2.jspx 2007-04-27 12:57:39 UTC (rev 585)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+
xmlns:f="http://jsf.exadel.com/template"
+ xmlns:vcp="
http://jsf.exadel.com/vcp"
+ xmlns:ui="
http://jsf.exadel.com/ui"
+ xmlns:x="
http://jsf.exadel.com/vcp"
+
xmlns:u="http://jsf.exadel.com/util"
+
xmlns:h="http://jsf.exadel.com/header"
+ baseclass="org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase"
+ class="org.richfaces.renderkit.html.Panel2Renderer">
+
+ <f:clientid var="clientId"/>
+ <h:styles>css/panel2.xcss</h:styles>
+ <div id="#{clientId}"
x:passThruWithExclusions="id,value,styleClass,class" class="dr-pnl
rich-panel #{component.attributes['styleClass']}">
+ <div class="dr-pnl1 rich-panel1">
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("header")!=null &&
component.getFacet("header").isRendered()) {]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}_header" class="dr-pnl-h rich-panel-header
#{component.attributes['headerClass']}">
+ <u:insertFacet name="header" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}_body" class="dr-pnl-b rich-panel-body
#{component.attributes['bodyClass']}">
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ </div>
+ </div>
+ </div>
+</f:root>
Added:
trunk/sandbox/panel2/src/test/java/org/richfaces/component/html/HtmlPanel2Test.java
===================================================================
--- trunk/sandbox/panel2/src/test/java/org/richfaces/component/html/HtmlPanel2Test.java
(rev 0)
+++
trunk/sandbox/panel2/src/test/java/org/richfaces/component/html/HtmlPanel2Test.java 2007-04-27
12:57:39 UTC (rev 585)
@@ -0,0 +1,34 @@
+package org.richfaces.component.html;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import junit.framework.TestCase;
+
+public class HtmlPanel2Test extends AbstractAjax4JsfTestCase {
+
+ public HtmlPanel2Test(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testSaveStateFacesContext() {
+ HtmlPanel2 panel = new HtmlPanel2();
+ panel.setBodyClass("panelBodyClass");
+ panel.setHeaderClass("headerClass");
+ Object state = panel.saveState(facesContext);
+ HtmlPanel2 newPanel = new HtmlPanel2();
+ newPanel.restoreState(facesContext, state);
+ assertEquals("panelBodyClass", newPanel.getBodyClass());
+ assertEquals("headerClass", newPanel.getHeaderClass());
+ }
+
+}
Added: trunk/sandbox/panel2/src/test/java/org/richfaces/taglib/Panel2TagTest.java
===================================================================
--- trunk/sandbox/panel2/src/test/java/org/richfaces/taglib/Panel2TagTest.java
(rev 0)
+++ trunk/sandbox/panel2/src/test/java/org/richfaces/taglib/Panel2TagTest.java 2007-04-27
12:57:39 UTC (rev 585)
@@ -0,0 +1,96 @@
+/**
+ *
+ */
+package org.richfaces.taglib;
+
+import java.io.IOException;
+import java.util.Enumeration;
+
+import javax.faces.webapp.UIComponentTag;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.el.ExpressionEvaluator;
+import javax.servlet.jsp.el.VariableResolver;
+import javax.servlet.jsp.tagext.Tag;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.html.HtmlPanel2;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Panel2TagTest extends AbstractAjax4JsfTestCase {
+
+ Panel2Tag panelTag;
+
+
+ /**
+ * @param name
+ */
+ public Panel2TagTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ panelTag = new Panel2Tag();
+ panelTag.setParent(new UIComponentTag(){
+
+ public String getComponentType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getRendererType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public int doStartTag() throws JspException {
+ // TODO Auto-generated method stub
+ return Tag.EVAL_BODY_INCLUDE;
+ }
+
+ public int doEndTag() throws JspException {
+ // TODO Auto-generated method stub
+ return Tag.EVAL_BODY_INCLUDE;
+ }
+
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+ panelTag = null;
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.taglib.PanelTag#setProperties(javax.faces.component.UIComponent)}.
+ * @throws JspException
+ */
+ public void testSetPropertiesUIComponent() throws JspException {
+ HtmlPanel2 panel = new HtmlPanel2();
+ panelTag.setBodyClass("panel");
+ panelTag.setHeaderClass("headClass");
+ panelTag.setProperties(panel);
+ assertEquals("panel", panel.getBodyClass());
+ assertEquals("headClass", panel.getHeaderClass());
+ }
+
+}
Added: trunk/sandbox/panel2/src/test/resources/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/panel2/src/test/resources/WEB-INF/web.xml (rev
0)
+++ trunk/sandbox/panel2/src/test/resources/WEB-INF/web.xml 2007-04-27 12:57:39 UTC (rev
585)
@@ -0,0 +1,72 @@
+<?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>testcase</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+
+ <filter>
+ <description>Convert HTML to XML</description>
+ <display-name>Filter</display-name>
+ <filter-name>A4J</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>publicid</param-name>
+ <param-value>-//W3C//DTD XHTML 1.0 Transitional//EN</param-value>
+ </init-param>
+ <init-param>
+ <param-name>systemid</param-name>
+
<
param-value>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd<...
+ </init-param>
+ <init-param>
+ <param-name>namespace</param-name>
+ <
param-value>http://www.w3.org/1999/xhtml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>forceparser</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>rewriteid</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>mime-type</param-name>
+ <param-value>text/xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>log4j-init-file</param-name>
+ <param-value>WEB-INF/log4j.xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>enable-cache</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>A4J</filter-name>
+ <url-pattern>*.jsf</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>A4J</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <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>*.jsf</url-pattern>
+ </servlet-mapping>
+</web-app>