Author: ppitonak(a)redhat.com
Date: 2010-12-10 09:18:06 -0500 (Fri, 10 Dec 2010)
New Revision: 20497
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
https://issues.jboss.org/browse/RFPL-959
* added one sample for rich:menuGroup
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-12-10
14:08:47 UTC (rev 20496)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-10
14:18:06 UTC (rev 20497)
@@ -137,6 +137,7 @@
components.put("richInputNumberSpinner", "Rich Input Number
Spinner");
components.put("richJQuery", "Rich jQuery");
components.put("richList", "Rich List");
+ components.put("richMenuGroup", "Rich Menu Group");
components.put("richPanel", "Rich Panel");
components.put("richPanelMenu", "Rich Panel Menu");
components.put("richPopupPanel", "Rich Popup Panel");
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java 2010-12-10
14:18:06 UTC (rev 20497)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.UIMenuGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:menuGroup.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMenuGroupBean")
+@ViewScoped
+public class RichMenuGroupBean 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(UIMenuGroup.class, getClass(),
false);
+
+ attributes.setAttribute("mode", "ajax");
+ attributes.setAttribute("rendered", true);
+
+ attributes.remove("converter");
+ }
+
+ 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/RichMenuGroupBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml 2010-12-10
14:18:06 UTC (rev 20497)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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">
+
+ <!--
+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.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Menu Group</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page containing a drop down menu with several
<b>rich:menuGroup</b>s and inputs for all attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml 2010-12-10
14:18:06 UTC (rev 20497)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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: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"
+
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html">
+
+ <!--
+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.
+ -->
+
+ <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>
+ <style type="text/css">
+ .pic {
+ margin-bottom: -4px;
+ margin-right: 2px;
+ }
+
+ .search .rf-ddm-itm-sel {
+ background-color: transparent;
+ background-image:none;
+ border-color: transparent;
+ cursor: default;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:toolbar id="toolbar" height="26px">
+ <rich:dropDownMenu id="menu1" menu="ajax">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage library="images/icons"
name="copy.gif" styleClass="pic" />
+ <h:outputText value="File" />
+ </h:panelGroup>
+ </f:facet>
+
+ <rich:menuItem label="New"
icon="/resources/images/icons/create_doc.gif"/>
+
+ <rich:menuItem label="Open"
icon="/resources/images/icons/open.gif" />
+
+ <rich:menuGroup label="Open Recent..."
disabled="true">
+ <rich:menuItem label="Save"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem label="Save All">
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ </rich:menuGroup>
+
+ <rich:menuSeparator id="menuSeparator11" />
+
+ <rich:menuGroup id="menuGroup"
+
dir="#{richMenuGroupBean.attributes['dir'].value}"
+
disabled="#{richMenuGroupBean.attributes['disabled'].value}"
+ label="Save As..."
+
lang="#{richMenuGroupBean.attributes['lang'].value}"
+
mode="#{richMenuGroupBean.attributes['mode'].value}"
+
onclick="#{richMenuGroupBean.attributes['onclick'].value}"
+
ondblclick="#{richMenuGroupBean.attributes['ondblclick'].value}"
+
onhide="#{richMenuGroupBean.attributes['onhide'].value}"
+
onkeydown="#{richMenuGroupBean.attributes['onkeydown'].value}"
+
onkeypress="#{richMenuGroupBean.attributes['onkeypress'].value}"
+
onkeyup="#{richMenuGroupBean.attributes['onkeyup'].value}"
+
onmousedown="#{richMenuGroupBean.attributes['onmousedown'].value}"
+
onmousemove="#{richMenuGroupBean.attributes['onmousemove'].value}"
+
onmouseout="#{richMenuGroupBean.attributes['onmouseout'].value}"
+
onmouseover="#{richMenuGroupBean.attributes['onmouseover'].value}"
+
onmouseup="#{richMenuGroupBean.attributes['onmouseup'].value}"
+
onshow="#{richMenuGroupBean.attributes['onshow'].value}"
+
rendered="#{richMenuGroupBean.attributes['rendered'].value}"
+
style="#{richMenuGroupBean.attributes['style'].value}"
+
styleClass="#{richMenuGroupBean.attributes['styleClass'].value}"
+
title="#{richMenuGroupBean.attributes['title'].value}"
+
value="#{richMenuGroupBean.attributes['value'].value}"
+ >
+ <rich:menuItem label="Save"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem label="Save All" >
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ <rich:menuItem label="Send Online"
icon="/resources/images/icons/save.gif" disabled="true" />
+ </rich:menuGroup>
+
+ <rich:menuItem label="Print"
disabled="true"/>
+
+ <rich:menuItem label="Close" />
+
+ <rich:menuSeparator id="menuSeparator12" />
+
+ <rich:menuItem label="Exit" />
+
+ </rich:dropDownMenu>
+
+ </rich:toolbar>
+
+ <br /><br />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richMenuGroupBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file