Author: ppitonak(a)redhat.com
Date: 2010-08-09 11:46:51 -0400 (Mon, 09 Aug 2010)
New Revision: 18514
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichToggleControlBean.properties
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-742
* added rich:toggleControl
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-08-09
15:28:50 UTC (rev 18513)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-08-09
15:46:51 UTC (rev 18514)
@@ -117,6 +117,7 @@
components.put("richPanel", "Rich Panel");
components.put("richSubTable", "Rich Subtable");
components.put("richSubTableToggleControl", "Rich Subtable Toggle
Control");
+ components.put("richToggleControl", "Rich Toggle Control");
components.put("richTogglePanel", "Rich Toggle Panel");
}
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java 2010-08-09
15:46:51 UTC (rev 18514)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.behavior.ToggleControl;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:toggleControl.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richToggleControlBean")
+@ViewScoped
+public class RichToggleControlBean 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.getBehaviorAttributes(ToggleControl.class, getClass());
+
+ attributes.setAttribute("forPanel", "panel1");
+ attributes.setAttribute("targetItem", "item1");
+
+ // TODO following attributes have to be tested in another way
+ attributes.remove("disableDefault");
+ attributes.remove("event"); // has to be literal
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Property changes on:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichToggleControlBean.properties
===================================================================
---
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichToggleControlBean.properties
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichToggleControlBean.properties 2010-08-09
15:46:51 UTC (rev 18514)
@@ -0,0 +1,8 @@
+attr.forPanel.panel1=panel1
+attr.forPanel.panel2=panel2
+attr.forPanel.null=
+
+attr.targetItem.item1=item1
+attr.targetItem.item2=item2
+attr.targetItem.item3=item3
+attr.targetItem.null=
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml 2010-08-09
15:46:51 UTC (rev 18514)
@@ -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 Toggle
Control</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Page containing a toggle panel, three
<b>rich:toggleControl</b>s and inputs for all attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Property changes on:
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/list.xhtml
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml 2010-08-09
15:46:51 UTC (rev 18514)
@@ -0,0 +1,125 @@
+<!--
+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">
+
+ <h:panelGrid id="panel1Controls" columns="6">
+ panel1:
+ <h:commandLink value="Toggle Panel Item 1">
+ <rich:toggleControl id="tc11"
forPanel="panel1" targetItem="item1" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink value="Toggle Panel Item 2">
+ <rich:toggleControl id="tc12"
forPanel="panel1" targetItem="item2" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink value="Toggle Panel Item 3">
+ <rich:toggleControl id="tc13"
forPanel="panel1" targetItem="item3" />
+ </h:commandLink>
+ </h:panelGrid>
+
+ <h:panelGrid id="panel2Controls" columns="6">
+ panel2:
+ <h:commandLink value="Toggle Panel Item 1">
+ <rich:toggleControl id="tc21"
forPanel="panel2" targetItem="item1" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink value="Toggle Panel Item 2">
+ <rich:toggleControl id="tc22"
forPanel="panel2" targetItem="item2" />
+ </h:commandLink>
+ <h:outputText value=" | " />
+ <h:commandLink value="Toggle Panel Item 3">
+ <rich:toggleControl id="tc23"
forPanel="panel2" targetItem="item3" />
+ </h:commandLink>
+ </h:panelGrid>
+
+ universal toggle control (settings below)
+ <h:commandLink value="Toggle Panel Item">
+ <rich:toggleControl id="richToggleControl"
+
forPanel="#{richToggleControlBean.attributes['forPanel'].value}"
+
targetItem="#{richToggleControlBean.attributes['targetItem'].value}"
+ />
+ </h:commandLink>
+
+ <br/><br/>
+
+ <fieldset>
+ <legend>panel1</legend>
+ <rich:togglePanel id="panel1"
activeItem="item1">
+ <rich:togglePanelItem id="item11"
name="item1">
+ <p>content of panel 1</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item12"
name="item2">
+ <p>content of panel 2</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item13"
name="item3">
+ <p>content of panel 3</p>
+ </rich:togglePanelItem>
+ </rich:togglePanel>
+ </fieldset>
+
+ <br/>
+
+ <fieldset>
+ <legend>panel2</legend>
+ <rich:togglePanel id="panel2"
activeItem="item1">
+ <rich:togglePanelItem id="item21"
name="item1">
+ <p>content of panel 1</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item22"
name="item2">
+ <p>content of panel 2</p>
+ </rich:togglePanelItem>
+ <rich:togglePanelItem id="item23"
name="item3">
+ <p>content of panel 3</p>
+ </rich:togglePanelItem>
+ </rich:togglePanel>
+ </fieldset>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <br/>
+ Attributes for the first toggle control:
+ <br/><br/>
+ <metamer:attributes value="#{richToggleControlBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on:
root/tests/metamer/trunk/application/src/main/webapp/components/richToggleControl/simple.xhtml
___________________________________________________________________
Name: svn:keywords
+ Revision