[richfaces-svn-commits] JBoss Rich Faces SVN: r18812 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Aug 19 09:15:27 EDT 2010


Author: ppitonak at redhat.com
Date: 2010-08-19 09:15:27 -0400 (Thu, 19 Aug 2010)
New Revision: 18812

Added:
   modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
   modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/
   modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/list.xhtml
   modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/simple.xhtml
Modified:
   modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-753

* added one page for rich:accordionItem


Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java	2010-08-19 13:15:27 UTC (rev 18812)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * 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.ViewScoped;
+import org.richfaces.component.html.HtmlAccordionItem;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:accordionItem.
+ *
+ * @author <a href="mailto:ppitonak at redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+ at ManagedBean(name = "richAccordionItemBean")
+ at ViewScoped
+public class RichAccordionItemBean implements Serializable {
+
+    private static final long serialVersionUID = -1L;
+    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(HtmlAccordionItem.class, getClass());
+
+        attributes.setAttribute("header", "Item 1");
+        attributes.setAttribute("name", "item1");
+        attributes.setAttribute("rendered", true);
+        
+    }
+
+    public Attributes getAttributes() {
+        return attributes;
+    }
+
+    public void setAttributes(Attributes attributes) {
+        this.attributes = attributes;
+    }
+}


Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
___________________________________________________________________
Name: svn:keywords
   + Revision

Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-19 12:49:29 UTC (rev 18811)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-19 13:15:27 UTC (rev 18812)
@@ -109,6 +109,7 @@
         components.put("commandButton", "JSF Command Button");
         components.put("hDataTable", "JSF Data Table");
         components.put("richAccordion", "Rich Accordion");
