Author: ppitonak(a)redhat.com
Date: 2010-07-21 08:07:44 -0400 (Wed, 21 Jul 2010)
New Revision: 18164
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelBean.properties
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/customLook.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/list.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/nested.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/simple.xhtml
root/tests/metamer/trunk/application/src/main/webapp/resources/css/richPanel.css
Modified:
root/tests/metamer/trunk/application/pom.xml
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css
Log:
* added rich:panel (3 pages)
* header's css update
* class Attributes made serializable
Modified: root/tests/metamer/trunk/application/pom.xml
===================================================================
--- root/tests/metamer/trunk/application/pom.xml 2010-07-20 16:43:58 UTC (rev 18163)
+++ root/tests/metamer/trunk/application/pom.xml 2010-07-21 12:07:44 UTC (rev 18164)
@@ -63,6 +63,11 @@
<artifactId>richfaces-ui-iteration-impl</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
+ </dependency>
+
<!-- Java Server Faces 2 -->
<dependency>
<groupId>${jsf2.api.groupid}</groupId>
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2010-07-20
16:43:58 UTC (rev 18163)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2010-07-21
12:07:44 UTC (rev 18164)
@@ -24,6 +24,7 @@
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -56,8 +57,9 @@
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
-public final class Attributes implements Map<String, Attribute> {
+public final class Attributes implements Map<String, Attribute>, Serializable {
+ private static final long serialVersionUID = -1L;
private Logger logger;
// K - name of a component attribute, V - value of the component attribute
private Map<String, Attribute> attributes;
@@ -359,7 +361,7 @@
// if select options for "action" are defined in property file
if (hasSelectOptions("action")) {
method =
- getExpressionFactory().createMethodExpression(elContext,
getMethodEL(outcome), String.class,
+ getExpressionFactory().createMethodExpression(elContext,
getMethodEL(outcome), String.class,
new Class[0]);
return (String) method.invoke(elContext, null);
@@ -392,7 +394,7 @@
// if no select options for "actionListener" are defined in property
file and it is an EL expression
if (!hasSelectOptions("actionListener") &&
isStringEL(listener)) {
method =
- getExpressionFactory().createMethodExpression(elContext, listener,
void.class,
+ getExpressionFactory().createMethodExpression(elContext, listener,
void.class,
new Class[]{ActionEvent.class});
method.invoke(elContext, new Object[]{event});
}
@@ -400,7 +402,7 @@
// if select options for "actionListener" are defined in property file
if (hasSelectOptions("actionListener")) {
method =
- getExpressionFactory().createMethodExpression(elContext,
getMethodEL(listener), void.class,
+ getExpressionFactory().createMethodExpression(elContext,
getMethodEL(listener), void.class,
new Class[]{ActionEvent.class});
method.invoke(elContext, new Object[]{event});
}
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-07-20
16:43:58 UTC (rev 18163)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-07-21
12:07:44 UTC (rev 18164)
@@ -107,6 +107,7 @@
components.put("richDataTable", "Rich Data Table");
components.put("richExtendedDataTable", "Rich Extended Data
Table");
components.put("richList", "Rich List");
+ components.put("richPanel", "Rich Panel");
}
private void createSkinList() {
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java 2010-07-21
12:07:44 UTC (rev 18164)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import org.richfaces.component.UIPanel;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelBean")
+@SessionScoped
+public class RichPanelBean implements Serializable {
+
+ private static final long serialVersionUID = 48122475400649801L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UIPanel.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+
+ // FIXME these attributes were not found automatically
+ attributes.setAttribute("bodyClass", null);
+ attributes.setAttribute("header", null);
+ attributes.setAttribute("headerClass", null);
+ attributes.setAttribute("onclick", null);
+ attributes.setAttribute("ondblclick", null);
+ attributes.setAttribute("onkeydown", null);
+ attributes.setAttribute("onkeypress", null);
+ attributes.setAttribute("onkeyup", null);
+ attributes.setAttribute("onmousedown", null);
+ attributes.setAttribute("onmousemove", null);
+ attributes.setAttribute("onmouseout", null);
+ attributes.setAttribute("onmouseover", null);
+ attributes.setAttribute("onmouseup", null);
+ attributes.setAttribute("style", null);
+ attributes.setAttribute("styleClass", null);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Added:
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelBean.properties
===================================================================
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/customLook.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/customLook.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/customLook.xhtml 2010-07-21
12:07:44 UTC (rev 18164)
@@ -0,0 +1,99 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:ta="http://java.sun.com/jsf/composite/testapp"
xmlns:pn="http://richfaces.org/output">
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css"
name="richPanel.css"/>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <style type="text/css">
+ .rf-panel-header {
+ color: fuchsia;
+ }
+
+ .panel {
+ vertical-align:top;
+ }
+
+ .top {
+ width:200px;height:100px;
+ }
+
+ .head2 {
+ background-image : url();
+ background-color : #4C9600;
+ height:18px;
+ text-align:center;
+ vertical-align:middle;
+ color:#CFF;
+ padding:4px 0;
+ }
+
+ .body3 {
+ height:100px;
+ overflow:auto;
+ }
+ </style>
+
+ <h:panelGrid columnClasses="panel" border="0"
columns="2">
+ <pn:panel id="panel1">
+ <f:facet name="header">
+ Panel #1. Changing Style Synchronously
+ </f:facet>
+ Each component in the RichFaces has a pre-defined set of classes you
can manipulate with. If defined, those
+ classes overwrite the ones come from the skin.
+ </pn:panel>
+
+ <pn:panel id="panel2">
+ <f:facet name="header">
+ Panel #2. Changing Style Synchronously
+ </f:facet>
+ In this example, we define header color using the .rf-panel-header
class and all panels located on the same page
+ inherit this color
+ </pn:panel>
+
+ </h:panelGrid>
+
+ <h:panelGrid columnClasses="panel" border="0"
columns="3">
+ <pn:panel id="panel3"
+
onmouseover="document.getElementById(this.id+'_header').style.background='#60BA01';document.getElementById(this.id+'_body').style.background='#F4FFF8'"
+
onmouseout="document.getElementById(this.id+'_header').style.background='#4C9600';document.getElementById(this.id+'_body').style.background='#E4FFC8'"
+ style="width:200px;" headerClass="head2"
bodyClass="body3">
+ <f:facet name="header">
+ Panel header
+ </f:facet>
+ Base on the previous layout, but some javascript behaviour added.
+ </pn:panel>
+
+ <pn:panel id="panel4" style="width:200px;"
bodyClass="body3">
+ <f:facet name="header">
+ Scrolling Text Panel
+ </f:facet>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec
+ ligula non metus dictum aliquet. Etiam non leo venenatis libero
mollis aliquet.
+ Vivamus in augue lorem. Donec sagittis pretium cursus. Vivamus id
arcu at dui
+ aliquam faucibus ut in neque. Nulla facilisi. Donec sed arcu et velit
egestas
+ condimentum ut ut sem. Quisque quis arcu est. Mauris nec metus congue
tortor
+ sagittis porta in in orci. Suspendisse iaculis ipsum non.
+ </pn:panel>
+ </h:panelGrid>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/list.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/list.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/list.xhtml 2010-07-21
12:07:44 UTC (rev 18164)
@@ -0,0 +1,22 @@
+<!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:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core">
+
+<h:head>
+ <title>Rich Toggle Panel</title>
+ <meta http-equiv="Content-Type" content="text/xhtml;
charset=UTF-8" />
+ <h:outputStylesheet library="css" name="list.css" />
+</h:head>
+
+<h:body>
+
+ <h:link outcome="simple" value="Simple"
styleClass="link"/>
+ <div class="description">Simple page that contains
<b>rich:togglePanel</b> and input boxes for all its attributes.</div>
+
+ <h:link outcome="nested" value="Nested Panels"
styleClass="link"/>
+ <div class="description">Page containing a
<b>rich:togglePanel</b> with two nested panels.</div>
+
+ <h:link outcome="customLook" value="Look Customization"
styleClass="link"/>
+ <div class="description">Page containing several
<b>rich:togglePanel</b>s testing stylesheet usage and skinnability
features.</div>
+</h:body>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/nested.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/nested.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/nested.xhtml 2010-07-21
12:07:44 UTC (rev 18164)
@@ -0,0 +1,57 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:ta="http://java.sun.com/jsf/composite/testapp"
xmlns:pn="http://richfaces.org/output">
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css"
name="richPanel.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <pn:panel id="outerPanel" header="outer panel">
+ <h:outputText id="contentOuter" value="content of outer
panel" style="font-size: x-large"/>
+
+ <h:panelGrid columns="2"
columnClasses="grid-content">
+ <pn:panel id="leftPanel" header="left inner
panel" styleClass="inner-panel">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras
sodales risus non sapien pulvinar
+ volutpat. Suspendisse ac neque neque. Aliquam erat volutpat.
Donec luctus nulla eget lectus vehicula
+ facilisis. Aenean non nisl nibh. Vestibulum odio metus, fermentum
nec placerat in, varius eu ligula.
+ Maecenas bibendum elit ut metus molestie sagittis. Aliquam erat
volutpat. Praesent eu nibh eu sapien
+ suscipit vulputate suscipit varius augue. Sed non lorem erat.
Vivamus ut magna sapien. In lacinia
+ pharetra mi viverra volutpat. Praesent rutrum cursus dui non
lobortis. Morbi nec sem eros. Proin
+ a libero diam, id laoreet risus. Ut sit amet risus elit. Nulla
facilisi.
+ </pn:panel>
+
+ <pn:panel id="rightPanel" header="right inner
panel" styleClass="inner-panel">
+ <ul>
+ <li>Lorem ipsum dolor sit amet, consectetur adipiscing
elit.</li>
+ <li>Mauris non velit sapien, nec varius
elit.</li>
+ <li>Phasellus in massa erat, vitae sagittis
massa.</li>
+ <li>Quisque consectetur tortor et ipsum pulvinar tempus
ac et diam.</li>
+ <li>Nulla posuere eros lectus, vitae rhoncus
elit.</li>
+ <li>In consequat turpis vel arcu adipiscing
euismod.</li>
+ <li>Integer et augue nec tellus vulputate porta quis
suscipit enim.</li>
+ <li>Fusce sit amet orci quis sapien dignissim
consectetur in eget leo.</li>
+ <li>Vestibulum auctor quam ultrices ligula congue
semper.</li>
+ </ul>
+ </pn:panel>
+ </h:panelGrid>
+ </pn:panel>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/simple.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richPanel/simple.xhtml 2010-07-21
12:07:44 UTC (rev 18164)
@@ -0,0 +1,81 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:ta="http://java.sun.com/jsf/composite/testapp"
xmlns:pn="http://richfaces.org/output">
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css"
name="richPanel.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <fieldset id="fieldsetHeader">
+ <legend>Panel with header</legend>
+
+ <pn:panel id="panelWithHeader"
+
bodyClass="#{richPanelBean.attributes['bodyClass'].value}"
+
header="#{richPanelBean.attributes['header'].value}"
+
headerClass="#{richPanelBean.attributes['headerClass'].value}"
+
onclick="#{richPanelBean.attributes['onclick'].value}"
+
ondblclick="#{richPanelBean.attributes['ondblclick'].value}"
+
onkeydown="#{richPanelBean.attributes['onkeydown'].value}"
+
onkeypress="#{richPanelBean.attributes['onkeypress'].value}"
+
onkeyup="#{richPanelBean.attributes['onkeyup'].value}"
+
onmousedown="#{richPanelBean.attributes['onmousedown'].value}"
+
onmousemove="#{richPanelBean.attributes['onmousemove'].value}"
+
onmouseout="#{richPanelBean.attributes['onmouseout'].value}"
+
onmouseover="#{richPanelBean.attributes['onmouseover'].value}"
+
onmouseup="#{richPanelBean.attributes['onmouseup'].value}"
+
rendered="#{richPanelBean.attributes['rendered'].value}"
+
style="#{richPanelBean.attributes['style'].value}"
+
styleClass="#{richPanelBean.attributes['styleClass'].value}">
+ <f:facet name="header">header of
panel</f:facet>
+
+ content of panel
+ </pn:panel>
+ </fieldset>
+
+ <br/>
+
+ <fieldset id="fieldsetWithoutHeader">
+ <legend>Panel without header</legend>
+
+ <pn:panel id="panelWithoutHeader"
+
bodyClass="#{richPanelBean.attributes['bodyClass'].value}"
+
header="#{richPanelBean.attributes['header'].value}"
+
headerClass="#{richPanelBean.attributes['headerClass'].value}"
+
onclick="#{richPanelBean.attributes['onclick'].value}"
+
ondblclick="#{richPanelBean.attributes['ondblclick'].value}"
+
onkeydown="#{richPanelBean.attributes['onkeydown'].value}"
+
onkeypress="#{richPanelBean.attributes['onkeypress'].value}"
+
onkeyup="#{richPanelBean.attributes['onkeyup'].value}"
+
onmousedown="#{richPanelBean.attributes['onmousedown'].value}"
+
onmousemove="#{richPanelBean.attributes['onmousemove'].value}"
+
onmouseout="#{richPanelBean.attributes['onmouseout'].value}"
+
onmouseover="#{richPanelBean.attributes['onmouseover'].value}"
+
onmouseup="#{richPanelBean.attributes['onmouseup'].value}"
+
rendered="#{richPanelBean.attributes['rendered'].value}"
+
style="#{richPanelBean.attributes['style'].value}"
+
styleClass="#{richPanelBean.attributes['styleClass'].value}">
+ content of panel
+ </pn:panel>
+
+ </fieldset>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <ta:attributes value="#{richPanelBean.attributes}"
id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css 2010-07-20
16:43:58 UTC (rev 18163)
+++
root/tests/metamer/trunk/application/src/main/webapp/resources/css/common.css 2010-07-21
12:07:44 UTC (rev 18164)
@@ -16,3 +16,6 @@
border-color: grey;
}
+a img {
+ border: 0px;
+}
\ No newline at end of file
Added: root/tests/metamer/trunk/application/src/main/webapp/resources/css/richPanel.css
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/resources/css/richPanel.css
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/resources/css/richPanel.css 2010-07-21
12:07:44 UTC (rev 18164)
@@ -0,0 +1,8 @@
+.grid-content {
+ vertical-align: top;
+}
+
+.inner-panel {
+ width: 400px;
+ height: 200px;
+}