[richfaces-svn-commits] JBoss Rich Faces SVN: r13354 - in trunk: samples/layout-sample/src/main/webapp/pages and 12 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Apr 1 20:05:10 EDT 2009


Author: alexsmirnov
Date: 2009-04-01 20:05:09 -0400 (Wed, 01 Apr 2009)
New Revision: 13354

Added:
   trunk/samples/themes/src/design/
   trunk/samples/themes/src/design/draw_direction_2.png
   trunk/samples/themes/src/design/images/
   trunk/samples/themes/src/design/images/bg_footer.png
   trunk/samples/themes/src/design/images/bg_footer_left.png
   trunk/samples/themes/src/design/images/bg_footer_right.png
   trunk/samples/themes/src/design/images/bg_grad_page.png
   trunk/samples/themes/src/design/images/bg_header.png
   trunk/samples/themes/src/design/images/bg_header_left.png
   trunk/samples/themes/src/design/images/bg_header_right.png
   trunk/samples/themes/src/design/images/bg_left.png
   trunk/samples/themes/src/design/images/bg_left_strut.png
   trunk/samples/themes/src/design/images/bg_page.png
   trunk/samples/themes/src/design/images/bg_right.png
   trunk/samples/themes/src/design/images/bg_right_strut.png
   trunk/samples/themes/src/design/images/spacer.gif
   trunk/samples/themes/src/design/page_1.css
   trunk/samples/themes/src/design/page_1.html
   trunk/samples/themes/src/design/page_2.css
   trunk/samples/themes/src/design/page_2.html
   trunk/samples/themes/src/design/temp_3000.psd
   trunk/samples/themes/src/main/java/META-INF/
   trunk/samples/themes/src/main/java/META-INF/MANIFEST.MF
Removed:
   trunk/samples/themes/src/main/java/org/richfaces/theme/App.java
   trunk/samples/themes/src/test/java/org/richfaces/theme/AppTest.java
Modified:
   trunk/samples/layout-sample/pom.xml
   trunk/samples/layout-sample/src/main/webapp/pages/index.xhtml
   trunk/samples/themes/pom.xml
   trunk/ui/layout/pom.xml
   trunk/ui/layout/src/main/config/component/layoutPanel.xml
   trunk/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java
   trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java
   trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java
Log:
Import Lex Dmitriev design.

Modified: trunk/samples/layout-sample/pom.xml
===================================================================
--- trunk/samples/layout-sample/pom.xml	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/samples/layout-sample/pom.xml	2009-04-02 00:05:09 UTC (rev 13354)
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
-<project>
+<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</groupId>
@@ -37,7 +38,7 @@
 		</dependency>
 		<dependency>
 			<groupId>org.richfaces.ui</groupId>
-			<artifactId>layout</artifactId>
+			<artifactId>richfaces-ui</artifactId>
 			<version>3.3.1-SNAPSHOT</version>
 		</dependency>
 		<dependency>
@@ -45,5 +46,16 @@
 			<artifactId>skins</artifactId>
 			<version>3.3.1-SNAPSHOT</version>
 		</dependency>
+		<dependency>
+			<groupId>org.richfaces.samples</groupId>
+			<artifactId>themes</artifactId>
+			<version>3.3.1-SNAPSHOT</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.richfaces.ui</groupId>
+					<artifactId>layout</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
 	</dependencies>
 </project>
\ No newline at end of file

Modified: trunk/samples/layout-sample/src/main/webapp/pages/index.xhtml
===================================================================
(Binary files differ)

Modified: trunk/samples/themes/pom.xml
===================================================================
--- trunk/samples/themes/pom.xml	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/samples/themes/pom.xml	2009-04-02 00:05:09 UTC (rev 13354)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project>
+<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">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<artifactId>samples</artifactId>
@@ -24,13 +24,6 @@
 							<goal>generate</goal>
 						</goals>
 					</execution>
-					<execution>
-						<id>generate-test-sources</id>
-						<phase>generate-test-sources</phase>
-						<goals>
-							<goal>generate-tests</goal>
-						</goals>
-					</execution>
 				</executions>
 			</plugin>
 		</plugins>

