Author: ilya_shaikovsky
Date: 2009-04-17 11:11:55 -0400 (Fri, 17 Apr 2009)
New Revision: 13640
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/layout/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/layout/Bean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/usage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintData.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage/sample.xhtml
trunk/samples/richfaces-demo/src/main/webapp/templates/page/template.xhtml
Log:
layout sample skeleton
paint2D and colorPicker fixed according to int support in picker
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/layout/Bean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/layout/Bean.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/layout/Bean.java 2009-04-17
15:11:55 UTC (rev 13640)
@@ -0,0 +1,86 @@
+/**
+ *
+ */
+package org.richfaces.demo.layout;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.richfaces.component.LayoutPosition;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Bean {
+
+ private String position="left";
+
+ private String theme = "simple";
+
+ private int width=960;
+
+ private int sidebarWidth=260;
+
+ /**
+ * @return the position
+ */
+ public String getPosition() {
+ return position;
+ }
+
+ /**
+ * @param position the position to set
+ */
+ public void setPosition(String position) {
+ this.position = position;
+ }
+
+ /**
+ * @return the width
+ */
+ public int getWidth() {
+ return width;
+ }
+
+ /**
+ * @param width the width to set
+ */
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ /**
+ * @return the sidebarWidth
+ */
+ public int getSidebarWidth() {
+ return sidebarWidth;
+ }
+
+ /**
+ * @param sidebarWidth the sidebarWidth to set
+ */
+ public void setSidebarWidth(int sidebarWidth) {
+ this.sidebarWidth = sidebarWidth;
+ }
+
+ /**
+ * @return the theme
+ */
+ public String getTheme() {
+ return theme;
+ }
+
+ /**
+ * @param theme the theme to set
+ */
+ public void setTheme(String theme) {
+ if("".equals(theme)){
+ theme = null;
+ }
+ this.theme = theme;
+ }
+}
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java 2009-04-17
15:07:41 UTC (rev 13639)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java 2009-04-17
15:11:55 UTC (rev 13640)
@@ -26,7 +26,7 @@
int x = 10;
int y = fontSize*5/2;
g2d.translate(x, y);
- Color color = new Color(Integer.parseInt(data.color.substring(1),16));
+ Color color = new Color(data.color);
g2d.setPaint(new Color(color.getRed(),color.getGreen(), color.getBlue(), 30));
AffineTransform origTransform = g2d.getTransform();
g2d.shear(-0.5*data.scale, 0);
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintData.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintData.java 2009-04-17
15:07:41 UTC (rev 13639)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintData.java 2009-04-17
15:11:55 UTC (rev 13640)
@@ -8,12 +8,14 @@
*/
private static final long serialVersionUID = 1L;
String text;
- String color;
+ Integer color;
float scale;
- public String getColor() {
+
+
+ public Integer getColor() {
return color;
}
- public void setColor(String color) {
+ public void setColor(Integer color) {
this.color = color;
}
public float getScale() {
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-04-17
15:07:41 UTC (rev 13639)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-04-17
15:11:55 UTC (rev 13640)
@@ -91,4 +91,5 @@
extendedDataTable= richDataIterators, Extended Data Table,
/images/ico_ExtendedDataTable.gif, /images/cn_ExtendedDataTable.gif,
extendedDataTable.html,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html,
/richfaces/extendedDataTable.jsf
editor=richInputs, Editor, /images/ico_Editor.gif,
/images/cn_Editor.gif, editor.html,
jbossrichfaces/freezone/docs/tlddoc/rich/editor.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEditor.html,
/richfaces/editor.jsf
queue=ajaxSupport, Queue, /images/ico_common.gif,
/images/cn_Queue.gif, Queue.html,
jbossrichfaces/freezone/docs/tlddoc/rich/queue.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIQueue.html,
/richfaces/queue.jsf
-colorPicker=colorPicker, richInputs, /images/ico_ColorPicker.gif,
/images/cn_ColorPicker.gif, ColorPicker.html,
jbossrichfaces/freezone/docs/tlddoc/rich/colorPicker.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColorPicker.html,
/richfaces/colorPicker.jsf, new
\ No newline at end of file
+colorPicker= richInputs, Color Picker, /images/ico_ColorPicker.gif,
/images/cn_ColorPicker.gif, ColorPicker.html,
jbossrichfaces/freezone/docs/tlddoc/rich/colorPicker.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColorPicker.html,
/richfaces/colorPicker.jsf, new
+layouts= richMisc, Layouts, /images/ico_Layouts.gif,
/images/cn_Layouts.gif, Layouts.html,
jbossrichfaces/freezone/docs/tlddoc/rich/Page.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIPage.html,
/richfaces/layouts.jsf, new
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-04-17
15:07:41 UTC (rev 13639)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-04-17
15:11:55 UTC (rev 13640)
@@ -198,8 +198,8 @@
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>color</property-name>
- <property-class>java.lang.String</property-class>
- <value>#3E8</value>
+ <property-class>java.lang.Integer</property-class>
+ <value>1000</value>
</managed-property>
<managed-property>
<property-name>scale</property-name>
@@ -407,8 +407,8 @@
<managed-bean-class>org.richfaces.demo.extendedDataTable.ExtendedTableBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
- <property-name>capitals</property-name>
- <value>#{capitalsBean.capitals}</value>
+ <property-name>capitals</property-name>
+ <value>#{capitalsBean.capitals}</value>
</managed-property>
</managed-bean>
<managed-bean>
@@ -431,6 +431,11 @@
<managed-bean-class>org.richfaces.demo.ajaxsupport.SelectsBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>layoutBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.layout.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage/sample.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage/sample.xhtml 2009-04-17
15:07:41 UTC (rev 13639)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage/sample.xhtml 2009-04-17
15:11:55 UTC (rev 13640)
@@ -12,9 +12,10 @@
</rich:paint2D>
<h:panelGroup>
<h:outputText value="Change text color " />
- <rich:colorPicker colorMode="hex"
value="#{paintData.color}"/>
+ <rich:colorPicker colorMode="hex"
value="#{paintData.color}">
+ <a4j:support event="onsubmit" reRender="painter"/>
+ </rich:colorPicker>
</h:panelGroup>
</h:panelGrid>
- <a4j:commandButton value="Update Image" reRender="painter"/>
</h:form>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage.xhtml 2009-04-17
15:07:41 UTC (rev 13639)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/colorPicker/usage.xhtml 2009-04-17
15:11:55 UTC (rev 13640)
@@ -9,7 +9,9 @@
<ui:define name="sample">
<p>
- Description
+ Color Picker is a simple wrapper for JQuerry widget.
+ It has the same functionality and events. Also widget additionally
+ skinned using standard RF principles.
</p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">ColorPicker Demo</legend>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/usage.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts/usage.xhtml 2009-04-17
15:11:55 UTC (rev 13640)
@@ -0,0 +1,19 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <p>
+ Description
+ </p>
+
+ <h:outputLink target="blank"
value="#{facesContext.externalContext.requestContextPath}/templates/page/template.jsf">Open
sample built with layouts components</h:outputLink>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/layouts.xhtml 2009-04-17
15:11:55 UTC (rev 13640)
@@ -0,0 +1,13 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Layouts</ui:define>
+ <ui:define name="body">
+ <ui:include src="/templates/include/tab-panel.xhtml" />
+ </ui:define>
+</ui:composition>
+</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/templates/page/template.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/templates/page/template.xhtml 2009-04-17
15:07:41 UTC (rev 13639)
+++ trunk/samples/richfaces-demo/src/main/webapp/templates/page/template.xhtml 2009-04-17
15:11:55 UTC (rev 13640)
@@ -1,30 +1,80 @@
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+<rich:page
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
-
xmlns:a4j="http://richfaces.org/a4j">
-
-<rich:page width="800" sidebarWidth="100">
+
xmlns:a4j="http://richfaces.org/a4j" markupType="xhtml"
+ contentType="text/html" theme="#{layoutBean.theme}"
+ width="#{layoutBean.width}"
sidebarWidth="#{layoutBean.sidebarWidth}"
+ sidebarPosition="#{layoutBean.position}">
+ <style>
+.rich-page-header {
+ padding: 0;
+ margin: 0;
+ background: none;
+}
+</style>
<f:facet name="sidebar">
- <h:outputText value="Menu Goes here" />
+ <h:form>
+ <h2>Page Attributes</h2>
+ <h:panelGrid columns="2">
+ <h:outputLabel for="theme" value="Page Theme" />
+ <h:selectOneMenu id="theme" style="width:100px"
+ value="#{layoutBean.theme}">
+ <f:selectItem itemValue="" itemLabel="Default" />
+ <f:selectItem itemValue="simple" itemLabel="Simple" />
+ <f:selectItem itemValue="violetRays" itemLabel="Violet Rays"
/>
+ <f:selectItem itemValue="theme1" itemLabel="Theme One" />
+ <f:selectItem itemValue="theme2" itemLabel="Theme Two" />
+ </h:selectOneMenu>
+ <h:outputLabel for="width" value="Page Width" />
+ <h:inputText id="width" value="#{layoutBean.width}" />
+ <h:outputLabel for="sidebarwidth" value="Sidebar Width" />
+ <h:inputText id="sidebarwidth"
value="#{layoutBean.sidebarWidth}" />
+ <h:outputLabel for="position" value="Side bar position" />
+ <h:selectOneMenu value="#{layoutBean.position}"
id="position">
+ <f:selectItem itemValue="left" />
+ <f:selectItem itemValue="right" />
+ </h:selectOneMenu>
+ <h:outputLabel for="skin" value="Current skin" />
+ <h:selectOneMenu value="#{skinBean.skin}" id="skin">
+ <f:selectItem itemValue="blueSky" itemLabel="blueSky" />
+ <f:selectItem itemValue="ruby" itemLabel="ruby" />
+ <f:selectItem itemValue="emeraldTown" itemLabel="emeraldTown"
/>
+ </h:selectOneMenu>
+ <h:commandButton value="Change"></h:commandButton>
+ </h:panelGrid>
+ </h:form>
</f:facet>
<f:facet name="header">
- <h:outputText value="Header" />
+ <rich:toolBar height="50px">
+ <f:verbatim>
+ <h2>RichFaces Layouts</h2>
+ </f:verbatim>
+ <rich:toolBarGroup location="right">
+ <h:outputLink value="#">Developer Guide</h:outputLink>
+ <h:outputLink value="#">Download RichFaces</h:outputLink>
+ <h:outputLink value="#">Support</h:outputLink>
+ </rich:toolBarGroup>
+ </rich:toolBar>
+
</f:facet>
<f:facet name="footer">
- <h:outputText value="Footer" />
+ <h:outputText
+ value="Copyright (c) 2009 RichFaces. All rights reserved. RichFaces version
#{environment.version}" />
</f:facet>
<rich:layout>
+ <rich:layoutPanel position="top" width="100%">
+ Common page information will be there.
+ </rich:layoutPanel>
<rich:layoutPanel position="left" width="33">
- <h:outputText value="left" />
+ <f:verbatim>Common layouts info will be there </f:verbatim>
</rich:layoutPanel>
<rich:layoutPanel position="center" width="33">
- <h:outputText value="center" />
+ <f:verbatim>More Layouts info will be there</f:verbatim>
</rich:layoutPanel>
<rich:layoutPanel position="right" width="33">
- <h:outputText value="right" />
+ <f:verbatim>Link to specification and so on will be there</f:verbatim>
</rich:layoutPanel>
</rich:layout>
</rich:page>
-</ui:composition>
\ No newline at end of file