Author: ppitonak(a)redhat.com
Date: 2010-07-28 09:49:06 -0400 (Wed, 28 Jul 2010)
New Revision: 18260
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichComponentControlBean.properties
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/list.xhtml
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/simple.xhtml
root/tests/metamer/trunk/application/src/main/webapp/resources/css/richComponentControl.css
Modified:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
* added component rich:componentControl
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-28
13:43:29 UTC (rev 18259)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-07-28
13:49:06 UTC (rev 18260)
@@ -104,6 +104,7 @@
components.put("a4jRegion", "A4J Region");
components.put("a4jRepeat", "A4J Repeat");
components.put("commandButton", "JSF Command Button");
+ components.put("richComponentControl", "Rich Component
Control");
components.put("richDataGrid", "Rich Data Grid");
components.put("richDataScroller", "Rich Data Scroller");
components.put("richDataTable", "Rich Data Table");
Added:
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java
===================================================================
---
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java 2010-07-28
13:49:06 UTC (rev 18260)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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.behavior.ComponentControlBehavior;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:componentControl.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richComponentControlBean")
+@SessionScoped
+public class RichComponentControlBean implements Serializable {
+
+ private static final long serialVersionUID = 4476643239809L;
+ 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(ComponentControlBehavior.class,
getClass());
+
+ attributes.setAttribute("operation", "previous");
+ attributes.setAttribute("target", "scroller");
+
+ // TODO has to be tested in another way
+ attributes.remove("event");
+ }
+
+ 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/RichComponentControlBean.properties
===================================================================
---
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichComponentControlBean.properties
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichComponentControlBean.properties 2010-07-28
13:49:06 UTC (rev 18260)
@@ -0,0 +1,5 @@
+attr.operation.none=
+attr.operation.first=first
+attr.operation.last=last
+attr.operation.previous=previous
+attr.operation.next=next
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/list.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/list.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/list.xhtml 2010-07-28
13:49:06 UTC (rev 18260)
@@ -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:ta="http://java.sun.com/jsf/composite/testapp">
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Component
Control</ui:define>
+
+ <ui:define name="links">
+
+ <ta:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page that contains a <b>rich:componentControl</b>
controlling a <b>rich:dataScroller</b> and input boxes for all component
control's attributes.
+ </ta:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/simple.xhtml
(rev 0)
+++
root/tests/metamer/trunk/application/src/main/webapp/components/richComponentControl/simple.xhtml 2010-07-28
13:49:06 UTC (rev 18260)
@@ -0,0 +1,84 @@
+<!--
+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:a4j="http://richfaces.org/a4j"
+
xmlns:ta="http://java.sun.com/jsf/composite/testapp"
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>
+ <h:outputStylesheet library="css"
name="richComponentControl.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dataTable id="richDataTable"
+ rows="10"
+ value="#{model.employees}"
+ var="record"
+ >
+
+ <rich:column id="columnName">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderName"
value="Name" />
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller"
for="richDataTable" page="3"/>
+ </f:facet>
+
+ </rich:dataTable>
+
+ <br/>
+
+ <h:commandButton id="button" value="button">
+ <rich:componentControl id="richComponentControl"
+ event="click"
+
operation="#{richComponentControlBean.attributes['operation'].value}"
+
selector="#{richComponentControlBean.attributes['selector'].value}"
+
target="#{richComponentControlBean.attributes['target'].value}" />
+ </h:commandButton>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <br/>
+
+ <ta:attributes value="#{richComponentControlBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added:
root/tests/metamer/trunk/application/src/main/webapp/resources/css/richComponentControl.css
===================================================================