Author: blabno
Date: 2011-12-17 13:09:36 -0500 (Sat, 17 Dec 2011)
New Revision: 23094
Added:
sandbox/trunk/ui/accesskeyhelper/
sandbox/trunk/ui/accesskeyhelper/bom/
sandbox/trunk/ui/accesskeyhelper/bom/pom.xml
sandbox/trunk/ui/accesskeyhelper/demo/
sandbox/trunk/ui/accesskeyhelper/demo/pom.xml
sandbox/trunk/ui/accesskeyhelper/demo/src/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/java/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/java/org/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/java/org/richfaces/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/java/org/richfaces/sandbox/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/resources/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/resources/rebel.xml
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/MANIFEST.MF
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/context.xml
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/faces-config.xml
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_bike.jpg
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_paint.jpg
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_tunnel.jpg
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/index.jsp
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/menu.xhtml
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/sample_1.xhtml
sandbox/trunk/ui/accesskeyhelper/parent/
sandbox/trunk/ui/accesskeyhelper/parent/pom.xml
sandbox/trunk/ui/accesskeyhelper/pom.xml
sandbox/trunk/ui/accesskeyhelper/ui/
sandbox/trunk/ui/accesskeyhelper/ui/pom.xml
sandbox/trunk/ui/accesskeyhelper/ui/src/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/AbstractAccessKeyHelper.java
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/package-info.java
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/renderkit/html/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/renderkit/html/AccessKeyHelperRenderer.java
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.css
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/richfaces.accesskeyhelper.js
sandbox/trunk/ui/accesskeyhelper/ui/src/test/
sandbox/trunk/ui/accesskeyhelper/ui/src/test/java/
Log:
Implemented accesskeyhelper component.
Property changes on: sandbox/trunk/ui/accesskeyhelper
___________________________________________________________________
Added: svn:ignore
+ .idea
*.iml
target
Property changes on: sandbox/trunk/ui/accesskeyhelper/bom
___________________________________________________________________
Added: svn:ignore
+ .idea
*.iml
target
Added: sandbox/trunk/ui/accesskeyhelper/bom/pom.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/bom/pom.xml (rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/bom/pom.xml 2011-12-17 18:09:36 UTC (rev 23094)
@@ -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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-bom</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: accesskeyhelper 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>accesskeyhelper-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/accesskeyhelper/demo
___________________________________________________________________
Added: svn:ignore
+ .idea
*.iml
target
Added: sandbox/trunk/ui/accesskeyhelper/demo/pom.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/pom.xml (rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/pom.xml 2011-12-17 18:09:36 UTC (rev 23094)
@@ -0,0 +1,70 @@
+<?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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>accesskeyhelper-demo</artifactId>
+ <name>Richfaces UI Components: accesskeyhelper demo</name>
+ <packaging>war</packaging>
+ <build>
+ <finalName>accesskeyhelper-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-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/accesskeyhelper/demo/src/main/resources/rebel.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/resources/rebel.xml
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/resources/rebel.xml 2011-12-17 18:09:36
UTC (rev 23094)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.zeroturnaround.com"
+
xsi:schemaLocation="http://www.zeroturnaround.com
http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
+
+ <classpath>
+ <dir
name="/home/bernard/projects/richfaces/sandbox/trunk/ui/accesskeyhelper/demo/target/classes"></dir>
+ <dir
name="/home/bernard/projects/richfaces/sandbox/trunk/ui/accesskeyhelper/ui/target/classes"></dir>
+ </classpath>
+
+ <web>
+ <link target="/">
+ <dir
name="/home/bernard/projects/richfaces/sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp"></dir>
+ </link>
+ </web>
+
+</application>
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/MANIFEST.MF 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/context.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/context.xml
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/META-INF/context.xml 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,23 @@
+<?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.
+ -->
+
+<Context antiJARLocking="true" path="/notify-demo"/>
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/faces-config.xml 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,28 @@
+<?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"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+</faces-config>
\ No newline at end of file
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/WEB-INF/web.xml 2011-12-17
18:09:36 UTC (rev 23094)
@@ -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>AccessKeyHelper 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/accesskeyhelper/demo/src/main/webapp/img/banner_bike.jpg
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_bike.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_paint.jpg
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_paint.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_tunnel.jpg
===================================================================
(Binary files differ)
Property changes on:
sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/img/banner_tunnel.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/index.jsp
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/index.jsp
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/index.jsp 2011-12-17 18:09:36
UTC (rev 23094)
@@ -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/accesskeyhelper/demo/src/main/webapp/menu.xhtml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/menu.xhtml
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/menu.xhtml 2011-12-17 18:09:36
UTC (rev 23094)
@@ -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/accesskeyhelper/demo/src/main/webapp/sample_1.xhtml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/sample_1.xhtml
(rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/demo/src/main/webapp/sample_1.xhtml 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,61 @@
+<!--
+ 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:h="http://java.sun.com/jsf/html"
+
xmlns:accesskeyhelper="http://richfaces.org/sandbox/accesskeyhelper&...
+<h:head>
+ <title>Carousel sample</title>
+</h:head>
+<h:body class="rich-container">
+ <style type="text/css">
+ a:hover, a:active, a:focus {
+ background-color: inherit;
+ color: blue;
+ text-shadow: 0 3px 3px #AAAAAA;
+ }
+ </style>
+ <ui:include src="menu.xhtml"/>
+
+ <p>
+ Press TAB to see accesskey hints. </p>
+
+ <accesskeyhelper:accesskeyhelper/>
+
+
+ <div>
+ <label for="name">Name:</label>
+ <input id="name" type="text" accesskey="n"/>
+ </div>
+ We can have two objects with the same access key like in this case:
+ <ul>
+ <li><a accesskey="b"
href="#b1">Barnie</a></li>
+ <li><a accesskey="b"
href="#b2">Bill</a></li>
+ <li><a accesskey="b"
href="#b3">Buck</a></li>
+ </ul>
+ Unfortunately stuff with the same accesskey must be in the same list, so this wont
work:
+ <a href="#richfaces" accesskey="r">RichFaces</a>
compomponent development with
+ <a href="#jrebel" accesskey="r">jRebel</a> is way
fast.
+</h:body>
+</html>
Property changes on: sandbox/trunk/ui/accesskeyhelper/parent
___________________________________________________________________
Added: svn:ignore
+ .idea
*.iml
target
Added: sandbox/trunk/ui/accesskeyhelper/parent/pom.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/parent/pom.xml (rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/parent/pom.xml 2011-12-17 18:09:36 UTC (rev 23094)
@@ -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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-parent</artifactId>
+ <name>Richfaces UI Components: accesskeyhelper 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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-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/accesskeyhelper/pom.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/pom.xml (rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/pom.xml 2011-12-17 18:09:36 UTC (rev 23094)
@@ -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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>accesskeyhelper-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: accesskeyhelper 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>accesskeyhelper-ui clean install</ui>
+ <demo>accesskeyhelper-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/accesskeyhelper/ui
___________________________________________________________________
Added: svn:ignore
+ .idea
*.iml
target
Added: sandbox/trunk/ui/accesskeyhelper/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/accesskeyhelper/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/accesskeyhelper/ui/pom.xml 2011-12-17 18:09:36 UTC (rev 23094)
@@ -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.accesskeyhelper</groupId>
+ <artifactId>accesskeyhelper-parent</artifactId>
+ <version>4.1.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+ <artifactId>accesskeyhelper-ui</artifactId>
+ <name>Richfaces UI Components: accesskeyhelper 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/accesskeyhelper/ui/src/main/java/org/richfaces/component/AbstractAccessKeyHelper.java
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/AbstractAccessKeyHelper.java
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/AbstractAccessKeyHelper.java 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,43 @@
+/*
+ * 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.*;
+import org.richfaces.renderkit.html.AccessKeyHelperRenderer;
+
+import javax.faces.component.UIComponentBase;
+
+@JsfComponent(tag = @Tag(name = "accesskeyhelper", type = TagType.Facelets),
+ renderer = @JsfRenderer(family = AbstractAccessKeyHelper.COMPONENT_FAMILY, type =
AccessKeyHelperRenderer.RENDERER_TYPE))
+public abstract class AbstractAccessKeyHelper extends UIComponentBase {
+// ------------------------------ FIELDS ------------------------------
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.AccessKeyHelper";
+
+ public static final String COMPONENT_TYPE =
"org.richfaces.AccessKeyHelper";
+
+// -------------------------- OTHER METHODS --------------------------
+
+ @Attribute
+ public abstract String getShortcutKey();
+}
Added:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/package-info.java
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/component/package-info.java 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,4 @@
+@TagLibrary(uri = "http://richfaces.org/sandbox/accesskeyhelper", shortName =
"accesskeyhelper", prefix = "accesskeyhelper",
+ displayName = "AccessKeyHelper component tags") package
org.richfaces.component;
+
+import org.richfaces.cdk.annotations.TagLibrary;
\ No newline at end of file
Added:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/renderkit/html/AccessKeyHelperRenderer.java
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/renderkit/html/AccessKeyHelperRenderer.java
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/java/org/richfaces/renderkit/html/AccessKeyHelperRenderer.java 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,99 @@
+/*
+ * 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.AbstractAccessKeyHelper;
+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 = AbstractAccessKeyHelper.COMPONENT_FAMILY, type =
AccessKeyHelperRenderer.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-base-component.js", target =
"head"),
+ @ResourceDependency(name = "jquery.accesskey.js", target =
"head"),
+ @ResourceDependency(name = "richfaces.accesskeyhelper.js", target =
"head"),
+ @ResourceDependency(name = "jquery.accesskey.css", target =
"head")})
+public class AccessKeyHelperRenderer extends RendererBase {
+// ------------------------------ FIELDS ------------------------------
+
+ public static final String RENDERER_TYPE =
"org.richfaces.AccessKeyHelperRenderer";
+
+ private static final Map<String, Object> DEFAULTS;
+
+// -------------------------- STATIC METHODS --------------------------
+
+ static {
+ Map<String, Object> defaults = new HashMap<String, Object>();
+ defaults.put("shortcutKey", "\t");
+ DEFAULTS = Collections.unmodifiableMap(defaults);
+ }
+
+// -------------------------- OTHER METHODS --------------------------
+
+ @Override
+ public void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ if (!(component instanceof AbstractAccessKeyHelper)) {
+ return;
+ }
+ writer.startElement(HtmlConstants.DIV_ELEM, null);
+ String clientId = component.getClientId(context);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, clientId, "type");
+ writer.startElement(HtmlConstants.SCRIPT_ELEM, null);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript",
"type");
+ final Map<String, Object> options = getOptions((AbstractAccessKeyHelper)
component);
+ writer.writeText(new JSObject("RichFaces.ui.AccessKeyHelper", clientId,
options), null);
+ writer.writeText(";", null);
+ writer.endElement(HtmlConstants.SCRIPT_ELEM);
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ 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);
+ }
+ }
+
+
+ protected Map<String, Object> getOptions(AbstractAccessKeyHelper
accesskeyhelper) throws IOException {
+ /**
+ * Include only attributes that are actually set.
+ */
+ Map<String, Object> options = new HashMap<String, Object>();
+ addOptionIfSetAndNotDefault("shortcutKey",
accesskeyhelper.getShortcutKey(), options);
+ return options;
+ }
+}
Added:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.css
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.css
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.css 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,21 @@
+.accesskey {
+ /* Make location static */
+ position: absolute;
+
+ background-color: #666;
+ color: white;
+ padding: 3px;
+ border-radius: 3px;
+
+ opacity: 0;
+ -webkit-transition: opacity 1s;
+ -moz-transition: opacity 1s;
+}
+
+.accesskey-shown .accesskey {
+ opacity: 1
+}
+
+.accesskey-shown .accesskey:hover {
+ opacity: 0.2
+}
\ No newline at end of file
Added:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/jquery.accesskey.js 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,177 @@
+/*!
+ jQuery-Accesskey
+ Copyright (C) 2010 Denis Sokolov
http://sokolov.cc
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <
http://www.gnu.org/licenses/>.
+ */
+
+/*
+ Known issues
+ - accesskey on label adds accesskey char to the input
+ */
+(function($) {
+ $.accesskeyHelper = function(options) {
+ var defaults = {shortcutKeyCode:9};
+ options = $.extend(defaults, options);
+ // I would use jQuery.sub() to have our own jQuery, but
+ // it did not work with .extend($.expr[':']) for whatever reason.
+ var $$ = {
+ // Tells if the given element is focused now
+ 'focused': function(el) {
+ // Works both with jQuery and DOM elements
+ if (el.jquery && el.length) {
+ el = el[0];
+ }
+ return el == document.activeElement;
+ },
+ // Tells if you can enter characters in the field
+ // Absolutely incomplete.
+ // Just thinking about input[type="range"] and similar makes me
shiver
+ // Anyway, I stay on the safe side
+ 'writable': function(el) {
+ el = $(el);
+ var tag = el.get(0).tagName.toLowerCase();
+ if (tag == 'textarea') {
+ return true;
+ }
+ return tag == 'input' && el.attr('type') !=
'submit';
+
+ }
+ };
+
+
+ // Init adds labels to the elements
+ // We do not need to do this hard work if the user does not use keyboard
+ // Thus we only init on first click of tab
+ var init = function() {
+ // Init only once
+ init = null;
+
+ $('[accesskey]').each(function() {
+ var me = $(this);
+ me.after('<kbd class="accesskey">' +
me.attr('accesskey') + '</kbd>');
+ });
+
+ // Trigger redraw to enable transitions
+ // Do not understand? Just comment this line and see the result, it's
hard to explain
+ $('body').width();
+ };
+
+
+ // Main internal controller
+ var hints = (function() {
+ var body = $('body');
+ var shown = false;
+ var api = {
+ 'show': function() {
+ body.addClass('accesskey-shown');
+ shown = true
+ },
+ 'hide': function() {
+ body.removeClass('accesskey-shown');
+ shown = false
+ },
+ 'shown': function() {
+ return shown
+ }
+ };
+ api['preview'] = function() {
+ if (shown) {
+ return true;
+ }
+ api.show();
+ setTimeout(function() {
+ api.hide();
+ }, 6000);
+ };
+ return api
+ })();
+
+
+ $(window).bind('keydown.jquery-accesskey', function(e) {
+ if (e.which == 27 && $$.writable(document.activeElement)) {
+ // Esc to friendly blur
+ if (init) {
+ init();
+ }
+ $(document.activeElement).blur();
+ hints.preview();
+ }
+ if (e.which == options.shortcutKeyCode) {
+ // Tab button trigger
+ // We show hints for 6 seconds when somebody presses the Tab key
+ if (init) {
+ init();
+ }
+ hints.preview();
+ }
+ });
+
+ // Working with DOM
+ var elements = {
+ 'getByKey': function(sym) {
+ sym = sym.toLowerCase();
+ try {
+ var els = $('[accesskey="' + sym + '"]');
+ } catch (err) {
+ return false;
+ }
+ if (els.length == 0) {
+ return false;
+ }
+ return els;
+ },
+ 'getNextTarget': function(els) {
+ // If only one element, choose itself
+ if (els.length == 1) {
+ return els.eq(0);
+ }
+
+ // Find a focused element
+ var f = els.filter(function() {
+ return $$.focused(this)
+ });
+ if (f.length == 0 || $$.focused(els.eq(-1)))
+ // Focus could be somewhere else, then just focus the first one
+ {
+ return els.eq(0);
+ } else
+ // Move on to the next element after the focused
+ {
+ return els.eq(els.index(f) + 1);
+ }
+ }
+ };
+
+ // Shortcut keys
+ $(window).bind('keypress.jquery-accesskey', function(e) {
+ // If we are in the field, just let the user type. :)
+ if ($$.writable(e.target)) {
+ return true;
+ }
+
+ // Find elements with this accesskey
+ var els = elements.getByKey(String.fromCharCode(e.which));
+ if (!els) {
+ return true;
+ }
+
+ var target = elements.getNextTarget(els).focus();
+ // Prevent the letter from being put into the field
+ if ($$.writable(target)) {
+ return false;
+ }
+ });
+ }
+})(jQuery);
\ No newline at end of file
Added:
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/richfaces.accesskeyhelper.js
===================================================================
---
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/richfaces.accesskeyhelper.js
(rev 0)
+++
sandbox/trunk/ui/accesskeyhelper/ui/src/main/resources/META-INF/resources/richfaces.accesskeyhelper.js 2011-12-17
18:09:36 UTC (rev 23094)
@@ -0,0 +1,34 @@
+(function ($, rf) {
+
+
+ // Create (for example) ui container for our component class
+ rf.ui = rf.ui || {};
+ // Default options definition if needed for the component
+ // var defaultOptions = {};
+ // Extending component class with new properties and methods using extendClass
+ // $super - reference to the parent prototype, will be available inside those
methods
+ rf.ui.AccessKeyHelper = rf.BaseComponent.extendClass({
+ // class name
+ name:"AccessKeyHelper",
+ init: function (options) {
+ options = $.extend({shortcutKey:String.fromCharCode(9)}, options);
+ // call constructor of parent class if needed
+ $super.constructor.call(this);
+ // attach component object to DOM element for
+ // future cleaning and for client side API calls
+// this.attachToDom(this.id);
+ // ...
+
$.accesskeyHelper({shortcutKeyCode:options['shortcutKey'].charCodeAt(0)});
+ },
+ // 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.AccessKeyHelper.$super;
+})(jQuery, RichFaces);
\ No newline at end of file