Author: amarkhel
Date: 2010-12-02 05:00:57 -0500 (Thu, 02 Dec 2010)
New Revision: 20288
Added:
sandbox/trunk/examples/dropdownmenu-demo/
sandbox/trunk/examples/dropdownmenu-demo/pom.xml
sandbox/trunk/examples/dropdownmenu-demo/src/
sandbox/trunk/examples/dropdownmenu-demo/src/main/
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/richfaces/
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/richfaces/demo/
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/richfaces/demo/MenuBean.java
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/WEB-INF/
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/WEB-INF/lib/
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/examples/
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/copy.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/create_doc.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/ico1.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/ico2.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/input_bg.png
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/menu_item_bg.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/menu_list_bg.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/node.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/open.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/save.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/save_all.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/spacer.gif
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/indexWithToolBar.xhtml
Log:
RF-9676 :Dropdown menu component. Demo added.
Added: sandbox/trunk/examples/dropdownmenu-demo/pom.xml
===================================================================
--- sandbox/trunk/examples/dropdownmenu-demo/pom.xml (rev 0)
+++ sandbox/trunk/examples/dropdownmenu-demo/pom.xml 2010-12-02 10:00:57 UTC (rev 20288)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>richfaces-example-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>dropdownmenu-demo</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces Examples: Outputs</name>
+ <packaging>war</packaging>
+
+ <properties>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-beta-1</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>jee6</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1-alpha-1</version>
+ <configuration>
+
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jee6</id>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee6</webappDirectory>
+ <classifier>jee6</classifier>
+
<packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</packagingExcludes>
+
<warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*</warSourceExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <webResources>
+ <resource>
+
<directory>${basedir}/src/main/java</directory>
+ <targetPath>/WEB-INF/src</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </dependency>
+
+ <!-- Tests -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.10</version>
+ <classifier>jdk15</classifier>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added:
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/richfaces/demo/MenuBean.java
===================================================================
---
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/richfaces/demo/MenuBean.java
(rev 0)
+++
sandbox/trunk/examples/dropdownmenu-demo/src/main/java/org/richfaces/demo/MenuBean.java 2010-12-02
10:00:57 UTC (rev 20288)
@@ -0,0 +1,43 @@
+package org.richfaces.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean
+@SessionScoped
+public class MenuBean {
+ 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;
+ }
+}
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/WEB-INF/web.xml 2010-12-02
10:00:57 UTC (rev 20288)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <display-name>Sample RichFaces 4 Application</display-name>
+
+ <!-- context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>#{skinBean.enableElementsSkinning}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>#{skinBean.enableClassesSkinning}</param-value>
+ </context-param -->
+
+
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>faces/index.xhtml</welcome-file>
+ </welcome-file-list>
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+</web-app>
\ No newline at end of file
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/copy.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/copy.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/create_doc.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/create_doc.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/ico1.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/ico1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/ico2.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/ico2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/input_bg.png
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/input_bg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/menu_item_bg.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/menu_item_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/menu_list_bg.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/menu_list_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/node.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/node.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/open.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/open.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/save.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/save.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/save_all.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/save_all.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/spacer.gif
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/images/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml
===================================================================
--- sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml
(rev 0)
+++ sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/index.xhtml 2010-12-02
10:00:57 UTC (rev 20288)
@@ -0,0 +1,69 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ddm="http://richfaces.org/dropDownMenu"
+
xmlns:a4j="http://richfaces.org/a4j">
+ <h:head>
+ <title>Drop Down Menu</title>
+ <style>
+ .pic {
+ margin-bottom: -4px;
+ margin-right: 2px;
+ }
+ </style>
+ </h:head>
+ <h:body>
+ <h:form id="form">
+ <br />
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="Current Selection: "></h:outputText>
+ <h:outputText style="font-weight:bold"
value="#{menuBean.current}"></h:outputText>
+ </a4j:outputPanel>
+ <br />
+ <ddm:dropDownMenu disabled="false" mode="ajax"
onshow="console.info('onshow event');">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage value="images/copy.gif"
styleClass="pic"/>
+ <h:outputText value="File"/>
+ </h:panelGroup>
+ </f:facet>
+ <f:facet name="labelDisabled">
+ <h:panelGroup>
+ <h:graphicImage value="images/copy.gif"
styleClass="pic"/>
+ <h:outputText value="(disabled)File"/>
+ </h:panelGroup>
+ </f:facet>
+ <ddm:menuItem label="New"
icon="images/create_doc.gif"
+ action="#{menuBean.doNew}">
+
+ </ddm:menuItem>
+ <ddm:menuItem label="Open"
action="#{menuBean.doOpen}">
+ <f:facet name="icon">
+ <h:graphicImage value="images/open.gif" />
+ </f:facet>
+ </ddm:menuItem>
+ <ddm:menuGroup label="Save As..."
disabled="true">
+ <ddm:menuItem label="Save"
icon="images/save.gif" >
+ <f:facet name="icon">
+ <h:graphicImage value="images/save.gif" />
+ </f:facet>
+ </ddm:menuItem>
+ <ddm:menuItem label="Save All"
icon="images/save_all.gif" ></ddm:menuItem>
+ </ddm:menuGroup>
+ <ddm:menuGroup label="Save As...">
+ <ddm:menuItem label="Save"
icon="images/save.gif" />
+ <ddm:menuItem label="Save All"
icon="images/save_all.gif" ></ddm:menuItem>
+ </ddm:menuGroup>
+ <ddm:menuItem label="Close"
action="#{menuBean.doClose}"/>
+ <ddm:menuItem label="Close" disabled="true"/>
+ <ddm:menuSeparator id="menuSeparator11" />
+ <ddm:menuItem label="Exit"
action="#{menuBean.doExit}"/>
+ <ddm:menuItem action="#{menuBean.doExit}">
+ ---EXIT--- <input type="text" />
+ </ddm:menuItem>
+ </ddm:dropDownMenu>
+ </h:form>
+ </h:body>
+</html>
\ No newline at end of file
Added: sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/indexWithToolBar.xhtml
===================================================================
--- sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/indexWithToolBar.xhtml
(rev 0)
+++
sandbox/trunk/examples/dropdownmenu-demo/src/main/webapp/indexWithToolBar.xhtml 2010-12-02
10:00:57 UTC (rev 20288)
@@ -0,0 +1,65 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ddm="http://richfaces.org/dropDownMenu"
+
xmlns:tb="http://richfaces.org/toolBar">
+ <h:head>
+ <title>Drop Down Menu</title>
+ <style>
+ .pic {
+ margin-bottom: -4px;
+ margin-right: 2px;
+ }
+ </style>
+ </h:head>
+ <h:body>
+
+ <tb:toolBar height="45" itemSeparator="grid"
contentStyle="color:red;">
+ <f:facet name="itemSeparator">
+ ||
+ </f:facet>
+ <tb:toolBarGroup itemSeparator="line"
onitemclick="22">
+ <h:graphicImage value="/images/icons/create_doc.gif"
styleClass="pic"/>
+ <a href="sdsd">link 1</a> Text
+ <a href="sdsd 2">link 2</a>
+ <h:graphicImage value="/images/icons/create_folder.gif"
styleClass="pic" onclick="q1"/>
+ <h:graphicImage value="/images/icons/copy.gif"
styleClass="pic"/>
+ <a href="sdsd">link 3</a> Text
+ <a href="sdsd 2">link 4</a>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup itemSeparator="none">
+ <h:graphicImage value="/images/icons/save.gif"
styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif"
styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif"
styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif"
styleClass="pic" onclick="q2"/>
+ </tb:toolBarGroup>
+ <tb:toolBarGroup itemSeparator="line">
+ <h:graphicImage value="/images/icons/save.gif"
styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif"
styleClass="pic" onclick="q2"/>
+ </tb:toolBarGroup>
+
+ <tb:toolBarGroup location="right"
itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif"
styleClass="pic"/>
+ <h:graphicImage value="/images/icons/filter.gif"
styleClass="pic"/>
+ </tb:toolBarGroup>
+ </tb:toolBar>
+
+ <ddm:dropDownMenu value="File">
+ <ddm:menuItem value="New"
icon="/images/icons/create_doc.gif">
+
+ </ddm:menuItem>
+ <ddm:menuItem value="Open"
icon="/images/icons/open.gif" />
+ <ddm:menuGroup value="Save As...">
+ <ddm:menuItem value="Save"
icon="/images/icons/save.gif" />
+ <ddm:menuItem value="Save All">
+
+ </ddm:menuItem>
+ </ddm:menuGroup>
+ <ddm:menuItem value="Close" />
+ <ddm:menuSeparator id="menuSeparator11" />
+ <ddm:menuItem value="Exit" />
+ </ddm:dropDownMenu>
+ </h:body>
+</html>
\ No newline at end of file