+        components.put("richAccordionItem", "Rich Accordion Item");
         components.put("richColumn", "Rich Column");
         components.put("richComponentControl", "Rich Component Control");
         components.put("richDataGrid", "Rich Data Grid");

Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/list.xhtml	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/list.xhtml	2010-08-19 13:15:27 UTC (rev 18812)
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+
+<!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:metamer="http://java.sun.com/jsf/composite/metamer">
+
+    <ui:composition template="/templates/list.xhtml">
+
+        <ui:define name="pageTitle">Rich Accordion Item</ui:define>
+
+        <ui:define name="links">
+
+            <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+                Simple page that contains an accordion with four <b>rich:accordionItem</b>s and input boxes for all attributes of one item.
+            </metamer:testPageLink>
+
+        </ui:define>
+
+    </ui:composition>
+
+</html>

Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/simple.xhtml	                        (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richAccordionItem/simple.xhtml	2010-08-19 13:15:27 UTC (rev 18812)
@@ -0,0 +1,131 @@
+<!--
+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.
+-->
+
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
+      xmlns:rich="http://richfaces.org/rich">
+
+    <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>
+        </ui:define>
+
+        <ui:define name="outOfTemplateBefore">
+        </ui:define>
+
+        <ui:define name="component">
+            <rich:accordion id="accordion" activeItem="item3">
+                <rich:accordionItem id="item1"
+                                    active="#{richAccordionItemBean.attributes['active'].value}"
+                                    contentClass="#{richAccordionItemBean.attributes['contentClass'].value}"
+                                    converter="#{richAccordionItemBean.attributes['converter'].value}"
+                                    dir="#{richAccordionItemBean.attributes['dir'].value}"
+                                    disabled="#{richAccordionItemBean.attributes['disabled'].value}"
+                                    header="#{richAccordionItemBean.attributes['header'].value}"
+                                    headerClass="#{richAccordionItemBean.attributes['headerClass'].value}"
+                                    headerClassActive="#{richAccordionItemBean.attributes['headerClassActive'].value}"
+                                    headerClassDisabled="#{richAccordionItemBean.attributes['headerClassDisabled'].value}"
+                                    headerClassInactive="#{richAccordionItemBean.attributes['headerClassInactive'].value}"
+                                    headerStyle="#{richAccordionItemBean.attributes['headerStyle'].value}"
+                                    lang="#{richAccordionItemBean.attributes['lang'].value}"
+                                    localValue="#{richAccordionItemBean.attributes['localValue'].value}"
+                                    name="#{richAccordionItemBean.attributes['name'].value}"
+                                    onclick="#{richAccordionItemBean.attributes['onclick'].value}"
+                                    ondblclick="#{richAccordionItemBean.attributes['ondblclick'].value}"
+                                    onenter="#{richAccordionItemBean.attributes['onenter'].value}"
+                                    onheaderclick="#{richAccordionItemBean.attributes['onheaderclick'].value}"
+                                    onheaderdblclick="#{richAccordionItemBean.attributes['onheaderdblclick'].value}"
+                                    onheadermousedown="#{richAccordionItemBean.attributes['onheadermousedown'].value}"
+                                    onheadermousemove="#{richAccordionItemBean.attributes['onheadermousemove'].value}"
+                                    onheadermouseup="#{richAccordionItemBean.attributes['onheadermouseup'].value}"
+                                    onleave="#{richAccordionItemBean.attributes['onleave'].value}"
+                                    onmousedown="#{richAccordionItemBean.attributes['onmousedown'].value}"
+                                    onmousemove="#{richAccordionItemBean.attributes['onmousemove'].value}"
+                                    onmouseout="#{richAccordionItemBean.attributes['onmouseout'].value}"
+                                    onmouseover="#{richAccordionItemBean.attributes['onmouseover'].value}"
+                                    onmouseup="#{richAccordionItemBean.attributes['onmouseup'].value}"
+                                    rendered="#{richAccordionItemBean.attributes['rendered'].value}"
+                                    style="#{richAccordionItemBean.attributes['style'].value}"
+                                    styleClass="#{richAccordionItemBean.attributes['styleClass'].value}"
+                                    switchType="#{richAccordionItemBean.attributes['switchType'].value}"
+                                    title="#{richAccordionItemBean.attributes['title'].value}"
+                                    value="#{richAccordionItemBean.attributes['value'].value}">
+                    content of item 1
+                </rich:accordionItem>
+                <rich:accordionItem id="item2" name="item2"  header="Item 2">
+                    content of item 2
+                </rich:accordionItem>
+                <rich:accordionItem id="item3" name="item3"  header="Item 3">
+                    content of item 3
+                </rich:accordionItem>
+                <rich:accordionItem id="item4" name="item4"  header="Item 4">
+                    content of item 4
+                </rich:accordionItem>
+            </rich:accordion>
+
+            <br/><br/>
+            <fieldset>
+                <legend>JavaScript API of rich:accordion</legend>
+
+                <h:commandButton id="switchButton1" value="switch to item1">
+                    <rich:componentControl id="componentControl1" event="click" operation="switchToItem" target="accordion" >
+                        <f:param value="item1" />
+                    </rich:componentControl>
+                </h:commandButton>
+                <h:commandButton id="switchButton2" value="switch to item2">
+                    <rich:componentControl id="componentControl2" event="click" operation="switchToItem" target="accordion" >
+                        <f:param value="item2" />
+                    </rich:componentControl>
+                </h:commandButton>
+                <h:commandButton id="switchButton3" value="switch to item3">
+                    <rich:componentControl id="componentControl1" event="click" operation="switchToItem" target="accordion" >
+                        <f:param value="item3" />
+                    </rich:componentControl>
+                </h:commandButton>
+                <h:commandButton id="switchButton4" value="switch to item4">
+                    <rich:componentControl id="componentControl1" event="click" operation="switchToItem" target="accordion" >
+                        <f:param value="item4" />
+                    </rich:componentControl>
+                </h:commandButton>
+                <h:commandButton id="switchButtonCustom" value="switch to item with custom name (#{richAccordionItemBean.attributes['name'].value})">
+                    <rich:componentControl id="componentControlCustom" event="click" operation="switchToItem" target="accordion" >
+                        <f:param value="#{richAccordionItemBean.attributes['name'].value}" />
+                    </rich:componentControl>
+                </h:commandButton>
+
+            </fieldset>
+        </ui:define>
+
+        <ui:define name="outOfTemplateAfter">
+            Settings for the first item:
+            <br/><br/>
+            <metamer:attributes value="#{richAccordionItemBean.attributes}" id="attributes" />
+        </ui:define>
+
+    </ui:composition>
+</html>
\ No newline at end of file



More information about the richfaces-svn-commits mailing list