Author: ilya_shaikovsky
Date: 2010-12-07 06:43:29 -0500 (Tue, 07 Dec 2010)
New Revision: 20430
Added:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/dropdownmenu/
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/dropdownmenu/DropDownMenuBean.java
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/sideMenu-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/topMenu-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/sideMenu.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/topMenu.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
https://jira.jboss.org/browse/RF-9792
Added:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/dropdownmenu/DropDownMenuBean.java
===================================================================
---
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/dropdownmenu/DropDownMenuBean.java
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/dropdownmenu/DropDownMenuBean.java 2010-12-07
11:43:29 UTC (rev 20430)
@@ -0,0 +1,45 @@
+package org.richfaces.demo.dropdownmenu;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean
+@ViewScoped
+public class DropDownMenuBean implements Serializable{
+ private String current;
+
+ public String getCurrent() {
+ return this.current;
+ }
+
+ public void setCurrent(String current) {
+ this.current = current;
+ }
+
+ public String doNew() {
+ this.current="New";
+ return null;
+ }
+ public String doOpen() {
+ this.current="Open";
+ return null;
+ }
+ public String doClose() {
+ this.current="Close";
+ return null;
+ }
+ public String doSave() {
+ this.current="Save";
+ return null;
+ }
+ public String doSaveAll() {
+ this.current="Save All";
+ return null;
+ }
+ public String doExit() {
+ this.current="Exit";
+ return null;
+ }
+}
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-12-07
11:31:11 UTC (rev 20429)
+++
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-12-07
11:43:29 UTC (rev 20430)
@@ -435,6 +435,20 @@
</sample>
</samples>
</demo>
+ <demo new="true">
+ <id>dropDownMenu</id>
+ <name>rich:dropDownMenu</name>
+ <samples>
+ <sample>
+ <id>topMenu</id>
+ <name>Top Menu</name>
+ </sample>
+ <sample>
+ <id>sideMenu</id>
+ <name>Side Menu</name>
+ </sample>
+ </samples>
+ </demo>
</demos>
</group>
<group>
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/sideMenu-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/sideMenu-sample.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/sideMenu-sample.xhtml 2010-12-07
11:43:29 UTC (rev 20430)
@@ -0,0 +1,54 @@
+<!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:rich="http://richfaces.org/rich">
+
+<ui:composition>
+ <style>
+.optionList {
+ height: 22px;
+}
+
+.vertical-menu-cell {
+ padding: 0px 4px 0px 4px;
+}
+</style>
+ <h:panelGrid styleClass="vertical-menu-cell"
+ columnClasses="optionList" columns="1" cellspacing="0"
+ cellpadding="0">
+ <rich:dropDownMenu
+ style="border:1px solid #{a4jSkin.panelBorderColor}"
label="Option1"
+ mode="none">
+ <rich:menuItem label="Suboption 1-1" />
+ <rich:menuItem label="Suboption 1-2">
+ <f:facet name="icon">
+ <h:graphicImage value="/richfaces/toolBar/images/print.gif" />
+ </f:facet>
+ </rich:menuItem>
+ <rich:menuItem label="Suboption 1-3" />
+ </rich:dropDownMenu>
+ <rich:dropDownMenu
+ style="border:1px solid #{a4jSkin.panelBorderColor}"
label="Option2"
+ mode="none">
+ <rich:menuItem label="Suboption 2-1" />
+ <rich:menuItem label="Suboption 2-2" />
+ <rich:menuGroup label="Group2">
+ <rich:menuItem label="Suboption 2-2-1" />
+ <rich:menuItem label="Suboption 2-2-2" />
+ </rich:menuGroup>
+ <rich:menuItem label="Suboption 2-3" />
+ </rich:dropDownMenu>
+ <rich:dropDownMenu
+ style="border:1px solid #{a4jSkin.panelBorderColor}"
label="Option3"
+ mode="none">
+ <rich:menuItem label="Suboption 3-1" />
+ <rich:menuItem label="Suboption 3-2" />
+ <rich:menuItem label="Suboption 3-3" />
+ </rich:dropDownMenu>
+ </h:panelGrid>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/topMenu-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/topMenu-sample.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/samples/topMenu-sample.xhtml 2010-12-07
11:43:29 UTC (rev 20430)
@@ -0,0 +1,101 @@
+<!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:rich="http://richfaces.org/rich">
+
+<ui:composition>
+
+ <style>
+.pic {
+ margin-bottom: -4px;
+ margin-right: 2px;
+}
+
+.search .rf-ddm-itm-sel {
+ background-color: transparent;
+ background-image:none;
+ border-color: transparent;
+ cursor: default;
+}
+</style>
+
+ <h:form>
+ <rich:toolbar height="26px">
+ <rich:dropDownMenu mode="ajax">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage value="/images/icons/copy.gif"
styleClass="pic" />
+ <h:outputText value="File" />
+ </h:panelGroup>
+ </f:facet>
+ <rich:menuItem label="New"
+ action="#{dropDownMenuBean.doNew}"
icon="/images/icons/create_doc.gif">
+ </rich:menuItem>
+ <rich:menuItem label="Open"
+ action="#{dropDownMenuBean.doOpen}"
icon="/images/icons/open.gif" />
+ <rich:menuGroup label="Save As...">
+ <rich:menuItem label="Save"
+ action="#{dropDownMenuBean.doSave}"
icon="/images/icons/save.gif" />
+ <rich:menuItem label="Save All"
+ action="#{dropDownMenuBean.doSaveAll}">
+ <f:facet name="icon">
+ <h:graphicImage value="/images/icons/save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ </rich:menuGroup>
+ <rich:menuItem label="Close"
+ action="#{dropDownMenuBean.doClose}" />
+ <rich:menuSeparator id="menuSeparator11" />
+ <rich:menuItem label="Exit"
+ action="#{dropDownMenuBean.doExit}" />
+
+ </rich:dropDownMenu>
+
+ <rich:dropDownMenu mode="ajax">
+ <f:facet name="label">
+ <h:panelGrid cellpadding="0" cellspacing="0"
columns="2"
+ style="vertical-align:middle">
+ <h:outputText value="Links" />
+ </h:panelGrid>
+ </f:facet>
+ <rich:menuItem submitMode="none"
+
onclick="document.location.href='http://labs.jboss.com/jbossrich...
+ <h:outputLink
value="http://labs.jboss.com/jbossrichfaces/">
+ <h:outputText value="RichFaces Home Page"></h:outputText>
+ </h:outputLink>
+ </rich:menuItem>
+ <rich:menuItem submitMode="none"
+
onclick="document.location.href='http://jboss.com/index.html?mod...
+ <h:outputLink
+
value="http://jboss.com/index.html?module=bb&op=viewforum&am...
+ <h:outputText value="RichFaces Forum"></h:outputText>
+ </h:outputLink>
+ </rich:menuItem>
+ </rich:dropDownMenu>
+ <rich:toolbarGroup location="right">
+ <rich:dropDownMenu label="Search" direction="bottom-left"
+ jointPoint="br" styleClass="search" mode="client">
+ <rich:menuItem>
+ <h:inputText value="" id="searchinput" />
+ <button type="button">Search</button>
+ </rich:menuItem>
+ <rich:menuItem label="Enter your search criteria here"
+ disabled="true"></rich:menuItem>
+ </rich:dropDownMenu>
+ </rich:toolbarGroup>
+ </rich:toolbar>
+ </h:form>
+
+ <br />
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="Current Selection: "></h:outputText>
+ <h:outputText style="font-weight:bold"
value="#{dropDownMenuBean.current}"></h:outputText>
+ </a4j:outputPanel>
+ <br />
+
+</ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/sideMenu.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/sideMenu.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/sideMenu.xhtml 2010-12-07
11:43:29 UTC (rev 20430)
@@ -0,0 +1,23 @@
+<!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">
+
+<ui:composition>
+ <p>Instead of grouping menus in toolbar - you can just place a
+ block of them horizontally or vertiсally how it is shown below.</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <p>Pay attention that the default directions is not really
+ convenient in that case. And we will work to add its customization
+ support in nearest time. Demo will be updated with the changes after
+ that.</p>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/topMenu.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/topMenu.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dropDownMenu/topMenu.xhtml 2010-12-07
11:43:29 UTC (rev 20430)
@@ -0,0 +1,33 @@
+<!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">
+
+<ui:composition>
+ <p><b>rich:dropDownMenu</b> is a component that allows to organize
+ the hierarchical menu similar to one that almost every desktop
+ application has.</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <p>The drop-down menu has a label that always appears on the page
+ and invisible panel that appears with a particular client side event
(<i>mouseover,
+ click etc</i>). The event is defined with an <b>showEvent</b>
attribute.</p>
+ <p>Drop-down menu can contains a set of menuItem's, menuGroup's and
+ menuSeparator's. Group plays a role of label for secondary levels on
+ the menu. Separator is represented with horizontal lines between the
+ items or groups. An item is an active element that might produce Ajax
+ or non-Ajax requests. The submission mode is defined with <b>mode</b>
+ attribute of the menu that has three possible options -
"<i>server</i>",
+ "<i>ajax</i>" or "<i>client</i>". Mode
"<i>client</i>" does not produce
+ any request, but allows you to provide your own functionality inside
+ the menu item with an inline content. Mode could be overriden for
+ concrete item</p>
+</ui:composition>
+
+</html>
\ No newline at end of file