Author: jjamrich
Date: 2012-01-05 08:27:55 -0500 (Thu, 05 Jan 2012)
New Revision: 23128
Added:
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichContextMenuBean.java
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/list.xhtml
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/simple.xhtml
Modified:
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RF-10197: add simple example for rich:contextMenu
Add page for rich:contextMenu, with attribute mappings and default values preset.
Modified:
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2012-01-05
13:01:50 UTC (rev 23127)
+++
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2012-01-05
13:27:55 UTC (rev 23128)
@@ -132,6 +132,7 @@
richComponents.put("richColumn", "Rich Column");
richComponents.put("richColumnGroup", "Rich Column Group");
richComponents.put("richComponentControl", "Rich Component
Control");
+ richComponents.put("richContextMenu", "Rich Context Menu");
richComponents.put("richDataGrid", "Rich Data Grid");
richComponents.put("richDataScroller", "Rich Data
Scroller");
richComponents.put("richDataTable", "Rich Data Table");
Added:
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichContextMenuBean.java
===================================================================
---
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichContextMenuBean.java
(rev 0)
+++
modules/tests/metamer/branches/contextMenu/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichContextMenuBean.java 2012-01-05
13:27:55 UTC (rev 23128)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+
+import org.richfaces.component.UIContextMenu;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:contextMenu
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richContextMenuBean")
+public class RichContextMenuBean implements Serializable {
+
+ /** Generated serial version UID */
+ private static final long serialVersionUID = 1323565239250527128L;
+ private static Logger log = LoggerFactory.getLogger(RichContextMenuBean.class);
+
+ private Attributes attributes;
+
+ @PostConstruct
+ public void init() {
+ log.info("ContextMenu attributes initialized.");
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIContextMenu.class, getClass());
+ attributes.setAttribute("attachTo", "form:panelClick");
+ attributes.setAttribute("disabled", "false");
+ attributes.setAttribute("rendered", "true");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+}
Added:
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/list.xhtml
===================================================================
---
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/list.xhtml
(rev 0)
+++
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/list.xhtml 2012-01-05
13:27:55 UTC (rev 23128)
@@ -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-2011, 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 Context Menu</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple"
value="Simple">
+ Simple page that contains rich:contextMenu
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added:
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/simple.xhtml
===================================================================
---
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/simple.xhtml
(rev 0)
+++
modules/tests/metamer/branches/contextMenu/application/src/main/webapp/components/richContextMenu/simple.xhtml 2012-01-05
13:27:55 UTC (rev 23128)
@@ -0,0 +1,116 @@
+<?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" >
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="component">
+ <h:panelGroup layout="block" style="width:300px;
background-color: lightgreen; padding: 15px" id="panelClick">
+ Righ click here for a contextMenu
+ </h:panelGroup>
+ <rich:contextMenu id="ctxmenu"
+
attachTo="#{richContextMenuBean.attributes['attachTo'].value}"
+
dir="#{richContextMenuBean.attributes['dir'].value}"
+
direction="#{richContextMenuBean.attributes['direction'].value}"
+
disabled="#{richContextMenuBean.attributes['disabled'].value}"
+
hideDelay="#{richContextMenuBean.attributes['hideDelay'].value}"
+
horizontalOffset="#{richContextMenuBean.attributes['horizontalOffset'].value}"
+
jointPoint="#{richContextMenuBean.attributes['jointPoint'].value}"
+
label="#{richContextMenuBean.attributes['label'].value}"
+
lang="#{richContextMenuBean.attributes['lang'].value}"
+
mode="#{richContextMenuBean.attributes['mode'].value}"
+
onclick="#{richContextMenuBean.attributes['onclick'].value}"
+
ondblclick="#{richContextMenuBean.attributes[''].value}"
+
ongrouphide="#{richContextMenuBean.attributes['ongrouphide'].value}"
+
ongroupshow="#{richContextMenuBean.attributes['ongroupshow'].value}"
+
onhide="#{richContextMenuBean.attributes['onhide'].value}"
+
onitemclick="#{richContextMenuBean.attributes['onitemclick'].value}"
+
onkeydown="#{richContextMenuBean.attributes['onkeydown'].value}"
+
onkeypress="#{richContextMenuBean.attributes['onkeypress'].value}"
+
onkeyup="#{richContextMenuBean.attributes['onkeyup'].value}"
+
onmousedown="#{richContextMenuBean.attributes['onmousedown'].value}"
+
onmousemove="#{richContextMenuBean.attributes['onmousemove'].value}"
+
onmouseout="#{richContextMenuBean.attributes['onmouseout'].value}"
+
onmouseover="#{richContextMenuBean.attributes['onmouseover'].value}"
+
onmouseup="#{richContextMenuBean.attributes['onmouseup'].value}"
+
onshow="#{richContextMenuBean.attributes['onshow'].value}"
+
popupWidth="#{richContextMenuBean.attributes['popupWidth'].value}"
+
rendered="#{richContextMenuBean.attributes['rendered'].value}"
+
showDelay="#{richContextMenuBean.attributes['showDelay'].value}"
+
showEvent="#{richContextMenuBean.attributes['showEvent'].value}"
+
style="#{richContextMenuBean.attributes['showEvent'].value}"
+
styleClass="#{richContextMenuBean.attributes['styleClass'].value}"
+
title="#{richContextMenuBean.attributes['title'].value}"
+
verticalOffset="#{richContextMenuBean.attributes['verticalOffset'].value}"
+ >
+ <rich:menuItem id="menuItem2" label="Open"
icon="/resources/images/icons/open.gif" />
+
+ <rich:menuGroup id="menuGroup3" label="Open
Recent..." disabled="true">
+ <rich:menuItem id="menuItem31"
label="Save" icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem32" 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="menuGroup4" label="Save
As...">
+ <rich:menuItem id="menuItem41"
label="Save" icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem42" label="Save
All" >
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons"
name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ <rich:menuItem id="menuItem43" label="Send
Online" icon="/resources/images/icons/save.gif" disabled="true"
/>
+ </rich:menuGroup>
+
+ <rich:menuItem id="menuItem5" label="Print"
disabled="true"/>
+
+ <rich:menuItem id="menuItem6" label="Close"
/>
+
+ <rich:menuSeparator id="menuSeparator12" />
+
+ <rich:menuItem id="menuItem7" label="Exit"
/>
+ </rich:contextMenu>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richContextMenuBean.attributes}"
id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file