Author: lfryc(a)redhat.com
Date: 2011-01-11 06:36:37 -0500 (Tue, 11 Jan 2011)
New Revision: 20944
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
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/RichPanelMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
Log:
rich:panelMenu - panelMenuGroup - added initial sample (RFPL-1045)
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 2011-01-11
11:35:42 UTC (rev 20943)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-01-11
11:36:37 UTC (rev 20944)
@@ -146,6 +146,7 @@
components.put("richMenuSeparator", "Rich Menu Separator");
components.put("richPanel", "Rich Panel");
components.put("richPanelMenu", "Rich Panel Menu");
+ components.put("richPanelMenuGroup", "Rich Panel Menu
Group");
components.put("richPanelMenuItem", "Rich Panel Menu Item");
components.put("richPopupPanel", "Rich Popup Panel");
components.put("richProgressBar", "Rich Progress Bar");
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
(from rev 20943,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-01-11
11:36:37 UTC (rev 20944)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * 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.HtmlPanelMenuGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panelMenu.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelMenuGroupBean")
+@ViewScoped
+public class RichPanelMenuGroupBean 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.getComponentAttributesFromClass(HtmlPanelMenuGroup.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+
+ // already defined in source directly
+ attributes.remove("name");
+ attributes.remove("label");
+
+ // attributes should be hidden
+ attributes.remove("panelMenu");
+ attributes.remove("parentItem");
+ attributes.remove("topItem");
+ attributes.remove("submittedExpanded");
+ attributes.remove("value");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public void changeExpandListener(Object event) {
+ // TODO ajax or server expansion doesn't work yet
+ throw new UnsupportedOperationException("needs to be implemented in
Metamer");
+ }
+}
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-11
11:35:42 UTC (rev 20943)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-11
11:36:37 UTC (rev 20944)
@@ -61,6 +61,12 @@
// already defined in source directly
attributes.remove("name");
attributes.remove("label");
+
+ // attributes should be hidden
+ attributes.remove("panelMenu");
+ attributes.remove("parentItem");
+ attributes.remove("topItem");
+ attributes.remove("value");
}
public Attributes getAttributes() {
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2011-01-11
11:35:42 UTC (rev 20943)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2011-01-11
11:36:37 UTC (rev 20944)
@@ -43,6 +43,8 @@
<rich:panelMenu id="panelMenu"
action="#{richBean.dummyAction}"
actionListener="#{richBean.dummyActionListener}"
+
itemChangeListener="#{richPanelMenuBean.itemChangeListener}"
+
activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
bubbleSelection="#{richPanelMenuBean.attributes['bubbleSelection'].value}"
bypassUpdates="#{richPanelMenuBean.attributes['bypassUpdates'].value}"
@@ -62,7 +64,6 @@
groupExpandIconRight="#{richPanelMenuBean.attributes['groupExpandIconRight'].value}"
groupMode="#{richPanelMenuBean.attributes['groupMode'].value}"
immediate="#{richPanelMenuBean.attributes['immediate'].value}"
-
itemChangeListener="#{richPanelMenuBean.itemChangeListener}"
itemClass="#{richPanelMenuBean.attributes['topItemClass'].value}"
itemDisableClass="#{richPanelMenuBean.attributes['topItemDisableClass'].value}"
itemDisableIconLeft="#{richPanelMenuBean.attributes['topItemDisableIconLeft'].value}"
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml 2011-01-11
11:36:37 UTC (rev 20944)
@@ -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 Panel Menu
Group</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page containing <b>rich:panelMenuGroup</b> inside
<b>rich:panelMenu</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml 2011-01-11
11:36:37 UTC (rev 20944)
@@ -0,0 +1,135 @@
+<?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: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"
xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:panelMenu id="panelMenu" style="width: 250px; "
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.dummyActionListener}"
+
activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
+
itemChangeListener="#{richPanelMenuBean.itemChangeListener}">
+
+ <rich:panelMenuGroup id="group1" name="group1"
label="Group 1">
+ <rich:panelMenuItem id="item11" name="item11"
label="Item 1.1"/>
+ <rich:panelMenuItem id="item12" name="item12"
label="Item 1.2" />
+ <rich:panelMenuItem id="item13" name="item13"
label="Item 1.3"/>
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup id="group2" name="group2"
label="Group 2 (influenced by attributes)"
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.dummyActionListener}"
+
changeExpandListener="#{richPanelMenuGroupBean.changeExpandListener}"
+
+
bubbleSelection="#{richPanelMenuGroupBean.attributes['bubbleSelection'].value}"
+
bypassUpdates="#{richPanelMenuGroupBean.attributes['bypassUpdates'].value}"
+
collapseEvent="#{richPanelMenuGroupBean.attributes['collapseEvent'].value}"
+
data="#{richPanelMenuGroupBean.attributes['data'].value}"
+
disabled="#{richPanelMenuGroupBean.attributes['disabled'].value}"
+
disabledClass="#{richPanelMenuGroupBean.attributes['disabledClass'].value}"
+
execute="#{richPanelMenuGroupBean.attributes['execute'].value}"
+
expandEvent="#{richPanelMenuGroupBean.attributes['expandEvent'].value}"
+
expandSingle="#{richPanelMenuGroupBean.attributes['expandSingle'].value}"
+
expanded="#{richPanelMenuGroupBean.attributes['expanded'].value}"
+
hoverClass="#{richPanelMenuGroupBean.attributes['hoverClass'].value}"
+
iconLeftClass="#{richPanelMenuGroupBean.attributes['iconLeftClass'].value}"
+
iconLeftCollapsed="#{richPanelMenuGroupBean.attributes['iconLeftCollapsed'].value}"
+
iconLeftDisabled="#{richPanelMenuGroupBean.attributes['iconLeftDisabled'].value}"
+
iconLeftExpanded="#{richPanelMenuGroupBean.attributes['iconLeftExpanded'].value}"
+
iconRightClass="#{richPanelMenuGroupBean.attributes['iconRightClass'].value}"
+
iconRightCollapsed="#{richPanelMenuGroupBean.attributes['iconRightCollapsed'].value}"
+
iconRightDisabled="#{richPanelMenuGroupBean.attributes['iconRightDisabled'].value}"
+
iconRightExpanded="#{richPanelMenuGroupBean.attributes['iconRightExpanded'].value}"
+
immediate="#{richPanelMenuGroupBean.attributes['immediate'].value}"
+
limitRender="#{richPanelMenuGroupBean.attributes['limitRender'].value}"
+
mode="#{richPanelMenuGroupBean.attributes['mode'].value}"
+
onbeforecollapse="#{richPanelMenuGroupBean.attributes['onbeforecollapse'].value}"
+
onbeforedomupdate="#{richPanelMenuGroupBean.attributes['onbeforedomupdate'].value}"
+
onbeforeexpand="#{richPanelMenuGroupBean.attributes['onbeforeexpand'].value}"
+
onbeforeselect="#{richPanelMenuGroupBean.attributes['onbeforeselect'].value}"
+
onbeforeswitch="#{richPanelMenuGroupBean.attributes['onbeforeswitch'].value}"
+
onclick="#{richPanelMenuGroupBean.attributes['onclick'].value}"
+
oncollapse="#{richPanelMenuGroupBean.attributes['oncollapse'].value}"
+
oncomplete="#{richPanelMenuGroupBean.attributes['oncomplete'].value}"
+
ondblclick="#{richPanelMenuGroupBean.attributes['ondblclick'].value}"
+
onexpand="#{richPanelMenuGroupBean.attributes['onexpand'].value}"
+
onmousedown="#{richPanelMenuGroupBean.attributes['onmousedown'].value}"
+
onmousemove="#{richPanelMenuGroupBean.attributes['onmousemove'].value}"
+
onmouseout="#{richPanelMenuGroupBean.attributes['onmouseout'].value}"
+
onmouseover="#{richPanelMenuGroupBean.attributes['onmouseover'].value}"
+
onmouseup="#{richPanelMenuGroupBean.attributes['onmouseup'].value}"
+
onselect="#{richPanelMenuGroupBean.attributes['onselect'].value}"
+
onswitch="#{richPanelMenuGroupBean.attributes['onswitch'].value}"
+
onunselect="#{richPanelMenuGroupBean.attributes['onunselect'].value}"
+
render="#{richPanelMenuGroupBean.attributes['render'].value}"
+
rendered="#{richPanelMenuGroupBean.attributes['rendered'].value}"
+
status="#{richPanelMenuGroupBean.attributes['status'].value}"
+
style="#{richPanelMenuGroupBean.attributes['style'].value}"
+
styleClass="#{richPanelMenuGroupBean.attributes['styleClass'].value}"
+ >
+ <rich:panelMenuItem id="item21" name="item21"
label="Item 2.1"/>
+ <rich:panelMenuItem id="item22" name="item22"
label="Item 2.2" />
+ <rich:panelMenuItem id="item23" name="item23"
label="Item 2.3"/>
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup id="group3" name="group3"
label="Group 3">
+ <rich:panelMenuItem id="item31" name="item31"
label="Item 3.1"/>
+ <rich:panelMenuItem id="item32" name="item32"
label="Item 3.2" />
+ <rich:panelMenuItem id="item33" name="item33"
label="Item 3.3"/>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+
+ <br/><br/>
+
+ <fieldset>
+ <legend>selected item</legend>
+
+ <a4j:outputPanel id="selectedPanel"
ajaxRendered="true">
+ <h:outputText id="current"
value="#{richPanelMenuBean.attributes['activeItem'].value}" />
+ </a4j:outputPanel>
+ </fieldset>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richPanelMenuGroupBean.attributes}"
id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-11
11:35:42 UTC (rev 20943)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-11
11:36:37 UTC (rev 20944)
@@ -46,7 +46,7 @@
activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
itemChangeListener="#{richPanelMenuBean.itemChangeListener}">
- <rich:panelMenuGroup id="group1" name="group1"
label="Group 1">
+ <rich:panelMenuGroup id="group1" name="group1"
label="Group 1" expanded="true">
<rich:panelMenuItem id="item11" name="item11"
label="Item 1.1"/>
<rich:panelMenuItem id="item12" name="item12"
label="Item 1.2 (influenced by attributes)"
action="#{richBean.dummyAction}"