Author: blabno
Date: 2011-11-29 10:16:33 -0500 (Tue, 29 Nov 2011)
New Revision: 23009
Added:
sandbox/trunk/ui/contextmenu/
sandbox/trunk/ui/contextmenu/bom/
sandbox/trunk/ui/contextmenu/bom/pom.xml
sandbox/trunk/ui/contextmenu/demo/
sandbox/trunk/ui/contextmenu/demo/pom.xml
sandbox/trunk/ui/contextmenu/demo/src/
sandbox/trunk/ui/contextmenu/demo/src/main/
sandbox/trunk/ui/contextmenu/demo/src/main/java/
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/sandbox/
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/sandbox/contextmenu/
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/sandbox/contextmenu/Bean.java
sandbox/trunk/ui/contextmenu/demo/src/main/resources/
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/META-INF/
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/META-INF/MANIFEST.MF
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/faces-config.xml
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/img/
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/img/print.gif
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/index.jsp
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/menu.xhtml
sandbox/trunk/ui/contextmenu/demo/src/main/webapp/sample_1.xhtml
sandbox/trunk/ui/contextmenu/parent/
sandbox/trunk/ui/contextmenu/parent/pom.xml
sandbox/trunk/ui/contextmenu/pom.xml
sandbox/trunk/ui/contextmenu/ui/
sandbox/trunk/ui/contextmenu/ui/pom.xml
sandbox/trunk/ui/contextmenu/ui/src/
sandbox/trunk/ui/contextmenu/ui/src/main/
sandbox/trunk/ui/contextmenu/ui/src/main/java/
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/AbstractContextmenu.java
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/package-info.java
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/renderkit/html/
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/renderkit/html/ContextmenuRenderer.java
sandbox/trunk/ui/contextmenu/ui/src/main/resources/
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/contextmenu.css
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/jquery.contextMenu.js
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/richfaces.contextmenu.js
sandbox/trunk/ui/contextmenu/ui/src/test/
sandbox/trunk/ui/contextmenu/ui/src/test/java/
Log:
Implemented contextmenu compoment for RF 4.X.
Property changes on: sandbox/trunk/ui/contextmenu
___________________________________________________________________
Added: svn:ignore
+ *.iml
.idea
Property changes on: sandbox/trunk/ui/contextmenu/bom
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/contextmenu/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/bom/pom.xml (rev 0)
+++ sandbox/trunk/ui/contextmenu/bom/pom.xml 2011-11-29 15:16:33 UTC (rev 23009)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-bom</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: contextmenu bom</name>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>contextmenu-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+
<url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Property changes on: sandbox/trunk/ui/contextmenu/demo
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/contextmenu/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/pom.xml (rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/pom.xml 2011-11-29 15:16:33 UTC (rev 23009)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
+
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>contextmenu-demo</artifactId>
+ <name>Richfaces UI Components: contextmenu demo</name>
+ <packaging>war</packaging>
+ <build>
+ <finalName>contextmenu-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+</project>
+
+
Added:
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/sandbox/contextmenu/Bean.java
===================================================================
---
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/sandbox/contextmenu/Bean.java
(rev 0)
+++
sandbox/trunk/ui/contextmenu/demo/src/main/java/org/richfaces/sandbox/contextmenu/Bean.java 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.sandbox.contextmenu;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.io.Serializable;
+
+public class Bean implements Serializable {
+// -------------------------- OTHER METHODS --------------------------
+
+ public void action() {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Action
performed"));
+ }
+}
Property changes on: sandbox/trunk/ui/contextmenu/demo/src/main/resources
___________________________________________________________________
Added: svn:ignore
+ rebel.xml
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/src/main/webapp/META-INF/MANIFEST.MF 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/faces-config.xml 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,31 @@
+<?xml version='1.0' encoding='UTF-8'?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+
+<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
version="2.0">
+
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+
<managed-bean-class>org.richfaces.sandbox.contextmenu.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/src/main/webapp/WEB-INF/web.xml 2011-11-29 15:16:33
UTC (rev 23009)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+
+<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"
+ id="WebApp_ID" version="2.5">
+ <display-name>Contextmenu demo</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>classic</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</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>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/img/print.gif
===================================================================
(Binary files differ)
Property changes on: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/img/print.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/index.jsp
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/src/main/webapp/index.jsp
(rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/src/main/webapp/index.jsp 2011-11-29 15:16:33 UTC
(rev 23009)
@@ -0,0 +1,29 @@
+<%--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ --%>
+
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head></head>
+<body>
+<jsp:forward page="sample_1.jsf"/>
+</body>
+</html>
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/menu.xhtml
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/src/main/webapp/menu.xhtml
(rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/src/main/webapp/menu.xhtml 2011-11-29 15:16:33 UTC
(rev 23009)
@@ -0,0 +1,29 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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:component
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">
+ <h:panelGrid colsumns="3">
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/sample_1.jsf">Example
1</h:outputLink>
+ </h:panelGrid>
+</ui:component>
Added: sandbox/trunk/ui/contextmenu/demo/src/main/webapp/sample_1.xhtml
===================================================================
--- sandbox/trunk/ui/contextmenu/demo/src/main/webapp/sample_1.xhtml
(rev 0)
+++ sandbox/trunk/ui/contextmenu/demo/src/main/webapp/sample_1.xhtml 2011-11-29 15:16:33
UTC (rev 23009)
@@ -0,0 +1,67 @@
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+
+<!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:rich="http://richfaces.org/rich"
+
xmlns:contextmenu="http://richfaces.org/sandbox/contextmenu">
+<h:head>
+ <title>contextmenu sample</title>
+</h:head>
+<h:body class="rich-container">
+ <style type="text/css">
+
+
+ </style>
+ <script type="text/javascript">
+
+ </script>
+ <ui:include src="menu.xhtml"/>
+
+ <p>
+
+ </p>
+
+ <rich:notifyMessages/>
+
+ <h:form id="f">
+ <contextmenu:contextmenu id="cm" attachTo="panel"
mode="ajax">
+ <rich:menuItem action="#{bean.action}">Everybody do the
monkey (ajax)</rich:menuItem>
+ <rich:menuItem action="#{bean.action}"
mode="server">Monkey on the server</rich:menuItem>
+ <rich:menuSeparator/>
+ <rich:menuItem onclick="alert('Printing');"
label="Print" mode="client">
+ <f:facet name="icon">
+ <h:graphicImage value="/img/print.gif"
alt="print"/>
+ </f:facet>
+ </rich:menuItem>
+ </contextmenu:contextmenu>
+ <rich:panel id="panel">
+ <f:facet name="header">Some panel</f:facet>
+ Click here for context menu
+ </rich:panel>
+
+ </h:form>
+
+</h:body>
+</html>
Property changes on: sandbox/trunk/ui/contextmenu/parent
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/contextmenu/parent/pom.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/parent/pom.xml (rev 0)
+++ sandbox/trunk/ui/contextmenu/parent/pom.xml 2011-11-29 15:16:33 UTC (rev 23009)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-parent</artifactId>
+ <name>Richfaces UI Components: contextmenu parent</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+
<org.richfaces.cdk.version>4.1.0-SNAPSHOT</org.richfaces.cdk.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-bom</artifactId>
+ <version>${project.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xml-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+
<url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Added: sandbox/trunk/ui/contextmenu/pom.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/pom.xml (rev 0)
+++ sandbox/trunk/ui/contextmenu/pom.xml 2011-11-29 15:16:33 UTC (rev 23009)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?><!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>contextmenu-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: contextmenu Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ <module>demo</module>
+ </modules>
+
+ <profiles>
+ <profile>
+ <id>cli</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>1.0.6-SNAPSHOT</version>
+ <configuration>
+ <userAliases>
+ <ui>contextmenu-ui clean install</ui>
+ <demo>contextmenu-demo clean package</demo>
+ </userAliases>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>bernard.labno.pl</id>
+ <name>MyCo Internal Repository</name>
+
<url>http://bernard.labno.pl/artifactory/libs-snapshot-local</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Property changes on: sandbox/trunk/ui/contextmenu/ui
___________________________________________________________________
Added: svn:ignore
+ *.iml
Added: sandbox/trunk/ui/contextmenu/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/contextmenu/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/contextmenu/ui/pom.xml 2011-11-29 15:16:33 UTC (rev 23009)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright , 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.
+ -->
+
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.sandbox.ui.contextmenu</groupId>
+ <artifactId>contextmenu-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+ <artifactId>contextmenu-ui</artifactId>
+ <name>Richfaces UI Components: contextmenu ui</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>${org.richfaces.cdk.version}</version>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/sandbox/tr...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/sand...
+ </developerConnection>
+ <
url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+
+</project>
Added:
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/AbstractContextmenu.java
===================================================================
---
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/AbstractContextmenu.java
(rev 0)
+++
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/AbstractContextmenu.java 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.component;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.renderkit.html.ContextmenuRenderer;
+
+/**
+ * We extend from AbstractDropDownMenu because AbstractMenuItem copies value of mode from
parent only if it's AbstractDropDownMenu.
+ */
+@JsfComponent(tag = @Tag(name = "contextmenu", handler =
"org.richfaces.view.facelets.html.contextmenuTagHandler", generate = true, type
= TagType.Facelets),
+ renderer = @JsfRenderer(family = AbstractContextmenu.COMPONENT_FAMILY, type =
ContextmenuRenderer.RENDERER_TYPE),
+ attributes = {"ajax-props.xml", "core-props.xml"})
+public abstract class AbstractContextmenu extends AbstractDropDownMenu {
+// ------------------------------ FIELDS ------------------------------
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.ContextMenu";
+
+ public static final String COMPONENT_TYPE = "org.richfaces.ContextMenu";
+
+// -------------------------- OTHER METHODS --------------------------
+
+ @Attribute
+ public abstract String getAttachTo();
+
+ @Attribute(hidden = true)
+ public abstract Positioning getDirection();
+
+ @Attribute(hidden = true)
+ public abstract int getHideDelay();
+
+ @Attribute(hidden = true)
+ public abstract int getHorizontalOffset();
+
+ @Attribute(hidden = true)
+ public abstract Positioning getJointPoint();
+
+ @Attribute(hidden = true)
+ public abstract String getLabel();
+
+ @Attribute(hidden = true)
+ public abstract String getOngrouphide();
+
+ @Attribute(hidden = true)
+ public abstract String getOngroupshow();
+
+ @Attribute(hidden = true)
+ public abstract String getOnhide();
+
+ @Attribute(hidden = true)
+ public abstract String getOnitemclick();
+
+ @Attribute(hidden = true)
+ public abstract String getOnshow();
+
+ @Attribute(hidden = true)
+ public abstract int getPopupWidth();
+
+ @Attribute(hidden = true)
+ public abstract int getShowDelay();
+
+ @Attribute(hidden = true)
+ public abstract String getShowEvent();
+
+ @Attribute(hidden = true)
+ public abstract int getVerticalOffset();
+
+ @Attribute(hidden = true)
+ public abstract boolean isDisabled();
+}
Added:
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
---
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/package-info.java
(rev 0)
+++
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/component/package-info.java 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,4 @@
+@TagLibrary(uri = "http://richfaces.org/sandbox/contextmenu", shortName =
"contextmenu", prefix = "contextmenu",
+ displayName = "contextmenu component tags") package
org.richfaces.component;
+
+import org.richfaces.cdk.annotations.TagLibrary;
\ No newline at end of file
Added:
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/renderkit/html/ContextmenuRenderer.java
===================================================================
---
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/renderkit/html/ContextmenuRenderer.java
(rev 0)
+++
sandbox/trunk/ui/contextmenu/ui/src/main/java/org/richfaces/renderkit/html/ContextmenuRenderer.java 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.renderkit.html;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractContextmenu;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RendererBase;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+@JsfRenderer(family = AbstractContextmenu.COMPONENT_FAMILY, type =
ContextmenuRenderer.RENDERER_TYPE)
+@ResourceDependencies({@ResourceDependency(library = "javax.faces", name =
"jsf.js"), @ResourceDependency(name = "jquery.js", target =
"head"),
+ @ResourceDependency(name = "richfaces.js", target = "head"),
@ResourceDependency(name = "richfaces-event.js", target = "head"),
+ @ResourceDependency(name = "richfaces-base-component.js", target =
"head"),
+ @ResourceDependency(library = "org.richfaces", name =
"jquery-ui-core.js", target = "head"),
+ @ResourceDependency(name = "jquery.contextMenu.js", target =
"head"), @ResourceDependency(name = "richfaces.contextmenu.js", target
= "head"),
+ @ResourceDependency(name = "contextmenu.css", target = "head")})
+public class ContextmenuRenderer extends RendererBase {
+// ------------------------------ FIELDS ------------------------------
+
+ public static final String RENDERER_TYPE =
"org.richfaces.ContextmenuRenderer";
+
+ private static final Map<String, Object> DEFAULTS;
+
+// -------------------------- STATIC METHODS --------------------------
+
+ static {
+ Map<String, Object> defaults = new HashMap<String, Object>();
+ DEFAULTS = Collections.unmodifiableMap(defaults);
+ }
+
+ protected void addOptionIfSetAndNotDefault(String optionName, Object value,
Map<String, Object> options) {
+ if (value != null && !"".equals(value) &&
!value.equals(DEFAULTS.get(optionName)) && !(value instanceof Collection
&& ((Collection) value).size() == 0)
+ && !(value instanceof Map && ((Map) value).size() == 0)) {
+ options.put(optionName, value);
+ }
+ }
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ if (!(component instanceof AbstractContextmenu)) {
+ return;
+ }
+ String clientId = component.getClientId(context);
+ writer.startElement(HtmlConstants.DIV_ELEM, null);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, clientId,
HtmlConstants.ID_ATTRIBUTE);
+ Object styleClass = component.getAttributes().get("styleClass");
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-cnm" +
(styleClass == null ? "" : styleClass), HtmlConstants.STYLE_CLASS_ATTR);
+ getUtils().encodePassThruAttribute(context, component.getAttributes(), writer,
"style");
+ }
+
+ @Override
+ protected void doEncodeChildren(ResponseWriter writer, FacesContext context,
UIComponent component) throws IOException {
+ for (UIComponent child : component.getChildren()) {
+ child.encodeAll(context);
+ }
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ if (!(component instanceof AbstractContextmenu)) {
+ return;
+ }
+ String clientId = component.getClientId(context);
+ writer.startElement(HtmlConstants.SCRIPT_ELEM, null);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript",
"type");
+ final Map<String, Object> options = getOptions(context,
(AbstractContextmenu) component);
+ writer.writeText(new JSObject("RichFaces.ui.ContextMenu", clientId,
options), null);
+ writer.writeText(";", null);
+ writer.endElement(HtmlConstants.SCRIPT_ELEM);
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ protected Map<String, Object> getOptions(FacesContext context,
AbstractContextmenu contextmenu) throws IOException {
+ /**
+ * Include only attributes that are actually set.
+ */
+ Map<String, Object> options = new HashMap<String, Object>();
+ String attachToClientId;
+ if (contextmenu.getAttachTo() != null) {
+ attachToClientId = getUtils().clientId(context,
getUtils().findComponentFor(contextmenu, contextmenu.getAttachTo()));
+ } else {
+ attachToClientId = getUtils().clientId(context, contextmenu.getParent());
+ }
+ addOptionIfSetAndNotDefault("attachTo", attachToClientId, options);
+ return options;
+ }
+}
Added:
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/contextmenu.css
===================================================================
--- sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/contextmenu.css
(rev 0)
+++
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/contextmenu.css 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,11 @@
+.rf-cnm {
+ position: absolute;
+ z-index: 99999;
+ border: solid 1px #CCC;
+ background: #EEE;
+ padding: 0;
+ margin: 0;
+ display: none;
+}
+
+
Added:
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/jquery.contextMenu.js
===================================================================
---
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/jquery.contextMenu.js
(rev 0)
+++
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/jquery.contextMenu.js 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,92 @@
+(function($) {
+ $.extend($.fn, {
+
+ contextMenu: function(o, callback) {
+ // Defaults
+ if (o.menu == undefined) return false;
+ var jmenu = jQuery(o.menu);
+ if (o.inSpeed == undefined) o.inSpeed = 150;
+ if (o.outSpeed == undefined) o.outSpeed = 75;
+ // 0 needs to be -1 for expected results (no fade)
+ if (o.inSpeed == 0) o.inSpeed = -1;
+ if (o.outSpeed == 0) o.outSpeed = -1;
+ // Loop each context menu
+ $(this).each(function() {
+ var el = $(this);
+ var offset = $(el).offset();
+ // Simulate a true right click
+ $(this).mousedown(function(e) {
+ var evt = e;
+ evt.stopPropagation();
+ $(this).mouseup(function(e) {
+ e.stopPropagation();
+ var srcElement = $(this);
+ $(this).unbind('mouseup');
+ if (evt.button == 2) {
+ // Get this context menu
+ var menu = jmenu;
+
+ if ($(el).hasClass('disabled')) return false;
+
+ // Detect mouse position
+ var d = {}, x, y;
+ if (self.innerHeight) {
+ d.pageYOffset = self.pageYOffset;
+ d.pageXOffset = self.pageXOffset;
+ d.innerHeight = self.innerHeight;
+ d.innerWidth = self.innerWidth;
+ } else if (document.documentElement &&
+ document.documentElement.clientHeight) {
+ d.pageYOffset = document.documentElement.scrollTop;
+ d.pageXOffset = document.documentElement.scrollLeft;
+ d.innerHeight = document.documentElement.clientHeight;
+ d.innerWidth = document.documentElement.clientWidth;
+ } else if (document.body) {
+ d.pageYOffset = document.body.scrollTop;
+ d.pageXOffset = document.body.scrollLeft;
+ d.innerHeight = document.body.clientHeight;
+ d.innerWidth = document.body.clientWidth;
+ }
+ (e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft;
+ (e.pageY) ? y = e.pageY : y = e.clientY + d.scrollTop;
+
+ // Show the menu
+ $(document).unbind('click');
+ $(menu).css({ top: y, left: x }).fadeIn(o.inSpeed);
+
+ // Hide bindings
+ setTimeout(function() { // Delay for Mozilla
+ $(document).click(function() {
+
$(document).unbind('click').unbind('keypress');
+ $(menu).fadeOut(o.outSpeed);
+ return false;
+ });
+ }, 0);
+ }
+ });
+ });
+
+ // Disable text selection
+ if ($.browser.mozilla) {
+ jmenu.each(function() {
+ $(this).css({ 'MozUserSelect' : 'none' });
+ });
+ } else if ($.browser.msie) {
+ jmenu.each(function() {
+ $(this).bind('selectstart.disableTextSelect', function()
{
+ return false;
+ });
+ });
+ } else {
+ jmenu.each(function() {
+ $(this).bind('mousedown.disableTextSelect', function() {
+ return false;
+ });
+ });
+ }
+
+ });
+ return $(this);
+ }
+ });
+})(jQuery);
\ No newline at end of file
Added:
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/richfaces.contextmenu.js
===================================================================
---
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/richfaces.contextmenu.js
(rev 0)
+++
sandbox/trunk/ui/contextmenu/ui/src/main/resources/META-INF/resources/richfaces.contextmenu.js 2011-11-29
15:16:33 UTC (rev 23009)
@@ -0,0 +1,52 @@
+/**
+ * This function evaluates code in template with object in ScopeChain.
+ * This is usefull if you need to evaluate code that uses member names
+ * that colide with external names that the code refers to.
+ * There is almost exact method in utils.js called Richfaces.eval,
+ * but it swallows exception thrown during evaluation, which makes debugging
+ * hard.
+ */
+(function ($, rf) {
+ // Create (for example) ui container for our component class
+ rf.ui = rf.ui || {};
+ // Extending component class with new properties and methods using extendClass
+ // $super - reference to the parent prototype, will be available inside those
methods
+ rf.ui.ContextMenu = rf.BaseComponent.extendClass({
+ // class name
+ name:"ContextMenu",
+ init: function (componentId, options) {
+ var contextmenu = this;
+ this.element = document.getElementById(componentId);
+ if (!this.element) {
+ throw "No element with id '" + componentId + "'
found.";
+ }
+ this.container = jQuery(this.element);
+ this.options = $.extend({attachTo:document.body}, options);
+ // call constructor of parent class if needed
+ $super.constructor.call(this, componentId);
+ // attach component object to DOM element for
+ // future cleaning and for client side API calls
+ this.attachToDom(this.id);
+ // ...
+ /**
+ * Plugin init on document load
+ */
+ $(function() {
+ $(document.getElementById(contextmenu.options.attachTo)).contextMenu({
+ menu: contextmenu.element
+ });
+ });
+ },
+ // private functions definition
+
+ // destructor definition
+ destroy: function () {
+ // define destructor if additional cleaning is needed but
+ // in most cases its not nessesary.
+ // call parent’s destructor
+ $super.destroy.call(this);
+ }
+ });
+ // define super class reference - reference to the parent prototype
+ var $super = rf.ui.ContextMenu.$super;
+})(jQuery, RichFaces);
\ No newline at end of file