Added: trunk/samples/themes/src/design/draw_direction_2.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/draw_direction_2.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_footer.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_footer.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_footer_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_footer_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_footer_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_footer_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_grad_page.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_grad_page.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_header.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_header.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_header_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_header_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_header_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_header_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_left.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_left.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_left_strut.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_left_strut.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_page.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_page.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_right.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_right.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/bg_right_strut.png
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/bg_right_strut.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/images/spacer.gif
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/design/page_1.css
===================================================================
--- trunk/samples/themes/src/design/page_1.css	                        (rev 0)
+++ trunk/samples/themes/src/design/page_1.css	2009-04-02 00:05:09 UTC (rev 13354)
@@ -0,0 +1,22 @@
+.page_size{width : 90%;}
+.menu_width{width : 300px;}
+
+body {margin : 0px; background : url(images/bg_page.png) top left #93C4E5;}
+.common_box {margin : 0px; background : url(images/bg_grad_page.png) top left repeat-x;}
+.header_bg_left {background : url(images/bg_header_left.png) top left no-repeat;}
+.header_bg_right {background : url(images/bg_header_right.png) top right no-repeat; height : 105px;}
+.header_content {margin : 0px 10px 0px 10px; height : 80px; position : relative;}
+.spacer{font-size : 1px;}
+.left_col {background : url(images/bg_left.png) top left no-repeat; vertical-align : top}
+.left_strut {background : url(images/bg_left_strut.png) top left no-repeat; height : 389px; width : 14px}
+.bg_tabbody {background : #c0c0c0}
+
+.menu_col {border-right : 2px solid #C0C0C0; vertical-align : top; background : #FFFFFF;}
+.content_col {vertical-align : top; width : 100%; background : #FFFFFF;}
+
+.right_col {background : url(images/bg_right.png) top right no-repeat; vertical-align : top}
+.right_strut {background : url(images/bg_right_strut.png) top right no-repeat; height : 389px; width : 14px}
+.footer_bg_left {background : url(images/bg_footer_left.png) top left no-repeat;}
+.footer_bg_right {background : url(images/bg_footer_right.png) top right no-repeat; height : 72px;}
+.footer_bg_content {margin : 0px 10px 0px 10px; height : 53px; position : relative;}
+


Property changes on: trunk/samples/themes/src/design/page_1.css
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/samples/themes/src/design/page_1.html
===================================================================
--- trunk/samples/themes/src/design/page_1.html	                        (rev 0)
+++ trunk/samples/themes/src/design/page_1.html	2009-04-02 00:05:09 UTC (rev 13354)
@@ -0,0 +1,74 @@
+<html>
+<head>
+<title></title>
+<link rel="STYLESHEET" type="text/css" href="page_1.css">
+</head>
+
+<body>
+
+<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
+	<tr>
+		<td align="center" class="common_box">
+
+			<table height="100%" border="0" cellpadding="0" cellspacing="0" class="page_size">
+				<tr>
+					<td colspan="3" class="header_bg_left">
+						<div class="header_bg_right">
+							<div class="spacer" style="height : 15px"></div>
+							<div class="header_content">
+<!-- begin header -->
+									<br>
+<!-- end header -->
+							</div>
+						</div>
+					</td>
+				</tr>
+				<tr>
+					<td class="left_col">
+						<div class="left_strut">
+							<br>
+						</div>
+					</td>
+					<td width="100%" height="100%" class="bg_tabbody">
+						<table cellpadding="0" cellspacing="0" border="0"  width="100%" height="100%">
+							<tr>
+								<td class="menu_col">
+									<div class="menu_width spacer"></div>
+<!-- begin menu -->
+									<br>
+<!-- end meny -->
+								</td>
+								<td class="content_col">
+<!-- begin content -->
+									<br>
+<!-- end content -->
+								</td>
+							</tr>
+						</table>
+					</td>
+					<td class="right_col">
+						<div class="right_strut">
+							<br>
+						</div>
+					</td>
+				</tr>
+				<tr>
+					<td colspan="3" class="footer_bg_left">
+						<div class="footer_bg_right">
+							<div class="footer_bg_content">
+<!-- begin footer -->
+									<br>
+<!-- end footer -->
+								
+							</div>
+						</div>
+					</td>
+				</tr>
+			</table>
+
+		</td>
+	</tr>
+</table>
+
+</body>
+</html>
\ No newline at end of file


Property changes on: trunk/samples/themes/src/design/page_1.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/samples/themes/src/design/page_2.css
===================================================================
--- trunk/samples/themes/src/design/page_2.css	                        (rev 0)
+++ trunk/samples/themes/src/design/page_2.css	2009-04-02 00:05:09 UTC (rev 13354)
@@ -0,0 +1,65 @@
+.menu_width{width : 300px;}
+
+body {
+	margin : 0px; 
+	background : #f1f1f1;  /*generalBackgroundColor*/
+}
+
+.page_size {
+	width : 100%; 
+	height : 100%;
+}
+
+.header_bg {
+	background : url(images/bg_header.png) top left repeat-x #005000; /*headerBackgroundColor*/
+	border-bottom : 1px solid #f1f1f1;  /*generalBackgroundColor*/
+}
+
+.header_content {
+	margin : 0px 0px 0px 0px; 
+	height : 95px; position : relative;
+}
+
+.spacer{font-size : 1px;}
+
+.menu_col {
+	border-right : 2px solid #C0C0C0;  /*panelBorderColor*/
+	border-top : 2px solid #C0C0C0;  /*panelBorderColor*/
+	border-bottom : 2px solid #C0C0C0;  /*panelBorderColor*/
+	vertical-align : top; 
+	background : #f1f1f1;  /*generalBackgroundColor*/
+}
+
+.content_col {
+	border-top : 2px solid #C0C0C0;  /*panelBorderColor*/
+	border-bottom : 2px solid #C0C0C0;  /*panelBorderColor*/
+	vertical-align : top; 
+	width : 100%; 
+	background : #f1f1f1;  /*generalBackgroundColor*/
+}
+
+*.menu_col, *.content_col, *.footer_bg {
+	color : #000000; /*generalTextColor*/
+	font-size : 11px; /*generalSizeFont*/
+	font-family : Arial, Verdana, sans-serif ; /*generalFamilyFont*/
+	
+}
+
+*.header_content {
+	color : #FFFFFF; /*headerTextColor*/
+	font-size : 12px; /*headerSizeFont*/
+	font-family : Arial, Verdana, sans-serif ; /*headerFamilyFont*/
+	
+}
+
+.footer_bg {
+	border-top : 1px solid #f1f1f1;  /*generalBackgroundColor*/
+	background : url(images/bg_footer.png) top left  repeat-x #c0c0c0;  /*panelBorderColor*/
+}
+
+.footer_bg_content {
+	margin : 0px 0px 0px 0px; 
+	height : 45px; 
+	position : relative;
+}
+


Property changes on: trunk/samples/themes/src/design/page_2.css
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/samples/themes/src/design/page_2.html
===================================================================
--- trunk/samples/themes/src/design/page_2.html	                        (rev 0)
+++ trunk/samples/themes/src/design/page_2.html	2009-04-02 00:05:09 UTC (rev 13354)
@@ -0,0 +1,50 @@
+<html>
+<head>
+<title></title>
+<link rel="STYLESHEET" type="text/css" href="page_2.css">
+</head>
+
+<body>
+
+			<table border="0" cellpadding="0" cellspacing="0" class="page_size">
+				<tr>
+					<td class="header_bg">
+							<div class="header_content">
+<!-- begin header -->
+									<br>
+<!-- end header -->
+							</div>
+					</td>
+				</tr>
+				<tr>
+					<td width="100%" height="100%" class="bg_tabbody">
+						<table cellpadding="0" cellspacing="0" border="0"  width="100%" height="100%">
+							<tr>
+								<td class="menu_col">
+									<div class="menu_width spacer"></div>
+<!-- begin menu -->
+									<br>
+<!-- end meny -->
+								</td>
+								<td class="content_col">
+<!-- begin content -->
+									<br>
+<!-- end content -->
+								</td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td class="footer_bg">
+						<div class="footer_bg_content">
+<!-- begin footer -->
+									<br>
+<!-- end footer -->
+						</div>
+					</td>
+				</tr>
+			</table>
+
+</body>
+</html>
\ No newline at end of file


Property changes on: trunk/samples/themes/src/design/page_2.html
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/samples/themes/src/design/temp_3000.psd
===================================================================
(Binary files differ)


Property changes on: trunk/samples/themes/src/design/temp_3000.psd
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/samples/themes/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/themes/src/main/java/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/samples/themes/src/main/java/META-INF/MANIFEST.MF	2009-04-02 00:05:09 UTC (rev 13354)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+


Property changes on: trunk/samples/themes/src/main/java/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: trunk/samples/themes/src/main/java/org/richfaces/theme/App.java
===================================================================
--- trunk/samples/themes/src/main/java/org/richfaces/theme/App.java	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/samples/themes/src/main/java/org/richfaces/theme/App.java	2009-04-02 00:05:09 UTC (rev 13354)
@@ -1,13 +0,0 @@
-package org.richfaces.theme;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

Deleted: trunk/samples/themes/src/test/java/org/richfaces/theme/AppTest.java
===================================================================
--- trunk/samples/themes/src/test/java/org/richfaces/theme/AppTest.java	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/samples/themes/src/test/java/org/richfaces/theme/AppTest.java	2009-04-02 00:05:09 UTC (rev 13354)
@@ -1,38 +0,0 @@
-package org.richfaces.theme;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}

Modified: trunk/ui/layout/pom.xml
===================================================================
--- trunk/ui/layout/pom.xml	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/ui/layout/pom.xml	2009-04-02 00:05:09 UTC (rev 13354)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<project>
+<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">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <artifactId>ui</artifactId>
@@ -50,10 +50,5 @@
       <artifactId>richfaces-impl</artifactId>
       <version>3.3.1-SNAPSHOT</version>
     </dependency>
-    <dependency>
-    	<groupId>org.richfaces.ui</groupId>
-    	<artifactId>core</artifactId>
-    	<version>3.3.1-SNAPSHOT</version>
-    </dependency>
   </dependencies>
 </project>

Modified: trunk/ui/layout/src/main/config/component/layoutPanel.xml
===================================================================
--- trunk/ui/layout/src/main/config/component/layoutPanel.xml	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/ui/layout/src/main/config/component/layoutPanel.xml	2009-04-02 00:05:09 UTC (rev 13354)
@@ -35,6 +35,13 @@
 			<description>
 			</description>
 		</property>
+
+		<property>
+			<name>width</name>
+			<classname>java.lang.String</classname>
+			<description>
+			</description>
+		</property>
        
 	</component>
 </components>

Modified: trunk/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java
===================================================================
--- trunk/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/ui/layout/src/main/java/org/richfaces/component/UILayoutPanel.java	2009-04-02 00:05:09 UTC (rev 13354)
@@ -29,4 +29,17 @@
 	public abstract void setPosition(LayoutPosition newvalue);
 
 
+	/**
+	 * Get Panel width.
+	 * @return
+	 */
+	public abstract String getWidth();
+
+	/**
+	 * Set Panel width.
+	 * @param newvalue
+	 */
+	public abstract void setWidth(String newvalue);
+
+
 }

Modified: trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java
===================================================================
--- trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractLayoutRenderer.java	2009-04-02 00:05:09 UTC (rev 13354)
@@ -18,12 +18,13 @@
 
 /**
  * @author asmirnov
- *
+ * 
  */
 public abstract class AbstractLayoutRenderer extends
 		HeaderResourcesRendererBase {
 
-	public void renderLayout(FacesContext context, UILayout layout) throws IOException {
+	public void renderLayout(FacesContext context, UILayout layout)
+			throws IOException {
 		// Detect layout content;
 		UILayoutPanel top = null;
 		UILayoutPanel bottom = null;
@@ -35,80 +36,115 @@
 			if (child instanceof UILayoutPanel) {
 				UILayoutPanel layoutPanel = (UILayoutPanel) child;
 				LayoutPosition position = layoutPanel.getPosition();
-				if( LayoutPosition.top.equals(position)){
-					if(null != top){
-						throw new FacesException("Duplicate layoutPanel's with same position"+position);
+				if (LayoutPosition.top.equals(position)) {
+					if (null != top) {
+						throw new FacesException(
+								"Duplicate layoutPanel's with same position"
+										+ position);
 					}
 					top = layoutPanel;
-				} else if( LayoutPosition.bottom.equals(position)){
-					if(null != bottom){
-						throw new FacesException("Duplicate layoutPanel's with same position"+position);
+				} else if (LayoutPosition.bottom.equals(position)) {
+					if (null != bottom) {
+						throw new FacesException(
+								"Duplicate layoutPanel's with same position"
+										+ position);
 					}
 					bottom = layoutPanel;
-				} else if( LayoutPosition.left.equals(position)){
-					if(null != left){
-						throw new FacesException("Duplicate layoutPanel's with same position"+position);
+				} else if (LayoutPosition.left.equals(position)) {
+					if (null != left) {
+						throw new FacesException(
+								"Duplicate layoutPanel's with same position"
+										+ position);
 					}
 					left = layoutPanel;
 					columns++;
-				} else if( LayoutPosition.right.equals(position)){
-					if(null != right){
-						throw new FacesException("Duplicate layoutPanel's with same position"+position);
+				} else if (LayoutPosition.right.equals(position)) {
+					if (null != right) {
+						throw new FacesException(
+								"Duplicate layoutPanel's with same position"
+										+ position);
 					}
 					right = layoutPanel;
 					columns++;
-				} else if( null == position || LayoutPosition.center.equals(position)){
-					if(null != center){
-						throw new FacesException("Duplicate layoutPanel's with same position"+position);
+				} else if (null == position
+						|| LayoutPosition.center.equals(position)) {
+					if (null != center) {
+						throw new FacesException(
+								"Duplicate layoutPanel's with same position"
+										+ position);
 					}
 					center = layoutPanel;
 					columns++;
 				} else {
-					
+
 				}
 			}
 		}
-		if(columns>0 && null == center){
-			throw new FacesException("Center layout panel for multi-column layout is not defined");			
-		}
 		ResponseWriter writer = context.getResponseWriter();
-		if(null != top){
+		if (null != top) {
 			renderChild(context, top);
 		}
-		if(columns>1){
-			// Render Y! CSS Grid
-			writer.startElement(HTML.DIV_ELEM, layout);
-			// calculate class.
-			String yahooClass = "yui-g";
-			if(columns >2){
-				yahooClass = "yui-gb";
-			} else {
-				Object width = center.getAttributes().get("width");
-				if("75%".equals(width)){
-					yahooClass = "yui-gc";
-				} else if("66%".equals(width)){
-					yahooClass = "yui-gd";
+		if (columns > 0) {
+			// Reorder panels to fill ordeg left->center->right.
+			if (null == left) {
+				if (null == center) {
+					left = right;
+					right = null;
+				} else {
+					left = center;
+					center = right;
+					right = null;
 				}
+			} else if (null == center) {
+				center = right;
+				right = null;
 			}
-			writer.writeAttribute(HTML.class_ATTRIBUTE, yahooClass, null);
-			if(null != left){
+			if (columns > 1) {
+				// Render Y! CSS Grid
+				writer.startElement(HTML.DIV_ELEM, layout);
+				// calculate class.
+				String yahooClass = calculateLayoutClass(left, right, center);
+				writer.writeAttribute(HTML.class_ATTRIBUTE, yahooClass, null);
 				left.getAttributes().put("first", "first");
 				center.getAttributes().remove("first");
 				renderChild(context, left);
+				renderChild(context, center);
+				if (null != right) {
+					right.getAttributes().remove("first");
+					renderChild(context, right);
+				}
+				writer.endElement(HTML.DIV_ELEM);
 			} else {
-				center.getAttributes().put("first", "first");
+				renderChild(context, left);
 			}
-			renderChild(context, center);
-			if(null != right){
-				right.getAttributes().remove("first");
-				renderChild(context, right);				
-			}
-			writer.endElement(HTML.DIV_ELEM);
-		} else if (columns == 1) {
-			renderChild(context, center);			
 		}
-		if(null != bottom){
+		if (null != bottom) {
 			renderChild(context, bottom);
 		}
 	}
+
+	/**
+	 * @param left
+	 * @param right
+	 * @param center
+	 * @return
+	 */
+	protected String calculateLayoutClass(UILayoutPanel left,
+			UILayoutPanel right, UILayoutPanel center) {
+		String yahooClass = "yui-g";
+		if (null != left && null != right && null != center) {
+			// We have only equal size for an three-column layout.
+			yahooClass = "yui-gb";
+		} else if(null != left && null != center){
+			String leftWidth = left.getWidth();
+			String centerWidth = center.getWidth();
+			// Calculate properly class.
+			if ("75%".equals(leftWidth)) {
+				yahooClass = "yui-gc";
+			} else if ("66%".equals(leftWidth)) {
+				yahooClass = "yui-gd";
+			}
+		}
+		return yahooClass;
+	}
 }

Modified: trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java
===================================================================
--- trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java	2009-04-01 22:44:20 UTC (rev 13353)
+++ trunk/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java	2009-04-02 00:05:09 UTC (rev 13354)
@@ -12,10 +12,8 @@
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 
-import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
 import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
 import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.renderkit.html.AjaxPageRenderer;
 import org.richfaces.component.UIPage;
 import org.richfaces.skin.SkinFactory;
 import org.richfaces.skin.Theme;




More information about the richfaces-svn-commits mailing list