Author: lfryc(a)redhat.com
Date: 2011-01-11 06:35:42 -0500 (Tue, 11 Jan 2011)
New Revision: 20943
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
rich:panelMenu - panelMenuItem - 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:34:56 UTC (rev 20942)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-01-11
11:35:42 UTC (rev 20943)
@@ -146,6 +146,7 @@
components.put("richMenuSeparator", "Rich Menu Separator");
components.put("richPanel", "Rich Panel");
components.put("richPanelMenu", "Rich Panel Menu");
+ components.put("richPanelMenuItem", "Rich Panel Menu Item");
components.put("richPopupPanel", "Rich Popup Panel");
components.put("richProgressBar", "Rich Progress Bar");
components.put("richSelect", "Rich Select");
Added:
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
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-11
11:35:42 UTC (rev 20943)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.HtmlPanelMenuItem;
+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 = "richPanelMenuItemBean")
+@ViewScoped
+public class RichPanelMenuItemBean 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(HtmlPanelMenuItem.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+
+ // already defined in source directly
+ attributes.remove("name");
+ attributes.remove("label");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/list.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/list.xhtml 2011-01-11
11:35:42 UTC (rev 20943)
@@ -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
Item</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page containing <b>rich:panelMenuItem</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/richPanelMenuItem/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-11
11:35:42 UTC (rev 20943)
@@ -0,0 +1,104 @@
+<?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 (influenced by attributes)"
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.dummyActionListener}"
+
bypassUpdates="#{richPanelMenuItemBean.attributes['bypassUpdates'].value}"
+
data="#{richPanelMenuItemBean.attributes['data'].value}"
+
disabled="#{richPanelMenuItemBean.attributes['disabled'].value}"
+
disabledClass="#{richPanelMenuItemBean.attributes['disabledClass'].value}"
+
execute="#{richPanelMenuItemBean.attributes['disabledClass'].value}"
+
hoverClass="#{richPanelMenuItemBean.attributes['hoverClass'].value}"
+
iconLeft="#{richPanelMenuItemBean.attributes['iconLeft'].value}"
+
iconLeftClass="#{richPanelMenuItemBean.attributes['iconLeftClass'].value}"
+
iconLeftDisabled="#{richPanelMenuItemBean.attributes['iconLeftDisabled'].value}"
+
iconRight="#{richPanelMenuItemBean.attributes['iconRight'].value}"
+
iconRightClass="#{richPanelMenuItemBean.attributes['iconRightClass'].value}"
+
iconRightDisabled="#{richPanelMenuItemBean.attributes['iconRightDisabled'].value}"
+
immediate="#{richPanelMenuItemBean.attributes['immediate'].value}"
+
limitRender="#{richPanelMenuItemBean.attributes['limitRender'].value}"
+
mode="#{richPanelMenuItemBean.attributes['mode'].value}"
+
onbeforedomupdate="#{richPanelMenuItemBean.attributes['onbeforedomupdate'].value}"
+
onmousedown="#{richPanelMenuItemBean.attributes['onmousedown'].value}"
+
onmousemove="#{richPanelMenuItemBean.attributes['onmousemove'].value}"
+
onmouseout="#{richPanelMenuItemBean.attributes['onmouseout'].value}"
+
onmouseover="#{richPanelMenuItemBean.attributes['onmouseover'].value}"
+
onmouseup="#{richPanelMenuItemBean.attributes['onmouseup'].value}"
+
onselect="#{richPanelMenuItemBean.attributes['onselect'].value}"
+
onunselect="#{richPanelMenuItemBean.attributes['onunselect'].value}"
+
render="#{richPanelMenuItemBean.attributes['render'].value}"
+
rendered="#{richPanelMenuItemBean.attributes['rendered'].value}"
+
status="#{richPanelMenuItemBean.attributes['status'].value}"
+
style="#{richPanelMenuItemBean.attributes['style'].value}"
+
styleClass="#{richPanelMenuItemBean.attributes['styleClass'].value}"
+ />
+ <rich:panelMenuItem id="item13" name="item13"
label="Item 1.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="#{richPanelMenuItemBean.attributes}"
id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file