JBoss Rich Faces SVN: r17775 - in root/ui-sandbox/notify/trunk: bom and 25 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2010-07-08 11:35:39 -0400 (Thu, 08 Jul 2010)
New Revision: 17775
Added:
root/ui-sandbox/notify/trunk/bom/
root/ui-sandbox/notify/trunk/bom/pom.xml
root/ui-sandbox/notify/trunk/demo/
root/ui-sandbox/notify/trunk/demo/pom.xml
root/ui-sandbox/notify/trunk/demo/src/
root/ui-sandbox/notify/trunk/demo/src/main/
root/ui-sandbox/notify/trunk/demo/src/main/java/
root/ui-sandbox/notify/trunk/demo/src/main/java/org/
root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/
root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/sandbox/
root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/sandbox/notify/
root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/sandbox/notify/Greeter.java
root/ui-sandbox/notify/trunk/demo/src/main/webapp/
root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/
root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/MANIFEST.MF
root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/context.xml
root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/
root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/faces-config.xml
root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/web.xml
root/ui-sandbox/notify/trunk/demo/src/main/webapp/index.jsp
root/ui-sandbox/notify/trunk/demo/src/main/webapp/mail.png
root/ui-sandbox/notify/trunk/demo/src/main/webapp/menu.xhtml
root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify.xhtml
root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_1.xhtml
root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_2.xhtml
root/ui-sandbox/notify/trunk/parent/
root/ui-sandbox/notify/trunk/parent/pom.xml
root/ui-sandbox/notify/trunk/pom.xml
root/ui-sandbox/notify/trunk/ui/
root/ui-sandbox/notify/trunk/ui/pom.xml
root/ui-sandbox/notify/trunk/ui/src/
root/ui-sandbox/notify/trunk/ui/src/main/
root/ui-sandbox/notify/trunk/ui/src/main/java/
root/ui-sandbox/notify/trunk/ui/src/main/java/org/
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotify.java
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyMessages.java
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyStack.java
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/NotifyAttributes.java
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyMessagesRenderer.java
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyRenderer.java
root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyStackRenderer.java
root/ui-sandbox/notify/trunk/ui/src/main/resources/
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/notify.taglib.xml
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/error.png
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/fatal.png
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/info.png
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/jquery.pnotify.js
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/notify.ecss
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/richfaces.notify.js
root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/warn.png
root/ui-sandbox/notify/trunk/ui/src/test/
root/ui-sandbox/notify/trunk/ui/src/test/java/
Log:
Initial import of notify component
Added: root/ui-sandbox/notify/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/notify/trunk/bom/pom.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/bom/pom.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,64 @@
+<?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-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-bom</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: notify bom</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <org.richfaces.core.version>4.0.0-SNAPSHOT</org.richfaces.core.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-bom</artifactId>
+ <version>${org.richfaces.core.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>richfaces-ui-notify-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+</project>
Added: root/ui-sandbox/notify/trunk/demo/pom.xml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/pom.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/pom.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,74 @@
+<?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.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>notify-demo</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: notify demo</name>
+ <packaging>war</packaging>
+ <build>
+ <finalName>notify-demo</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-bom</artifactId>
+ <version>${version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-ui</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ </dependencies>
+</project>
+
+
Added: root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/sandbox/notify/Greeter.java
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/sandbox/notify/Greeter.java (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/java/org/richfaces/sandbox/notify/Greeter.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,274 @@
+/*
+ * 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.notify;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.io.Serializable;
+
+public class Greeter implements Serializable {
+
+ private String greeting;
+ private boolean nonblocking;
+ private boolean showDetail;
+ private boolean showSummary = true;
+ private boolean sticky;
+ private boolean showHistory = true;
+ private boolean showShadow = true;
+ private boolean showCloseButton = true;
+ private Integer stayTime = 3000;
+ private Integer animationSpeed = 100;
+ private Integer interval = 800;
+ private Integer delay = 0;
+ private int messagesCount = 3;
+ private Double nonblockingOpacity = .3;
+ private String appearAnimation = "fade";
+ private String hideAnimation = "show";
+ private String stackDir1 = "down";
+ private String stackDir2 = "left";
+ private String stackPush = "bottom";
+ private String styleClass;
+ private String stackStyleClass;
+ private String title = "Sample title";
+ private String text = "Sample text, not too short, but not too long.";
+
+ public void sayHello() {
+ for (int i = 0; i < getMessagesCount(); i++) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, i + ". Hello", greeting));
+ }
+ }
+
+ public void warnMe() {
+ for (int i = 0; i < getMessagesCount(); i++) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, i + ". Stop!", greeting));
+ }
+ }
+
+ public void sayError() {
+ for (int i = 0; i < getMessagesCount(); i++) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, i + ". This is outrage", greeting));
+ }
+ }
+
+ public void sayFatal() {
+ for (int i = 0; i < getMessagesCount(); i++) {
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, i + ". Fatality", greeting));
+ }
+ }
+
+ public String getGreeting() {
+ return greeting;
+ }
+
+ public void setGreeting(String greeting) {
+ this.greeting = greeting;
+ }
+
+ public boolean isNonblocking() {
+ return nonblocking;
+ }
+
+ public void setNonblocking(boolean nonblocking) {
+ this.nonblocking = nonblocking;
+ }
+
+ public boolean isShowDetail() {
+ return showDetail;
+ }
+
+ public void setShowDetail(boolean showDetail) {
+ this.showDetail = showDetail;
+ }
+
+ public void setShowSummary(boolean showSummary) {
+ this.showSummary = showSummary;
+ }
+
+ public boolean isSticky() {
+ return sticky;
+ }
+
+ public void setSticky(boolean sticky) {
+ this.sticky = sticky;
+ }
+
+ public Integer getStayTime() {
+ return stayTime;
+ }
+
+ public void setStayTime(Integer stayTime) {
+ this.stayTime = stayTime;
+ }
+
+ public boolean isShowSummary() {
+ return showSummary;
+ }
+
+ public String getAppearAnimation() {
+ return appearAnimation;
+ }
+
+ public void setAppearAnimation(String appearAnimation) {
+ this.appearAnimation = appearAnimation;
+ }
+
+ public boolean isShowHistory() {
+ return showHistory;
+ }
+
+ public void setShowHistory(boolean showHistory) {
+ this.showHistory = showHistory;
+ }
+
+ public boolean isShowShadow() {
+ return showShadow;
+ }
+
+ public void setShowShadow(boolean showShadow) {
+ this.showShadow = showShadow;
+ }
+
+ public boolean isShowCloseButton() {
+ return showCloseButton;
+ }
+
+ public void setShowCloseButton(boolean showCloseButton) {
+ this.showCloseButton = showCloseButton;
+ }
+
+ public Double getNonblockingOpacity() {
+ return nonblockingOpacity;
+ }
+
+ public void setNonblockingOpacity(Double nonblockingOpacity) {
+ this.nonblockingOpacity = nonblockingOpacity;
+ }
+
+ public String getStackDir1() {
+ return stackDir1;
+ }
+
+ public void setStackDir1(String stackDir1) {
+ this.stackDir1 = stackDir1;
+ }
+
+ public String getStackDir2() {
+ return stackDir2;
+ }
+
+ public void setStackDir2(String stackDir2) {
+ this.stackDir2 = stackDir2;
+ }
+
+ public String getStackPush() {
+ return stackPush;
+ }
+
+ public void setStackPush(String stackPush) {
+ this.stackPush = stackPush;
+ }
+
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public Integer getAnimationSpeed() {
+ return animationSpeed;
+ }
+
+ public void setAnimationSpeed(Integer animationSpeed) {
+ this.animationSpeed = animationSpeed;
+ }
+
+ public String getHideAnimation() {
+ return hideAnimation;
+ }
+
+ public void setHideAnimation(String hideAnimation) {
+ this.hideAnimation = hideAnimation;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public Integer getInterval() {
+ return interval;
+ }
+
+ public void setInterval(Integer interval) {
+ this.interval = interval;
+ }
+
+ public Integer getDelay() {
+ return delay;
+ }
+
+ public void setDelay(Integer delay) {
+ this.delay = delay;
+ }
+
+ public String getStackStyleClass() {
+ return stackStyleClass;
+ }
+
+ public void setStackStyleClass(String stackStyleClass) {
+ this.stackStyleClass = stackStyleClass;
+ }
+
+ public int getMessagesCount() {
+ return messagesCount;
+ }
+
+ public void setMessagesCount(int messagesCount) {
+ this.messagesCount = messagesCount;
+ }
+}
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/MANIFEST.MF 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/context.xml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/context.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/META-INF/context.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,24 @@
+<?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: root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/faces-config.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,33 @@
+<?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>greeter</managed-bean-name>
+ <managed-bean-class>org.richfaces.sandbox.notify.Greeter</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/WEB-INF/web.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,109 @@
+<?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>Schedule 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>
+ <!--TODO what's up with filter?-->
+ <!--<filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>-->
+ <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: root/ui-sandbox/notify/trunk/demo/src/main/webapp/index.jsp
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/index.jsp (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/index.jsp 2010-07-08 15:35:39 UTC (rev 17775)
@@ -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="notify.jsf"/>
+</body>
+</html>
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/mail.png
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/notify/trunk/demo/src/main/webapp/mail.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/menu.xhtml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/menu.xhtml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/menu.xhtml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,32 @@
+<!--
+ 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}/notify.jsf">Example 1</h:outputLink>
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/notify_1.jsf">Example 2</h:outputLink>
+ <h:outputLink value="#{facesContext.externalContext.requestContextPath}/notify_2.jsf">Skining</h:outputLink>
+ </h:panelGrid>
+</ui:component>
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify.xhtml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify.xhtml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify.xhtml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,151 @@
+<!--
+ 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:a4j="http://richfaces.org/a4j"
+ xmlns:notify="http://richfaces.org/notify"
+ >
+<h:head>
+ <title>Notify sample</title>
+</h:head>
+<h:body class="rich-container">
+ <style type="text/css">
+ .bottomLeft {
+ bottom: 10px;
+ left: 10px;
+ top: auto;
+ right: auto;
+ }
+
+ .bottomRight {
+ bottom: 10px;
+ right: 10px;
+ top: auto;
+ left: auto;
+ }
+ </style>
+ <ui:include src="menu.xhtml"/>
+
+ <p>
+ Here we have notify displaying all messages (not only global).
+ Severity is reflected in overriden style classes.
+ </p>
+ <h:form>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+ <notify:notify sticky="false" stayTime="5000"
+ title="Default stack"
+ text="Details of the message"
+ nonblockingOpacity="0"/>
+
+ <notify:notify title="Before stack definition"
+ text="This message is defined in code before stack"
+ stack="bottomLeftStack"/>
+ <notify:notify title="Left bottom stack 2"
+ text="This message alos should be displayed in the left bottom corner"
+ showCloseButton="true" stack="bottomLeftStack"/>
+ <notify:notifyStack id="bottomLeftStack" styleClass="bottomLeft" stackDir1="up"
+ stackDir2="right" push="top">
+ <notify:notify sticky="true"
+ title="Left bottom stack"
+ text="This message should be displayed in the left bottom corner
+ and should stay until you close it"
+ showCloseButton="true"/>
+ <notify:notify title="Nonblocking"
+ nonblocking="true"/>
+ </notify:notifyStack>
+ <notify:notifyMessages interval="1000" stack="bottomRightStack" ajaxRendered="true"/>
+ <notify:notifyStack id="bottomRightStack" styleClass="bottomRight" stackDir1="up"
+ stackDir2="left" push="bottom"/>
+ Leave this blank for error:
+ <br/>
+ <h:outputLabel for="greeting" value="Greeting"/>
+ <h:inputText id="greeting" value="#{greeter.greeting}" required="true"/>
+ *
+ <h:message for="greeting"/>
+ <br/>
+ <h:outputLabel for="number" value="Number"/>
+ <h:inputText id="number" required="true">
+ <f:validateLongRange minimum="5" maximum="10"/>
+ </h:inputText>
+ *
+ <h:message for="number"/>
+ <br/>
+ <a4j:commandButton value="Say Hello" action="#{greeter.sayHello}" execute="@form"/>
+ <a4j:commandButton value="Warn me" action="#{greeter.warnMe}" execute="@form"/>
+ <a4j:commandButton value="Say error" action="#{greeter.sayError}" execute="@form"/>
+ <a4j:commandButton value="Say fatal" action="#{greeter.sayFatal}" execute="@form"/>
+ </h:form>
+ <!--
+ TODO uncomment this once rich:insert is available
+ <rich:insert src="/notify.xhtml" highlight="xhtml" rendered="#{showSource!=false}"/>
+ -->
+
+</h:body>
+</html>
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_1.xhtml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_1.xhtml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_1.xhtml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,252 @@
+<!--
+ 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:a4j="http://richfaces.org/a4j"
+ xmlns:notify="http://richfaces.org/notify">
+<h:head>
+ <title>Notify sample</title>
+ <style type="text/css">
+ .black .rf-ny-co {
+ background: #000;
+ color: #fff;
+ }
+
+ .mail .rf-ny-co {
+ padding: 0 10px;
+ }
+
+ .mail .rf-ny-cl {
+ margin-top: 4px;
+ }
+
+ .mail .rf-ny-ic {
+ display: block;
+ background: url(mail.png) no-repeat 50% 50%;
+ width: 18px;
+ height: 20px;
+ }
+
+ .topLeft {
+ bottom: auto;
+ left: 10px;
+ top: 10px;
+ right: auto;
+ }
+
+ .topRight {
+ bottom: auto;
+ right: 10px;
+ top: 10px;
+ left: auto;
+ }
+
+ .bottomLeft {
+ bottom: 10px;
+ left: 10px;
+ top: auto;
+ right: auto;
+ }
+
+ .bottomRight {
+ bottom: 10px;
+ right: 10px;
+ top: auto;
+ left: auto;
+ }
+ </style>
+</h:head>
+<h:body class="rich-container">
+ <ui:include src="menu.xhtml"/>
+ <h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <notify:notifyStack id="customStack"
+ stackDir1="#{greeter.stackDir1}"
+ stackDir2="#{greeter.stackDir2}"
+ push="#{greeter.stackPush}"
+ styleClass="#{greeter.stackStyleClass}"
+ />
+ <notify:notify title="#{greeter.title}"
+ text="#{greeter.text}"
+ nonblocking="#{greeter.nonblocking}"
+ showShadow="#{greeter.showShadow}"
+ showHistory="#{greeter.showHistory}"
+ showCloseButton="#{greeter.showCloseButton}"
+ sticky="#{greeter.sticky}"
+ stayTime="#{greeter.stayTime}"
+ appearAnimation="#{greeter.appearAnimation}"
+ hideAnimation="#{greeter.hideAnimation}"
+ animationSpeed="#{greeter.animationSpeed}"
+ nonblockingOpacity="#{greeter.nonblockingOpacity}"
+ styleClass="#{greeter.styleClass}"
+ stackDir1="#{greeter.stackDir1}"
+ stackDir2="#{greeter.stackDir2}"
+ stackPush="#{greeter.stackPush}"
+ stack="customStack"
+ />
+ </a4j:outputPanel>
+ <notify:notifyMessages interval="#{greeter.interval}"
+ nonblocking="#{greeter.nonblocking}"
+ showShadow="#{greeter.showShadow}"
+ showHistory="#{greeter.showHistory}"
+ showCloseButton="#{greeter.showCloseButton}"
+ sticky="#{greeter.sticky}"
+ stayTime="#{greeter.stayTime}"
+ appearAnimation="#{greeter.appearAnimation}"
+ hideAnimation="#{greeter.hideAnimation}"
+ animationSpeed="#{greeter.animationSpeed}"
+ nonblockingOpacity="#{greeter.nonblockingOpacity}"
+ styleClass="#{greeter.styleClass}"
+ stackDir1="#{greeter.stackDir1}"
+ stackDir2="#{greeter.stackDir2}"
+ stackPush="#{greeter.stackPush}"
+ stack="customStack"/>
+ <a4j:commandButton value="Say Hello" action="#{greeter.sayHello}" execute="@form"/>
+ <a4j:commandButton value="Warn me" action="#{greeter.warnMe}" execute="@form"/>
+ <a4j:commandButton value="Say error" action="#{greeter.sayError}" execute="@form"/>
+ <a4j:commandButton value="Say fatal" action="#{greeter.sayFatal}" execute="@form"/>
+ <h:panelGrid columns="2">
+ <h:panelGroup>
+ <f:facet name="header">Common</f:facet>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Nonblocking" for="nonblocking"/>
+ <h:selectBooleanCheckbox value="#{greeter.nonblocking}" id="nonblocking"/>
+ <h:outputLabel value="Show detail" for="showDetail"/>
+ <h:selectBooleanCheckbox value="#{greeter.showDetail}" id="showDetail"/>
+ <h:outputLabel value="Show summary" for="showSummary"/>
+ <h:selectBooleanCheckbox value="#{greeter.showSummary}" id="showSummary"/>
+ <h:outputLabel value="Sticky" for="sticky"/>
+ <h:selectBooleanCheckbox value="#{greeter.sticky}" id="sticky"/>
+ <h:outputLabel value="Show history" for="showHistory"/>
+ <h:selectBooleanCheckbox value="#{greeter.showHistory}" id="showHistory"/>
+ <h:outputLabel value="Show shadow" for="showShadow"/>
+ <h:selectBooleanCheckbox value="#{greeter.showShadow}" id="showShadow"/>
+ <h:outputLabel value="Show close button" for="showCloseButton"/>
+ <h:panelGroup>
+ <h:selectBooleanCheckbox value="#{greeter.showCloseButton}" id="showCloseButton"/>
+ Applicable only with nonblocking set to false.
+ </h:panelGroup>
+ <h:outputLabel value="Messages count" for="messagesCount"/>
+ <h:inputText value="#{greeter.messagesCount}" id="messagesCount"/>
+ <h:outputLabel value="Stay time" for="stayTime"/>
+ <h:inputText value="#{greeter.stayTime}" id="stayTime"/>
+ <h:outputLabel value="Delay" for="delay"/>
+ <h:inputText value="#{greeter.delay}" id="delay"/>
+ <h:outputLabel value="Nonblocking opacity" for="nonblockingOpacity"/>
+ <h:inputText value="#{greeter.nonblockingOpacity}" id="nonblockingOpacity"/>
+ <h:outputLabel value="Animation speed" for="animationSpeed"/>
+ <h:inputText value="#{greeter.animationSpeed}" id="animationSpeed"/>
+ <h:outputLabel value="Style class" for="styleClass"/>
+ <h:selectOneListbox value="#{greeter.styleClass}" id="styleClass" size="1">
+ <f:selectItem itemValue="" itemLabel="(none)"/>
+ <f:selectItem itemValue="mail" itemLabel="mail"/>
+ <f:selectItem itemValue="rf-ny-error" itemLabel="rf-ny-error"/>
+ <f:selectItem itemValue="black" itemLabel="black"/>
+ </h:selectOneListbox>
+ <h:outputLabel value="Appear animation" for="appearAnimation"/>
+ <h:selectOneListbox value="#{greeter.appearAnimation}" id="appearAnimation" size="1">
+ <f:selectItem itemValue="none" itemLabel="none"/>
+ <f:selectItem itemValue="show" itemLabel="show"/>
+ <f:selectItem itemValue="fade" itemLabel="fade"/>
+ <f:selectItem itemValue="slide" itemLabel="slide"/>
+ </h:selectOneListbox>
+ <h:outputLabel value="Hide animation" for="hideAnimation"/>
+ <h:selectOneListbox value="#{greeter.hideAnimation}" id="hideAnimation" size="1">
+ <f:selectItem itemValue="none" itemLabel="none"/>
+ <f:selectItem itemValue="show" itemLabel="show"/>
+ <f:selectItem itemValue="fade" itemLabel="fade"/>
+ <f:selectItem itemValue="slide" itemLabel="slide"/>
+ </h:selectOneListbox>
+ </h:panelGrid>
+ </h:panelGroup>
+ <h:panelGroup>
+ <h:panelGrid columns="1">
+ <f:facet name="header">Notify</f:facet>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="title" for="title"/>
+ <h:inputText value="#{greeter.title}" id="title"/>
+ <h:outputLabel value="text" for="text"/>
+ <h:inputText value="#{greeter.text}" id="text"/>
+ </h:panelGrid>
+ </h:panelGrid>
+ <h:panelGrid columns="1">
+ <f:facet name="header">NotifyMessages</f:facet>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Interval" for="interval"/>
+ <h:inputText value="#{greeter.interval}" id="interval"/>
+ </h:panelGrid>
+ </h:panelGrid>
+ <h:panelGrid>
+ <f:facet name="header">Stack</f:facet>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Stacking direction 1" for="stackDir1"/>
+ <h:selectOneRadio value="#{greeter.stackDir1}" id="stackDir1" size="1">
+ <f:selectItem itemValue="up" itemLabel="up"/>
+ <f:selectItem itemValue="down" itemLabel="down"/>
+ <f:selectItem itemValue="left" itemLabel="left"/>
+ <f:selectItem itemValue="right" itemLabel="right"/>
+ </h:selectOneRadio>
+ <h:outputLabel value="Stacking direction 2" for="stackDir2"/>
+ <h:selectOneRadio value="#{greeter.stackDir2}" id="stackDir2" size="1">
+ <f:selectItem itemValue="up" itemLabel="up"/>
+ <f:selectItem itemValue="down" itemLabel="down"/>
+ <f:selectItem itemValue="left" itemLabel="left"/>
+ <f:selectItem itemValue="right" itemLabel="right"/>
+ </h:selectOneRadio>
+ <h:outputLabel value="Stack push" for="stackPush"/>
+ <h:selectOneRadio value="#{greeter.stackPush}" id="stackPush" size="1">
+ <f:selectItem itemValue="top" itemLabel="top"/>
+ <f:selectItem itemValue="bottom" itemLabel="bottom"/>
+ </h:selectOneRadio>
+ <h:outputLabel value="Stack position" for="stackStyleClass"/>
+ <h:selectOneListbox value="#{greeter.stackStyleClass}" id="stackStyleClass" size="1">
+ <f:selectItem itemValue="topLeft" itemLabel="topLeft"/>
+ <f:selectItem itemValue="topRight" itemLabel="topRight"/>
+ <f:selectItem itemValue="bottomLeft" itemLabel="bottomLeft"/>
+ <f:selectItem itemValue="bottomRight" itemLabel="bottomRight"/>
+ </h:selectOneListbox>
+ <ul>Good combinations are :
+ <li>right,down,bottom,topLeft</li>
+ <li>left,down,bottom,topRight</li>
+ <li>right,up,bottom,bottomLeft</li>
+ <li>left,up,bottom,bottomRight</li>
+ </ul>
+ </h:panelGrid>
+ Changing stack attributes is bad if messages are added
+ in ajax mode, because current widget implementation
+ does not allow to refresh messages styleClass that should be
+ borrowed from stack (this is done on server side)
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:form>
+ <!--
+ TODO uncomment this once rich:insert is implemented
+ <rich:insert src="/notify_1.xhtml" highlight="xhtml" rendered="#{showSource!=false}"/>
+ -->
+</h:body>
+</html>
Added: root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_2.xhtml
===================================================================
--- root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_2.xhtml (rev 0)
+++ root/ui-sandbox/notify/trunk/demo/src/main/webapp/notify_2.xhtml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,74 @@
+<!--
+ 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:notify="http://richfaces.org/notify">
+<h:head>
+ <title>Notify sample</title>
+ <style type="text/css">
+ .mail .rf-ny-co {
+ padding: 0 10px;
+ }
+
+ .mail .rf-ny-cl {
+ margin-top: 4px;
+ }
+
+ .mail .rf-ny-ic {
+ display: block;
+ background-image: url(mail.png);
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ width: 18px;
+ height: 20px;
+ }
+ </style>
+</h:head>
+<h:body class="rich-container">
+ <ui:include src="menu.xhtml"/>
+
+ <p>
+ Skinning. Icon, skining by message type.
+ </p>
+ <notify:notify title="You've got mail"
+ nonblocking="#{greeter.nonblocking}"
+ sticky="true"
+ styleClass="mail"
+ />
+ <notify:notify title="You've got more mail (hides in 3sec)"
+ nonblocking="true"
+ sticky="false"
+ styleClass="mail"
+ delay="3000"
+ stayTime="3000"
+ />
+ <!--
+ TODO uncomment this once rich:insert is implemented
+ <rich:insert src="/notify_2.xhtml" highlight="xhtml" rendered="#{showSource!=false}"/>
+ -->
+</h:body>
+</html>
Added: root/ui-sandbox/notify/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/notify/trunk/parent/pom.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/parent/pom.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,183 @@
+<?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-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: notify parent</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ <org.richfaces.cdk.version>4.0.0-SNAPSHOT</org.richfaces.cdk.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-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>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle</artifactId>
+ <version>${richfaces.checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </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>
+
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <uri>http://richfaces.org/notify</uri>
+ <shortName>notify</shortName>
+ <displayName>notify components tags</displayName>
+ </taglib>
+ </library>
+ </configuration>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <javadocVersion>1.5</javadocVersion>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: root/ui-sandbox/notify/trunk/pom.xml
===================================================================
--- root/ui-sandbox/notify/trunk/pom.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/pom.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,80 @@
+<?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-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>notify-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: notify Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ <module>demo</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </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>
+ </build>
+
+</project>
\ No newline at end of file
Added: root/ui-sandbox/notify/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/notify/trunk/ui/pom.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/pom.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,232 @@
+<?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.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>richfaces-ui-notify-ui</artifactId>
+ <name>Richfaces UI Components: notify ui</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ </dependency>
+
+ <!-- JSF with dependencies -->
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <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>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle</artifactId>
+ <version>${richfaces.checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </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>
+
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <uri>http://richfaces.org/notify</uri>
+ <shortName>notify</shortName>
+ <displayName>notify components tags</displayName>
+ </taglib>
+ </library>
+ </configuration>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <javadocVersion>1.5</javadocVersion>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotify.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotify.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotify.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,49 @@
+/*
+ * 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.Tag;
+import org.richfaces.cdk.annotations.TagType;
+
+import javax.faces.component.UIComponentBase;
+
+@JsfComponent(tag = @Tag(name = "notify", type = TagType.Facelets))
+public abstract class AbstractNotify extends UIComponentBase implements NotifyAttributes {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.Notify";
+ public static final String COMPONENT_FAMILY = "org.richfaces.Notify";
+
+ public static final double DEFAULT_NONBLOCKING_OPACITY = .2;
+
+ @Attribute
+ public abstract String getTitle();
+
+ public abstract void setTitle(String summary);
+
+ @Attribute
+ public abstract String getText();
+
+ public abstract void setText(String test);
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyMessages.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyMessages.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyMessages.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,44 @@
+/*
+ * 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.ajax4jsf.component.AjaxOutput;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+
+import javax.faces.component.UIMessages;
+
+@JsfComponent(tag = @Tag(name = "notifyMessages", type = TagType.Facelets))
+public abstract class AbstractNotifyMessages extends UIMessages implements AjaxOutput, NotifyAttributes {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.NotifyMessages";
+ public static final String COMPONENT_FAMILY = "org.richfaces.Notify";
+
+ @Attribute
+ public abstract Integer getInterval();
+
+ @Attribute(defaultValue = "true")
+ public abstract boolean isAjaxRendered();
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyStack.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyStack.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/AbstractNotifyStack.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,48 @@
+/*
+ * 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.Tag;
+import org.richfaces.cdk.annotations.TagType;
+
+import javax.faces.component.UIComponentBase;
+
+@JsfComponent(tag = @Tag(name = "notifyStack", type = TagType.Facelets))
+public abstract class AbstractNotifyStack extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.NotifyStack";
+ public static final String COMPONENT_FAMILY = "org.richfaces.Notify";
+
+ @Attribute
+ public abstract String getStyleClass();
+
+ public abstract String getStackDir1();
+
+ @Attribute
+ public abstract String getStackDir2();
+
+ @Attribute
+ public abstract String getPush();
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/NotifyAttributes.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/NotifyAttributes.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/component/NotifyAttributes.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,93 @@
+/*
+ * 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;
+
+public interface NotifyAttributes {
+
+ @Attribute
+ boolean isSticky();
+
+ void setSticky(boolean sticky);
+
+ @Attribute
+ Integer getStayTime();
+
+ void setStayTime(Integer time);
+
+ @Attribute
+ Integer getDelay();
+
+ void setDelay(Integer delay);
+
+ @Attribute
+ String getStyleClass();
+
+ void setStyleClass(String styleClass);
+
+ @Attribute
+ String getAppearAnimation();
+
+ void setAppearAnimation(String appearAnimation);
+
+ @Attribute
+ String getHideAnimation();
+
+ void setHideAnimation(String hideAnimation);
+
+ @Attribute
+ Integer getAnimationSpeed();
+
+ void setAnimationSpeed(Integer animationSpeed);
+
+ @Attribute
+ boolean isShowHistory();
+
+ void setShowHistory(boolean showHistory);
+
+ @Attribute
+ boolean isNonblocking();
+
+ void setNonblocking(boolean nonblocking);
+
+ @Attribute
+ boolean isShowShadow();
+
+ void setShowShadow(boolean showShadow);
+
+ @Attribute
+ boolean isShowCloseButton();
+
+ void setShowCloseButton(boolean showCloseButton);
+
+ @Attribute
+ Double getNonblockingOpacity();
+
+ void setNonblockingOpacity(Double nonblockingOpacity);
+
+ @Attribute
+ String getStack();
+
+ void setStack(String stack);
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyMessagesRenderer.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyMessagesRenderer.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyMessagesRenderer.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,103 @@
+/*
+ * 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.renderkit.RendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractNotify;
+import org.richfaces.component.AbstractNotifyMessages;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.util.Iterator;
+
+@JsfRenderer(family = AbstractNotifyMessages.COMPONENT_FAMILY, type = NotifyMessagesRenderer.RENDERER_TYPE)
+public class NotifyMessagesRenderer extends NotifyRenderer {
+
+ public static final String RENDERER_TYPE = "org.richfaces.NotifyMessagesRenderer";
+
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+ AbstractNotifyMessages messagesComponent = (AbstractNotifyMessages) component;
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.DIV_ELEM, null);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, RendererUtils.getInstance().clientId(context, component), "type");
+ Integer delay = messagesComponent.getDelay();
+ if (delay == null) {
+ delay = 0;
+ }
+ Integer interval = messagesComponent.getInterval();
+ if (interval == null) {
+ interval = 0;
+ }
+
+ Iterator<FacesMessage> messages = messagesComponent.isGlobalOnly()
+ ? context.getMessages(null) : context.getMessages();
+ while (messages.hasNext()) {
+ FacesMessage msg = messages.next();
+ AbstractNotify notify = (AbstractNotify) context.getApplication()
+ .createComponent(AbstractNotify.COMPONENT_TYPE);
+ notify.setAnimationSpeed(messagesComponent.getAnimationSpeed());
+ notify.setAppearAnimation(messagesComponent.getAppearAnimation());
+ notify.setDelay(delay);
+ notify.setHideAnimation(messagesComponent.getHideAnimation());
+ notify.setNonblocking(messagesComponent.isNonblocking());
+ notify.setNonblockingOpacity(messagesComponent.getNonblockingOpacity());
+ notify.setShowCloseButton(messagesComponent.isShowCloseButton());
+ notify.setShowHistory(messagesComponent.isShowHistory());
+ notify.setShowShadow(messagesComponent.isShowShadow());
+ notify.setStack(messagesComponent.getStack());
+ notify.setStayTime(messagesComponent.getStayTime());
+ notify.setSticky(messagesComponent.isSticky());
+ if (messagesComponent.isShowSummary()) {
+ notify.setTitle(msg.getSummary());
+ }
+ if (messagesComponent.isShowDetail()) {
+ notify.setText(msg.getDetail());
+ }
+ String styleClass = messagesComponent.getStyleClass();
+ if (styleClass == null) {
+ styleClass = "";
+ }
+ if (FacesMessage.SEVERITY_INFO.equals(msg.getSeverity())) {
+ styleClass += " rf-ny-info";
+ } else if (FacesMessage.SEVERITY_WARN.equals(msg.getSeverity())) {
+ styleClass += " rf-ny-warn";
+ } else if (FacesMessage.SEVERITY_ERROR.equals(msg.getSeverity())) {
+ styleClass += " rf-ny-error";
+ } else if (FacesMessage.SEVERITY_FATAL.equals(msg.getSeverity())) {
+ styleClass += " rf-ny-fatal";
+ }
+ styleClass = styleClass.trim();
+ notify.setStyleClass(styleClass);
+ notify.encodeAll(context);
+ delay += interval;
+ msg.rendered();
+ }
+ writer.endElement(HTML.DIV_ELEM);
+ }
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyRenderer.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyRenderer.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyRenderer.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,153 @@
+/*
+ * 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.JSFunction;
+import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractNotify;
+import org.richfaces.component.AbstractNotifyStack;
+
+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 = AbstractNotify.COMPONENT_FAMILY, type = NotifyRenderer.RENDERER_TYPE)
+@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js", target = "head"),
+ @ResourceDependency(name = "richfaces.js", target = "head"),
+ @ResourceDependency(name = "jquery.pnotify.js", target = "head"),
+ @ResourceDependency(name = "richfaces.notify.js", target = "head"),
+ @ResourceDependency(name = "notify.ecss", target = "head")})
+public class NotifyRenderer extends AjaxComponentRendererBase {
+
+ public static final String RENDERER_TYPE = "org.richfaces.NotifyRenderer";
+ private static final Map<String, Object> DEFAULTS;
+
+ static {
+ Map<String, Object> defaults = new HashMap<String, Object>();
+ defaults.put("styleClass", "");
+ defaults.put("nonblocking", false);
+ defaults.put("nonblockingOpacity", AbstractNotify.DEFAULT_NONBLOCKING_OPACITY);
+ defaults.put("showHistory", true);
+ defaults.put("animationSpeed", "slow");
+ defaults.put("opacity", 1);
+ defaults.put("showShadow", false);
+ defaults.put("showCloseButton", true);
+ defaults.put("appearAnimation", "fade");
+ defaults.put("hideAnimation", "fade");
+ defaults.put("sticky", false);
+ defaults.put("stayTime", 8000);
+ defaults.put("delay", 0);
+ DEFAULTS = Collections.unmodifiableMap(defaults);
+ }
+
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+ if (!(component instanceof AbstractNotify)) {
+ return;
+ }
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.DIV_ELEM, null);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, getUtils().clientId(context, component), "type");
+ writer.startElement(HTML.SCRIPT_ELEM, null);
+ writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", "type");
+ writer.writeText(new JSFunction("RichFaces.Notify", getOptions(context, (AbstractNotify) component)), null);
+ writer.writeText(";", null);
+ writer.endElement(HTML.SCRIPT_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
+ }
+
+ protected Map<String, Object> getOptions(FacesContext context, AbstractNotify notify) throws IOException {
+ /**
+ * Include only attributes that are actually set.
+ */
+ Map<String, Object> options = new HashMap<String, Object>();
+ addOptionIfSetAndNotDefault("title", notify.getTitle(), options);
+ addOptionIfSetAndNotDefault("text", notify.getText(), options);
+ addOptionIfSetAndNotDefault("sticky", notify.isSticky(), options);
+ addOptionIfSetAndNotDefault("stayTime", notify.getStayTime(), options);
+ Map<String, Object> animationOptions = new HashMap<String, Object>();
+ addOptionIfSetAndNotDefault("appearAnimation", notify.getAppearAnimation(), animationOptions);
+ addOptionIfSetAndNotDefault("hideAnimation", notify.getHideAnimation(), animationOptions);
+ addOptionIfSetAndNotDefault("animation", animationOptions, options);
+ addOptionIfSetAndNotDefault("animationSpeed", notify.getAnimationSpeed(), options);
+ addOptionIfSetAndNotDefault("nonblocking", notify.isNonblocking(), options);
+ addOptionIfSetAndNotDefault("nonblockingOpacity", notify.getNonblockingOpacity(), options);
+ addOptionIfSetAndNotDefault("showHistory", notify.isShowHistory(), options);
+ addOptionIfSetAndNotDefault("showShadow", notify.isShowShadow(), options);
+ addOptionIfSetAndNotDefault("showCloseButton", notify.isShowCloseButton(), options);
+ AbstractNotifyStack stack = getStackComponent(context, notify);
+ if (stack != null) {
+ addOptionIfSetAndNotDefault("stack", getUtils().clientId(context, stack), options);
+ }
+ String styleClass = notify.getStyleClass();
+ if (styleClass == null) {
+ styleClass = "";
+ }
+ addOptionIfSetAndNotDefault("styleClass", getStackStyleClass(context, notify) + " " + styleClass, options);
+ addOptionIfSetAndNotDefault("delay", notify.getDelay(), options);
+ return options;
+ }
+
+ protected String getStackStyleClass(FacesContext context, AbstractNotify notify) {
+ AbstractNotifyStack stack = getStackComponent(context, notify);
+ return stack == null ? "" : stack.getStyleClass();
+ }
+
+ 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 AbstractNotifyStack getStackComponent(FacesContext context, AbstractNotify notify) {
+ String stackId = notify.getStack();
+ if (stackId == null) {
+ UIComponent parent = notify.getParent();
+ while (parent != null && !(parent instanceof AbstractNotifyStack)) {
+ parent = parent.getParent();
+ }
+ return (AbstractNotifyStack) parent;
+ } else {
+ UIComponent componentFor = getUtils().findComponentFor(context.getViewRoot(), stackId);
+ if (componentFor instanceof AbstractNotifyStack) {
+ return (AbstractNotifyStack) componentFor;
+ } else {
+ return null;
+ }
+ }
+ }
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyStackRenderer.java
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyStackRenderer.java (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/java/org/richfaces/renderkit/html/NotifyStackRenderer.java 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,81 @@
+/*
+ * 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.JSFunction;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractNotifyStack;
+import org.richfaces.renderkit.AjaxComponentRendererBase;
+
+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.HashMap;
+import java.util.Map;
+
+@JsfRenderer(family = AbstractNotifyStack.COMPONENT_FAMILY, type = NotifyStackRenderer.RENDERER_TYPE)
+@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js", target = "head"),
+ @ResourceDependency(name = "richfaces.js", target = "head"),
+ @ResourceDependency(name = "richfaces.notify.js", target = "head")
+})
+public class NotifyStackRenderer extends AjaxComponentRendererBase {
+
+ public static final String RENDERER_TYPE = "org.richfaces.NotifyStackRenderer";
+
+ @Override
+ public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+ if (!(component instanceof AbstractNotifyStack)) {
+ return;
+ }
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.SCRIPT_ELEM, null);
+ writer.writeText(new JSFunction("RichFaces.NotifyStack.register",
+ RendererUtils.getInstance().clientId(context, component),
+ getOptions((AbstractNotifyStack) component)
+ ), null);
+ writer.endElement(HTML.SCRIPT_ELEM);
+ }
+
+ protected Map<String, Object> getOptions(AbstractNotifyStack stack) throws IOException {
+ /**
+ * Include only attributes that are actually set.
+ */
+ Map<String, Object> options = new HashMap<String, Object>();
+ addOptionIfSet("dir1", stack.getStackDir1(), options);
+ addOptionIfSet("dir2", stack.getStackDir2(), options);
+ addOptionIfSet("push", stack.getPush(), options);
+ return options;
+ }
+
+ protected void addOptionIfSet(String optionName, Object value, Map<String, Object> options) {
+ if (value != null && !"".equals(value)) {
+ options.put(optionName, value);
+ }
+ }
+}
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/notify.taglib.xml
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/notify.taglib.xml (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/notify.taglib.xml 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,247 @@
+<?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.
+ -->
+
+<facelet-taglib 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-facelettaglibrary_2_0.xsd"
+ version="2.0" id="a4j">
+ <namespace>http://richfaces.org/notify</namespace>
+ <tag>
+ <tag-name>notify</tag-name>
+ <component>
+ <component-type>org.richfaces.Notify</component-type>
+ <renderer-type>org.richfaces.NotifyRenderer</renderer-type>
+ </component>
+ <attribute>
+ <name>animationSpeed</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <name>appearAnimation</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>delay</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <name>hideAnimation</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>nonblocking</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>nonblockingOpacity</name>
+ <type>java.lang.Double</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showCloseButton</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showHistory</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showShadow</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>stack</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>stayTime</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <name>sticky</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>text</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>title</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>notifyStack</tag-name>
+ <component>
+ <component-type>org.richfaces.NotifyStack</component-type>
+ <renderer-type>org.richfaces.NotifyStackRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>push</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>stackDir2</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>notifyMessages</tag-name>
+ <component>
+ <component-type>org.richfaces.NotifyMessages</component-type>
+ <renderer-type>org.richfaces.NotifyMessagesRenderer</renderer-type>
+ </component>
+ <attribute>
+ <name>ajaxRendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>animationSpeed</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <name>appearAnimation</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>delay</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <description>Client identifier of the component for which to display messages. This attribute is mutually exclusive with globalOnly and take precedence if used.</description>
+ <name>for</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating that only global messages (that is, messages not associated with any client identifier) are to be displayed. Default value is "false".</description>
+ <name>globalOnly</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>hideAnimation</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value must be unique within the closest parent component that is a naming container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>interval</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <name>nonblocking</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>nonblockingOpacity</name>
+ <type>java.lang.Double</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showCloseButton</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether the detail portion of displayed messages should be included. Default value is "false".</description>
+ <name>showDetail</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showHistory</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>showShadow</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether the summary portion of displayed messages should be included. Default value is "true".</description>
+ <name>showSummary</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>stack</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>stayTime</name>
+ <type>java.lang.Integer</type>
+ </attribute>
+ <attribute>
+ <name>sticky</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+</facelet-taglib>
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/error.png
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/error.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/fatal.png
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/fatal.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/info.png
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/info.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/jquery.pnotify.js
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/jquery.pnotify.js (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/jquery.pnotify.js 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,748 @@
+/*
+ * 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.
+ */
+
+(function($) {
+ var history_handle_top, timer;
+ var body;
+ var jwindow;
+ $.extend({
+ pnotify_remove_all: function () {
+ var body_data = body.data("pnotify");
+ /* POA: Added null-check */
+ if (body_data && body_data.length) {
+ $.each(body_data, function() {
+ if (this.pnotify_remove)
+ this.pnotify_remove();
+ });
+ }
+ },
+ pnotify_position_all: function () {
+ if (timer)
+ clearTimeout(timer);
+ timer = null;
+ var body_data = body.data("pnotify");
+ if (!body_data || !body_data.length)
+ return;
+ $.each(body_data, function() {
+ var s = this.opts.pnotify_stack;
+ if (!s) return;
+ if (!s.nextpos1)
+ s.nextpos1 = s.firstpos1;
+ if (!s.nextpos2)
+ s.nextpos2 = s.firstpos2;
+ if (!s.addpos2)
+ s.addpos2 = 0;
+ if (this.css("display") != "none") {
+ var curpos1, curpos2;
+ var animate = {};
+ // Calculate the current pos1 value.
+ var csspos1;
+ switch (s.dir1) {
+ case "down":
+ csspos1 = "top";
+ break;
+ case "up":
+ csspos1 = "bottom";
+ break;
+ case "left":
+ csspos1 = "right";
+ break;
+ case "right":
+ csspos1 = "left";
+ break;
+ }
+ curpos1 = parseInt(this.css(csspos1));
+ if (isNaN(curpos1))
+ curpos1 = 0;
+ // Remember the first pos1, so the first visible notice goes there.
+ if (typeof s.firstpos1 == "undefined") {
+ s.firstpos1 = curpos1;
+ s.nextpos1 = s.firstpos1;
+ }
+ // Calculate the current pos2 value.
+ var csspos2;
+ switch (s.dir2) {
+ case "down":
+ csspos2 = "top";
+ break;
+ case "up":
+ csspos2 = "bottom";
+ break;
+ case "left":
+ csspos2 = "right";
+ break;
+ case "right":
+ csspos2 = "left";
+ break;
+ }
+ curpos2 = parseInt(this.css(csspos2));
+ if (isNaN(curpos2))
+ curpos2 = 0;
+ // Remember the first pos2, so the first visible notice goes there.
+ if (typeof s.firstpos2 == "undefined") {
+ s.firstpos2 = curpos2;
+ s.nextpos2 = s.firstpos2;
+ }
+ // Check that it's not beyond the viewport edge.
+ if ((s.dir1 == "down" && s.nextpos1 + this.height() > jwindow.height()) ||
+ (s.dir1 == "up" && s.nextpos1 + this.height() > jwindow.height()) ||
+ (s.dir1 == "left" && s.nextpos1 + this.width() > jwindow.width()) ||
+ (s.dir1 == "right" && s.nextpos1 + this.width() > jwindow.width())) {
+ // If it is, it needs to go back to the first pos1, and over on pos2.
+ s.nextpos1 = s.firstpos1;
+ s.nextpos2 += s.addpos2 + 10;
+ s.addpos2 = 0;
+ }
+ // Animate if we're moving on dir2.
+ if (s.animation && s.nextpos2 < curpos2) {
+ switch (s.dir2) {
+ case "down":
+ animate.top = s.nextpos2 + "px";
+ break;
+ case "up":
+ animate.bottom = s.nextpos2 + "px";
+ break;
+ case "left":
+ animate.right = s.nextpos2 + "px";
+ break;
+ case "right":
+ animate.left = s.nextpos2 + "px";
+ break;
+ }
+ } else
+ this.css(csspos2, s.nextpos2 + "px");
+ // Keep track of the widest/tallest notice in the column/row, so we can push the next column/row.
+ switch (s.dir2) {
+ case "down":
+ case "up":
+ if (this.outerHeight(true) > s.addpos2)
+ s.addpos2 = this.height();
+ break;
+ case "left":
+ case "right":
+ if (this.outerWidth(true) > s.addpos2)
+ s.addpos2 = this.width();
+ break;
+ }
+ // Move the notice on dir1.
+ if (s.nextpos1) {
+ // Animate if we're moving toward the first pos.
+ if (s.animation && (curpos1 > s.nextpos1 || animate.top || animate.bottom || animate.right || animate.left)) {
+ switch (s.dir1) {
+ case "down":
+ animate.top = s.nextpos1 + "px";
+ break;
+ case "up":
+ animate.bottom = s.nextpos1 + "px";
+ break;
+ case "left":
+ animate.right = s.nextpos1 + "px";
+ break;
+ case "right":
+ animate.left = s.nextpos1 + "px";
+ break;
+ }
+ } else
+ this.css(csspos1, s.nextpos1 + "px");
+ }
+ if (animate.top || animate.bottom || animate.right || animate.left)
+ this.animate(animate, {duration: 500, queue: false});
+ // Calculate the next dir1 position.
+ switch (s.dir1) {
+ case "down":
+ case "up":
+ s.nextpos1 += this.height() + 10;
+ break;
+ case "left":
+ case "right":
+ s.nextpos1 += this.width() + 10;
+ break;
+ }
+ }
+ });
+ // Reset the next position data.
+ $.each(body_data, function() {
+ var s = this.opts.pnotify_stack;
+ if (!s) return;
+ s.nextpos1 = s.firstpos1;
+ s.nextpos2 = s.firstpos2;
+ s.addpos2 = 0;
+ s.animation = true;
+ });
+ },
+ pnotify: function(options) {
+ if (!body)
+ body = $("body");
+ if (!jwindow)
+ jwindow = $(window);
+
+ var animating;
+
+ // Build main options.
+ var opts;
+ if (typeof options != "object") {
+ opts = $.extend({}, $.pnotify.defaults);
+ opts.pnotify_text = options;
+ } else {
+ opts = $.extend({}, $.pnotify.defaults, options);
+ if (opts['pnotify_animation'] instanceof Object) {
+ opts['pnotify_animation'] = $.extend({
+ effect_in:$.pnotify.defaults.pnotify_animation,
+ effect_out:$.pnotify.defaults.pnotify_animation
+ }, opts['pnotify_animation']);
+ }
+ }
+
+ if (opts.pnotify_before_init) {
+ if (opts.pnotify_before_init(opts) === false)
+ return null;
+ }
+
+ // This keeps track of the last element the mouse was over, so
+ // mouseleave, mouseenter, etc can be called.
+ var nonblock_last_elem;
+ // This is used to pass events through the notice if it is non-blocking.
+ var nonblock_pass = function(e, e_name) {
+ pnotify.css("display", "none");
+ var element_below = document.elementFromPoint(e.clientX, e.clientY);
+ pnotify.css("display", "block");
+ var jelement_below = $(element_below);
+ var cursor_style = jelement_below.css("cursor");
+ pnotify.css("cursor", cursor_style != "auto" ? cursor_style : "default");
+ // If the element changed, call mouseenter, mouseleave, etc.
+ if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
+ if (nonblock_last_elem) {
+ dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
+ dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
+ }
+ dom_event.call(element_below, "mouseenter", e.originalEvent);
+ dom_event.call(element_below, "mouseover", e.originalEvent);
+ }
+ dom_event.call(element_below, e_name, e.originalEvent);
+ // Remember the latest element the mouse was over.
+ nonblock_last_elem = jelement_below;
+ };
+
+ // Create our widget.
+ // Stop animation, reset the removal timer, and show the close
+ // button when the user mouses over.
+ var pnotify = $("<div />", {
+ "class": "rf-ny " + opts.pnotify_addclass,
+ "css": {"display": "none"},
+ "mouseenter": function(e) {
+ if (opts.pnotify_nonblock) e.stopPropagation();
+ if (opts.pnotify_mouse_reset && animating == "out") {
+ // If it's animating out, animate back in really quick.
+ pnotify.stop(true);
+ pnotify.css("height", "auto").animate({"width": opts.pnotify_width, "opacity": opts.pnotify_nonblock ? opts.pnotify_nonblock_opacity : opts.pnotify_opacity}, "fast");
+ } else if (opts.pnotify_nonblock && animating != "out") {
+ // If it's non-blocking, animate to the other opacity.
+ pnotify.animate({"opacity": opts.pnotify_nonblock_opacity}, "fast");
+ }
+ if (opts.pnotify_hide && opts.pnotify_mouse_reset) pnotify.pnotify_cancel_remove();
+ if (opts.pnotify_closer && !opts.pnotify_nonblock) pnotify.closer.show();
+ },
+ "mouseleave": function(e) {
+ if (opts.pnotify_nonblock) e.stopPropagation();
+ nonblock_last_elem = null;
+ pnotify.css("cursor", "auto");
+ if (opts.pnotify_nonblock && animating != "out")
+ pnotify.animate({"opacity": opts.pnotify_opacity}, "fast");
+ if (opts.pnotify_hide && opts.pnotify_mouse_reset) pnotify.pnotify_queue_remove();
+ pnotify.closer.hide();
+ $.pnotify_position_all();
+ },
+ "mouseover": function(e) {
+ if (opts.pnotify_nonblock) e.stopPropagation();
+ },
+ "mouseout": function(e) {
+ if (opts.pnotify_nonblock) e.stopPropagation();
+ },
+ "mousemove": function(e) {
+ if (opts.pnotify_nonblock) {
+ e.stopPropagation();
+ nonblock_pass(e, "onmousemove");
+ }
+ },
+ "mousedown": function(e) {
+ if (opts.pnotify_nonblock) {
+ e.stopPropagation();
+ e.preventDefault();
+ nonblock_pass(e, "onmousedown");
+ }
+ },
+ "mouseup": function(e) {
+ if (opts.pnotify_nonblock) {
+ e.stopPropagation();
+ e.preventDefault();
+ nonblock_pass(e, "onmouseup");
+ }
+ },
+ "click": function(e) {
+ if (opts.pnotify_nonblock) {
+ e.stopPropagation();
+ nonblock_pass(e, "onclick");
+ }
+ },
+ "dblclick": function(e) {
+ if (opts.pnotify_nonblock) {
+ e.stopPropagation();
+ nonblock_pass(e, "ondblclick");
+ }
+ }
+ });
+ pnotify.opts = opts;
+ // Create a drop shadow.
+ if (opts.pnotify_shadow && !$.browser.msie)
+ pnotify.shadow_container = $("<div />", {"class": "rf-ny-sh"}).prependTo(pnotify);
+ // Create a container for the notice contents.
+ pnotify.container = $("<div />", {"class": "rf-ny-co"})
+ .appendTo(pnotify);
+
+ pnotify.pnotify_version = "1.0.0";
+
+ // This function is for updating the notice.
+ pnotify.pnotify = function(options) {
+ // Update the notice.
+ var old_opts = opts;
+ if (typeof options == "string")
+ opts.pnotify_text = options;
+ else
+ opts = $.extend({}, opts, options);
+ pnotify.opts = opts;
+ // Update the shadow.
+ if (opts.pnotify_shadow != old_opts.pnotify_shadow) {
+ if (opts.pnotify_shadow && !$.browser.msie)
+ pnotify.shadow_container = $("<div />", {"class": "rf-ny-sh"}).prependTo(pnotify);
+ else
+ pnotify.children(".rf-ny-sh").remove();
+ }
+ // Update the additional classes.
+ if (opts.pnotify_addclass === false)
+ pnotify.removeClass(old_opts.pnotify_addclass);
+ else if (opts.pnotify_addclass !== old_opts.pnotify_addclass)
+ pnotify.removeClass(old_opts.pnotify_addclass).addClass(opts.pnotify_addclass);
+ // Update the title.
+ if (opts.pnotify_title === false)
+ pnotify.title_container.hide("fast");
+ else if (opts.pnotify_title !== old_opts.pnotify_title)
+ pnotify.title_container.html(opts.pnotify_title).show(200);
+ // Update the text.
+ if (opts.pnotify_text === false) {
+ pnotify.text_container.hide("fast");
+ } else if (opts.pnotify_text !== old_opts.pnotify_text) {
+ if (opts.pnotify_insert_brs)
+ opts.pnotify_text = opts.pnotify_text.replace(/\n/g, "<br />");
+ pnotify.text_container.html(opts.pnotify_text).show(200);
+ }
+ pnotify.pnotify_history = opts.pnotify_history;
+ // Change the notice type.
+ if (opts.pnotify_type != old_opts.pnotify_type)
+ pnotify.container.toggleClass("rf-ny-co rf-ny-co-hover");
+ if ((opts.pnotify_notice_icon != old_opts.pnotify_notice_icon && opts.pnotify_type == "notice") ||
+ (opts.pnotify_error_icon != old_opts.pnotify_error_icon && opts.pnotify_type == "error") ||
+ (opts.pnotify_type != old_opts.pnotify_type)) {
+ // Remove any old icon.
+ pnotify.container.find("div.rf-ny-ic").remove();
+ // if ((opts.pnotify_error_icon && opts.pnotify_type == "error") || (opts.pnotify_notice_icon)) {
+ // Build the new icon.
+ $("<div />", {"class": "rf-ny-ic"})
+ .append($("<span />", {"class": opts.pnotify_type == "error" ? opts.pnotify_error_icon : opts.pnotify_notice_icon}))
+ .prependTo(pnotify.container);
+ // }
+ }
+ // Update the width.
+ if (opts.pnotify_width !== old_opts.pnotify_width)
+ pnotify.animate({width: opts.pnotify_width});
+ // Update the minimum height.
+ if (opts.pnotify_min_height !== old_opts.pnotify_min_height)
+ pnotify.container.animate({minHeight: opts.pnotify_min_height});
+ // Update the opacity.
+ if (opts.pnotify_opacity !== old_opts.pnotify_opacity)
+ pnotify.fadeTo(opts.pnotify_animate_speed, opts.pnotify_opacity);
+ if (!opts.pnotify_hide)
+ pnotify.pnotify_cancel_remove();
+ else if (!old_opts.pnotify_hide)
+ pnotify.pnotify_queue_remove();
+ pnotify.pnotify_queue_position();
+ return pnotify;
+ };
+
+ // Queue the position function so it doesn't run repeatedly and use
+ // up resources.
+ pnotify.pnotify_queue_position = function() {
+ if (timer)
+ clearTimeout(timer);
+ timer = setTimeout($.pnotify_position_all, 10);
+ };
+
+ // Display the notice.
+ pnotify.pnotify_display = function() {
+ // If the notice is not in the DOM, append it.
+ if (!pnotify.parent().length)
+ pnotify.appendTo(body);
+ // Run callback.
+ if (opts.pnotify_before_open) {
+ if (opts.pnotify_before_open(pnotify) === false)
+ return;
+ }
+ pnotify.pnotify_queue_position();
+ // First show it, then set its opacity, then hide it.
+ if (opts.pnotify_animation == "fade" || opts.pnotify_animation.effect_in == "fade") {
+ // If it's fading in, it should start at 0.
+ pnotify.show().fadeTo(0, 0).hide();
+ } else {
+ // Or else it should be set to the opacity.
+ if (opts.pnotify_opacity != 1)
+ pnotify.show().fadeTo(0, opts.pnotify_opacity).hide();
+ }
+ pnotify.animate_in(function() {
+ if (opts.pnotify_after_open)
+ opts.pnotify_after_open(pnotify);
+
+ pnotify.pnotify_queue_position();
+
+ // Now set it to hide.
+ if (opts.pnotify_hide)
+ pnotify.pnotify_queue_remove();
+ });
+ };
+
+ // Remove the notice.
+ pnotify.pnotify_remove = function() {
+ if (pnotify.timer) {
+ window.clearTimeout(pnotify.timer);
+ pnotify.timer = null;
+ }
+ // Run callback.
+ if (opts.pnotify_before_close) {
+ if (opts.pnotify_before_close(pnotify) === false)
+ return;
+ }
+ pnotify.animate_out(function() {
+ if (opts.pnotify_after_close) {
+ if (opts.pnotify_after_close(pnotify) === false)
+ return;
+ }
+ pnotify.pnotify_queue_position();
+ // If we're supposed to remove the notice from the DOM, do it.
+ if (opts.pnotify_remove)
+ pnotify.detach();
+ });
+ };
+
+ // Animate the notice in.
+ pnotify.animate_in = function(callback) {
+ // Declare that the notice is animating in. (Or has completed animating in.)
+ animating = "in";
+ var animation;
+ if (typeof opts.pnotify_animation.effect_in != "undefined")
+ animation = opts.pnotify_animation.effect_in;
+ else
+ animation = opts.pnotify_animation;
+ if (animation == "none") {
+ pnotify.show();
+ callback();
+ } else if (animation == "show")
+ pnotify.show(opts.pnotify_animate_speed, callback);
+ else if (animation == "fade")
+ pnotify.show().fadeTo(opts.pnotify_animate_speed, opts.pnotify_opacity, callback);
+ else if (animation == "slide")
+ pnotify.slideDown(opts.pnotify_animate_speed, callback);
+ else if (typeof animation == "function")
+ animation("in", callback, pnotify);
+ else if (pnotify.effect)
+ pnotify.effect(animation, {}, opts.pnotify_animate_speed, callback);
+ };
+
+ // Animate the notice out.
+ pnotify.animate_out = function(callback) {
+ // Declare that the notice is animating out. (Or has completed animating out.)
+ animating = "out";
+ var animation;
+ if (typeof opts.pnotify_animation.effect_out != "undefined")
+ animation = opts.pnotify_animation.effect_out;
+ else
+ animation = opts.pnotify_animation;
+ if (animation == "none") {
+ pnotify.hide();
+ callback();
+ } else if (animation == "show")
+ pnotify.hide(opts.pnotify_animate_speed, callback);
+ else if (animation == "fade")
+ pnotify.fadeOut(opts.pnotify_animate_speed, callback);
+ else if (animation == "slide")
+ pnotify.slideUp(opts.pnotify_animate_speed, callback);
+ else if (typeof animation == "function")
+ animation("out", callback, pnotify);
+ else if (pnotify.effect)
+ pnotify.effect(animation, {}, opts.pnotify_animate_speed, callback);
+ };
+
+ // Cancel any pending removal timer.
+ pnotify.pnotify_cancel_remove = function() {
+ if (pnotify.timer)
+ window.clearTimeout(pnotify.timer);
+ };
+
+ // Queue a removal timer.
+ pnotify.pnotify_queue_remove = function() {
+ // Cancel any current removal timer.
+ pnotify.pnotify_cancel_remove();
+ pnotify.timer = window.setTimeout(function() {
+ pnotify.pnotify_remove();
+ }, (isNaN(opts.pnotify_delay) ? 0 : opts.pnotify_delay));
+ };
+
+ // Provide a button to close the notice.
+ pnotify.closer = $("<div />", {
+ "class": "rf-ny-cl",
+ "css": {"cursor": "pointer", "display": "none"},
+ "click": function() {
+ pnotify.pnotify_remove();
+ pnotify.closer.hide();
+ }
+ })
+ .append($("<span />", {"class": "rf-ny-cl-ic"}))
+ .appendTo(pnotify.container);
+
+ // Add the appropriate icon.
+ // if ((opts.pnotify_error_icon && opts.pnotify_type == "error") || (opts.pnotify_notice_icon)) {
+ $("<div />", {"class": "rf-ny-ic"})
+ .append($("<span />", {"class": opts.pnotify_type == "error" ? opts.pnotify_error_icon : opts.pnotify_notice_icon}))
+ .appendTo(pnotify.container);
+ // }
+
+ // Add a title.
+ pnotify.title_container = $("<div />", {
+ "class": "rf-ny-tl",
+ "html": opts.pnotify_title
+ })
+ .appendTo(pnotify.container);
+ if (opts.pnotify_title === false)
+ pnotify.title_container.hide();
+
+ // Replace new lines with HTML line breaks.
+ if (opts.pnotify_insert_brs && typeof opts.pnotify_text == "string")
+ opts.pnotify_text = opts.pnotify_text.replace(/\n/g, "<br />");
+ // Add text.
+ pnotify.text_container = $("<div />", {
+ "class": "rf-ny-te",
+ "html": opts.pnotify_text
+ })
+ .appendTo(pnotify.container);
+ if (opts.pnotify_text === false)
+ pnotify.text_container.hide();
+
+ // Set width and min height.
+ if (typeof opts.pnotify_width == "string")
+ pnotify.css("width", opts.pnotify_width);
+ if (typeof opts.pnotify_min_height == "string")
+ pnotify.container.css("min-height", opts.pnotify_min_height);
+
+ // The history variable controls whether the notice gets redisplayed
+ // by the history pull down.
+ pnotify.pnotify_history = opts.pnotify_history;
+
+ // Add the notice to the notice array.
+ var body_data = body.data("pnotify");
+ if (body_data == null || typeof body_data != "object")
+ body_data = [];
+ if (opts.pnotify_stack.push == "top")
+ body_data = $.merge([pnotify], body_data);
+ else
+ body_data = $.merge(body_data, [pnotify]);
+ body.data("pnotify", body_data);
+
+ // Run callback.
+ if (opts.pnotify_after_init)
+ opts.pnotify_after_init(pnotify);
+
+ if (opts.pnotify_history) {
+ // If there isn't a history pull down, create one.
+ var body_history = body.data("pnotify_history");
+ if (typeof body_history == "undefined") {
+ body_history = $("<div />", {
+ "class": "rf-ny-hc",
+ "mouseleave": function() {
+ body_history.animate({top: "-" + history_handle_top + "px"}, {duration: 100, queue: false});
+ }
+ })
+ .append($("<div />", {"class": "rf-ny-hh", "text": "Redisplay"}))
+ .append($("<button />", {
+ "class": "rf-ny-ha",
+ "text": "All",
+ // "mouseenter": function(){
+ // $(this).addClass("ui-state-hover");
+ // },
+ // "mouseleave": function(){
+ // $(this).removeClass("ui-state-hover");
+ // },
+ "click": function() {
+ // Display all notices. (Disregarding non-history notices.)
+ $.each(body.data("pnotify"), function() {
+ if (this.pnotify_history && this.pnotify_display)
+ this.pnotify_display();
+ });
+ return false;
+ }
+ }))
+ .append($("<button />", {
+ "class": "rf-ny-hl",
+ "text": "Last",
+ // "mouseenter": function(){
+ // $(this).addClass("ui-state-hover");
+ // },
+ // "mouseleave": function(){
+ // $(this).removeClass("ui-state-hover");
+ // },
+ "click": function() {
+ // Look up the last history notice, and display it.
+ var i = 1;
+ var body_data = body.data("pnotify");
+ while (!body_data[body_data.length - i] || !body_data[body_data.length - i].pnotify_history || body_data[body_data.length - i].is(":visible")) {
+ if (body_data.length - i === 0)
+ return false;
+ i++;
+ }
+ var n = body_data[body_data.length - i];
+ if (n.pnotify_display)
+ n.pnotify_display();
+ return false;
+ }
+ }))
+ .appendTo(body);
+
+ // Make a handle so the user can pull down the history pull down.
+ var handle = $("<span />", {
+ "class": "rf-ny-hp",
+ "mouseenter": function() {
+ body_history.animate({top: "0"}, {duration: 100, queue: false});
+ }
+ })
+ .appendTo(body_history);
+
+ // Get the top of the handle.
+ history_handle_top = handle.offset().top + 2;
+ // Hide the history pull down up to the top of the handle.
+ body_history.css({top: "-" + history_handle_top + "px"});
+ // Save the history pull down.
+ body.data("pnotify_history", body_history);
+ }
+ }
+
+ // Mark the stack so it won't animate the new notice.
+ opts.pnotify_stack.animation = false;
+
+ // Display the notice.
+ pnotify.pnotify_display();
+
+ return pnotify;
+ }
+ });
+
+ // Some useful regexes.
+ var re_on = /^on/;
+ var re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/;
+ var re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/;
+ var re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
+ // Fire a DOM event.
+ var dom_event = function(e, orig_e) {
+ var event_object;
+ e = e.toLowerCase();
+ if (document.createEvent && this.dispatchEvent) {
+ // FireFox, Opera, Safari, Chrome
+ e = e.replace(re_on, '');
+ if (e.match(re_mouse_events)) {
+ // This allows the click event to fire on the notice. There is
+ // probably a much better way to do it.
+ $(this).offset();
+ event_object = document.createEvent("MouseEvents");
+ event_object.initMouseEvent(
+ e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
+ orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
+ orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
+ );
+ } else if (e.match(re_ui_events)) {
+ event_object = document.createEvent("UIEvents");
+ event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
+ } else if (e.match(re_html_events)) {
+ event_object = document.createEvent("HTMLEvents");
+ event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
+ }
+ if (!event_object) return;
+ this.dispatchEvent(event_object);
+ } else {
+ // Internet Explorer
+ if (!e.match(re_on)) e = "on" + e;
+ event_object = document.createEventObject(orig_e);
+ this.fireEvent(e, event_object);
+ }
+ };
+
+ $.pnotify.defaults = {
+ // The notice's title.
+ pnotify_title: false,
+ // The notice's text.
+ pnotify_text: false,
+ // Additional classes to be added to the notice. (For custom styling.)
+ pnotify_addclass: "",
+ // Create a non-blocking notice. It lets the user click elements underneath it.
+ pnotify_nonblock: false,
+ // The opacity of the notice (if it's non-blocking) when the mouse is over it.
+ pnotify_nonblock_opacity: .2,
+ // Display a pull down menu to redisplay previous notices, and place the notice in the history.
+ pnotify_history: true,
+ // Width of the notice.
+ pnotify_width: "300px",
+ // Minimum height of the notice. It will expand to fit content.
+ pnotify_min_height: "16px",
+ // Type of the notice. "notice" or "error".
+ pnotify_type: "notice",
+ // The icon class to use if type is notice.
+ pnotify_notice_icon: "",
+ // The icon class to use if type is error.
+ pnotify_error_icon: "",
+ // The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects.
+ pnotify_animation: "fade",
+ // Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds.
+ pnotify_animate_speed: "slow",
+ // Opacity of the notice.
+ pnotify_opacity: 1,
+ // Display a drop shadow.
+ pnotify_shadow: false,
+ // Provide a button for the user to manually close the notice.
+ pnotify_closer: true,
+ // After a delay, remove the notice.
+ pnotify_hide: true,
+ // Delay in milliseconds before the notice is removed.
+ pnotify_delay: 8000,
+ // Reset the hide timer if the mouse moves over the notice.
+ pnotify_mouse_reset: true,
+ // Remove the notice's elements from the DOM after it is removed.
+ pnotify_remove: true,
+ // Change new lines to br tags.
+ pnotify_insert_brs: true,
+ // The stack on which the notices will be placed. Also controls the direction the notices stack.
+ pnotify_stack: {"dir1": "down", "dir2": "left", "push": "bottom"}
+ };
+})(jQuery);
\ No newline at end of file
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/notify.ecss
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/notify.ecss (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/notify.ecss 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,162 @@
+.rf-ny {
+ bottom : auto;
+ right : 10px;
+ top: 10px;
+ left: auto;
+ z-index: 9999;
+}
+.rf-ny-info {
+ color: '#{richSkin.generalTextColor}';
+}
+.rf-ny-warn {
+ color:orange;
+}
+.rf-ny-error {
+ color:red;
+}
+.rf-ny-fatal {
+ color:red;
+ font-weight:bold;
+}
+html > body .rf-ny {
+ position: fixed;
+}
+.rf-ny .rf-ny-sh {
+ margin:0;
+ padding: 8px;
+ opcity: .3;
+ border-radius: 8px;
+ position: absolute;
+ z-index: -1;
+ top: .1em;
+ left: .1em;
+ bottom: -.2em;
+ right: -.2em;
+ background-color: '#{richSkin.headerBackgroundColor}';
+ color: '#{richSkin.headerTextColor}';
+ '-moz-border-radius': 8px;
+ '-webkit-border-radius': 8px;
+}
+.rf-ny-co {
+ height: 100%;
+ padding: .8em;
+ border-width: 1px;
+ border-style: solid;
+ border-radius: 4px;
+ border-color: '#{richSkin.panelBorderColor}';
+ background-color: '#{richSkin.generalBackgroundColor}';
+ color: '#{richSkin.panelTextColor}';
+ '-moz-border-radius': 4px;
+ '-webkit-border-radius': 4px;
+}
+
+.rf-ny-co-hover {
+ background:red;
+}
+.rf-ny-cl {
+ float: right;
+ margin-left: .2em;
+}
+
+.rf-ny-cl-ic {
+ display: block;
+ width: 11px;
+ height: 11px;
+/**
+TODO uncomment this
+ background-image:"url(#{resource['org.richfaces.renderkit.html.images.CancelControlIcon']})";
+*/
+}
+
+.rf-ny-ti {
+ display: block;
+ font-size: 1.2em;
+ font-weight: bold;
+ margin-bottom: .4em;
+}
+.rf-ny-te {
+ display: block;
+}
+.rf-ny-ic {
+ display: none;
+ float: left;
+ margin-right: .2em;
+ width:32px;
+ height:32px;
+}
+
+.rf-ny-hc {
+ background-color: '#{richSkin.headerBackgroundColor}';
+ border-color: '#{richSkin.headerBackgroundColor}';
+ font-size: '#{richSkin.headerSizeFont}';
+ color: '#{richSkin.headerTextColor}';
+ font-family: '#{richSkin.headerFamilyFont}';
+/**
+TODO uncomment this
+ background-image:"url(#{resource['org.richfaces.renderkit.html.GradientA']})";
+*/
+ font-weight: normal;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ position: absolute;
+ top: 0;
+ right: 18px;
+ width: 70px;
+ z-index: 10000;
+ color: '#{richSkin.panelTextColor}';
+ '-moz-border-radius-bottomleft': 4px;
+ '-webkit-border-bottom-left-radius': 4px;
+ '-moz-border-radius-bottomright': 4px;
+ '-webkit-border-bottom-right-radius': 4px;
+}
+
+.rf-ny-hc .rf-ny-hh {
+ padding: 2px;
+}
+.rf-ny-hc button {
+ cursor: pointer;
+ display: block;
+ width: 100%;
+}
+.rc-ny-ha {
+ border-radius: 4px;
+ '-moz-border-radius': 4px;
+ '-webkit-border-radius': 4px;
+}
+
+.rf-ny-hc .rf-ny-hp {
+ display: block;
+ margin: 0 auto;
+ width: 16px;
+ height: 16px;
+ background-color: '#{richSkin.panelTextColor}';
+/**
+TODO check why nullpointer is thrown because of this
+ background-image:"url(#{resource['org.richfaces.renderkit.html.images.TriangleIconDown']})";
+*/
+}
+.rc-ny-hl {
+ font-weight: normal;
+ color: '#{richSkin.panelTextColor}';
+ border-radius: 4px;
+ border-color: '#{richSkin.panelBorderColor}';
+ background-color: '#{richSkin.generalBackgroundColor}';
+ '-moz-border-radius': 4px;
+ '-webkit-border-radius': 4px;
+}
+.rf-ny-info .rf-ny-ic {
+ display: block;
+ background-image:"url(#{resource['info.png']})";
+}
+.rf-ny-warn .rf-ny-ic {
+ display: block;
+ background-image:"url(#{resource['warn.png']})";
+}
+.rf-ny-error .rf-ny-ic {
+ display: block;
+ background-image:"url(#{resource['error.png']})";
+}
+.rf-ny-fatal .rf-ny-ic {
+ display: block;
+ background-image:"url(#{resource['fatal.png']})";
+}
\ No newline at end of file
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/richfaces.notify.js
===================================================================
--- root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/richfaces.notify.js (rev 0)
+++ root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/richfaces.notify.js 2010-07-08 15:35:39 UTC (rev 17775)
@@ -0,0 +1,174 @@
+/*
+ * 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.
+ */
+
+window.RichFaces = window.RichFaces || {};
+RichFaces.NotifyStack = (function() {
+ var stacks = {};
+ return {
+ register: function(id, stack) {
+ var existingStack = stacks[id];
+ if (existingStack != null) {
+ stack = jQuery.extend(existingStack, stack);
+ delete stack.addpos1;
+ delete stack.addpos2;
+ delete stack.animation;
+ delete stack.firstpos1;
+ delete stack.firstpos2;
+ delete stack.nextpos1;
+ delete stack.nextpos2;
+ }
+ stack.id = id;
+ stacks[id] = stack;
+ },
+ getStack: function(id) {
+ var stack = stacks[id];
+ if (stack == null) {
+ stack = jQuery.extend({}, jQuery.pnotify.defaults.pnotify_stack);
+ this.register(id, stack);
+ }
+ return stack;
+ }
+ }
+})();
+
+RichFaces.Notify = function(options) {
+ /**
+ * Copies attributes from one objects to other object, but
+ * can change the name of target attributes.
+ */
+ function extend(target, source, translation) {
+ for (var attr in source) {
+ var targetAttr = translation[attr] != null ? translation[attr] : attr;
+ target[targetAttr] = source[attr];
+ if (attr != 'stack' && target[targetAttr] instanceof Object) {
+ target[targetAttr] = extend({}, target[targetAttr], translation);
+ }
+ }
+ return target;
+ }
+
+ options = jQuery.extend({stack:'default'}, options);
+ if (options != null && typeof options.stack == "string") {
+ options.stack = RichFaces.NotifyStack.getStack(options.stack);
+ }
+ var delegateOptions = extend({}, options, {
+ 'title':'pnotify_title' ,
+ 'text': 'pnotify_text',
+ 'styleClass': 'pnotify_addclass',
+ 'nonblocking': 'pnotify_nonblock',
+ 'nonblockingOpacity': 'pnotify_nonblock_opacity',
+ 'showHistory': 'pnotify_history',
+ 'animation': 'pnotify_animation',
+ 'appearAnimation': 'effect_in',
+ 'hideAnimation': 'effect_out',
+ 'animationSpeed': 'pnotify_animate_speed',
+ 'opacity': 'pnotify_opacity',
+ 'showShadow': 'pnotify_shadow',
+ 'showCloseButton': 'pnotify_closer',
+ 'sticky': 'pnotify_hide',
+ 'stayTime': 'pnotify_delay',
+ 'stack': 'pnotify_stack'
+ });
+ if (options.sticky !== null) {
+ delegateOptions.pnotify_hide = !options.sticky;
+ }
+ jQuery(document).ready(function() {
+ if (options.delay) {
+ setTimeout(function() {
+ jQuery.pnotify(delegateOptions);
+ }, options.delay);
+ } else {
+ jQuery.pnotify(delegateOptions);
+ }
+ });
+};
+
+//TODO remove this fix when it gets in to jquery.js
+(function() {
+ var safariCompatMode;
+ var getCompatMode = function() {
+ var compatMode = document.compatMode;
+ if (!compatMode && jQuery.browser.safari) {
+ if (!safariCompatMode) {
+ //detect compatMode as described in http://code.google.com/p/doctype/wiki/ArticleCompatMode
+ var width = jQuery(document.createElement("div")).attr('style', 'position:absolute;width:0;height:0;width:1')
+ .css('width');
+ safariCompatMode = compatMode = (width == '1px' ? 'BackCompat' : 'CSS1Compat');
+ } else {
+ compatMode = safariCompatMode;
+ }
+ }
+
+ return compatMode;
+ };
+
+
+ // Create innerHeight, innerWidth, outerHeight and outerWidth methods
+ jQuery.each([ "Height", "Width" ], function(i, name) {
+
+ var tl = i ? "Left" : "Top", // top or left
+ br = i ? "Right" : "Bottom", // bottom or right
+ lower = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function() {
+ return this[0] ?
+ jQuery.css(this[0], lower, false, "padding") :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function(margin) {
+ return this[0] ?
+ jQuery.css(this[0], lower, false, margin ? "margin" : "border") :
+ null;
+ };
+
+ var type = name.toLowerCase();
+
+ jQuery.fn[ type ] = function(size) {
+ // Get window width or height
+ return this[0] == window ?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ getCompatMode() == "CSS1Compat" && document.documentElement[ "client" + name ] ||
+ document.body[ "client" + name ] :
+
+ // Get document width or height
+ this[0] == document ?
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ document.documentElement["client" + name],
+ document.body["scroll" + name], document.documentElement["scroll" + name],
+ document.body["offset" + name], document.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ (this.length ? jQuery.css(this[0], type) : null) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css(type, typeof size === "string" ? size : size + "px");
+ };
+
+ });
+}());
\ No newline at end of file
Added: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/warn.png
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/notify/trunk/ui/src/main/resources/META-INF/resources/warn.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
13 years, 10 months
JBoss Rich Faces SVN: r17773 - root/ui-sandbox.
by richfaces-svn-commits@lists.jboss.org
Author: blabno
Date: 2010-07-08 11:32:58 -0400 (Thu, 08 Jul 2010)
New Revision: 17773
Added:
root/ui-sandbox/notify/
Log:
Initial import of notify component
13 years, 10 months
JBoss Rich Faces SVN: r17772 - root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-08 09:24:47 -0400 (Thu, 08 Jul 2010)
New Revision: 17772
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java
Log:
Fixed CS violation
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java 2010-07-08 13:22:21 UTC (rev 17771)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java 2010-07-08 13:24:47 UTC (rev 17772)
@@ -34,10 +34,8 @@
import javax.faces.context.PartialResponseWriter;
import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseWriter;
-import javax.faces.convert.Converter;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.util.SelectUtils;
import org.richfaces.component.AbstractComboBox;
import org.richfaces.component.MetaComponentResolver;
13 years, 10 months
JBoss Rich Faces SVN: r17771 - in root/examples-sandbox/trunk/components/combobox-demo/src/main: java/org/richfaces/demo and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-08 09:22:21 -0400 (Thu, 08 Jul 2010)
New Revision: 17771
Added:
root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/CountriesBean.java
root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/Country.java
root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/TestBean.java
root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/
root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/
root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/
root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/
root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xml
root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xsd
Removed:
root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/DataBean.java
Modified:
root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/WEB-INF/faces-config.xml
root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml
Log:
AJAXed comboBox functionality
Added: root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/CountriesBean.java
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/CountriesBean.java (rev 0)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/CountriesBean.java 2010-07-08 13:22:21 UTC (rev 17771)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.demo;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.FacesException;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author nick
+ *
+ */
+@ManagedBean(eager = true)
+@ApplicationScoped
+public class CountriesBean {
+
+ private List<Country> countries;
+
+ @XmlRootElement(name = "countries", namespace = Country.NAMESPACE)
+ private static class Countries {
+
+ @XmlElement(name = "country", namespace = Country.NAMESPACE)
+ private List<Country> countries;
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+ }
+
+ public CountriesBean() {
+ }
+
+ @PostConstruct
+ public void initialize() {
+ try {
+ JAXBContext countryContext = JAXBContext.newInstance(Countries.class);
+ Unmarshaller unmarshaller = countryContext.createUnmarshaller();
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ URL dataUrl = classLoader.getResource("org/richfaces/demo/countries.xml");
+
+ countries = ((Countries) unmarshaller.unmarshal(dataUrl)).getCountries();
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+}
Added: root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/Country.java
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/Country.java (rev 0)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/Country.java 2010-07-08 13:22:21 UTC (rev 17771)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.demo;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * @author nick
+ *
+ */
+public class Country {
+
+ public static final String NAMESPACE = "http://richfaces.org/demos/countries";
+
+ private String name;
+
+ private String iso;
+
+ private String domain;
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIso() {
+ return iso;
+ }
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setIso(String iso) {
+ this.iso = iso;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ @Override
+ public String toString() {
+ ToStringHelper helper = Objects.toStringHelper(this);
+
+ helper.add("name", name).add("iso", iso).add("domain", domain);
+
+ return helper.toString();
+ }
+}
Deleted: root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/DataBean.java
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/DataBean.java 2010-07-08 13:20:35 UTC (rev 17770)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/DataBean.java 2010-07-08 13:22:21 UTC (rev 17771)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, 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.demo;
-
-import java.text.DateFormatSymbols;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Locale;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-
-/**
- * @author Nick Belaevski
- *
- */
-@ManagedBean
-@SessionScoped
-public class DataBean {
-
- private List<String> monthsData;
-
- public DataBean() {
- super();
-
- DateFormatSymbols symbols = DateFormatSymbols.getInstance(Locale.US);
- monthsData = new ArrayList<String>();
- String[] monthSymbols = symbols.getMonths();
- for (int i = Calendar.JANUARY; i <= Calendar.DECEMBER; i++) {
- monthsData.add(monthSymbols[i]);
- }
- }
-
- public List<String> getMonthsData() {
- return monthsData;
- }
-}
Copied: root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/TestBean.java (from rev 17761, root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/DataBean.java)
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/TestBean.java (rev 0)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/java/org/richfaces/demo/TestBean.java 2010-07-08 13:22:21 UTC (rev 17771)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.demo;
+
+import java.util.Locale;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+@ManagedBean
+@SessionScoped
+public class TestBean {
+
+ private class CountryNamePredicate implements Predicate<Country> {
+
+ private String countryNamePrefix;
+
+ public CountryNamePredicate(String countryNamePrefix) {
+ super();
+ this.countryNamePrefix = countryNamePrefix;
+ }
+
+ public boolean apply(Country input) {
+ if (countryNamePrefix == null || countryNamePrefix.length() == 0) {
+ return true;
+ }
+
+ return input.getName().toLowerCase(Locale.US).startsWith(countryNamePrefix);
+ }
+ }
+
+ @ManagedProperty(value = "#{countriesBean}")
+ private CountriesBean countriesBean;
+
+ public void setCountriesBean(CountriesBean countriesBean) {
+ this.countriesBean = countriesBean;
+ }
+
+ public Object autocomplete(FacesContext facesContext, UIComponent component, String value) {
+ return Collections2.filter(countriesBean.getCountries(), new CountryNamePredicate(value));
+ }
+
+}
Added: root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xml
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xml (rev 0)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xml 2010-07-08 13:22:21 UTC (rev 17771)
@@ -0,0 +1,1368 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<countries xmlns="http://richfaces.org/demos/countries">
+ <country>
+ <name>Afghanistan</name>
+ <iso>AF/AFG/4</iso>
+ <domain>.af</domain>
+ </country>
+ <country>
+ <name>Albania</name>
+ <iso>AL/ALB/8</iso>
+ <domain>.al</domain>
+ </country>
+ <country>
+ <name>Algeria</name>
+ <iso>DZ/DZA/12</iso>
+ <domain>.dz</domain>
+ </country>
+ <country>
+ <name>American Samoa</name>
+ <iso>AS/ASM/16</iso>
+ <domain>.as</domain>
+ </country>
+ <country>
+ <name>Andorra</name>
+ <iso>AD/AND/20</iso>
+ <domain>.ad</domain>
+ </country>
+ <country>
+ <name>Angola</name>
+ <iso>AO/AGO/24</iso>
+ <domain>.ao</domain>
+ </country>
+ <country>
+ <name>Anguilla</name>
+ <iso>AI/AIA/660</iso>
+ <domain>.ai</domain>
+ </country>
+ <country>
+ <name>Antarctica</name>
+ <iso>AQ/ATA/10</iso>
+ <domain>.aq</domain>
+ </country>
+ <country>
+ <name>Antigua and Barbuda</name>
+ <iso>AG/ATG/28</iso>
+ <domain>.ag</domain>
+ </country>
+ <country>
+ <name>Argentina</name>
+ <iso>AR/ARG/32</iso>
+ <domain>.ar</domain>
+ </country>
+ <country>
+ <name>Armenia</name>
+ <iso>AM/ARM/51</iso>
+ <domain>.am</domain>
+ </country>
+ <country>
+ <name>Aruba</name>
+ <iso>AW/ABW/533</iso>
+ <domain>.aw</domain>
+ </country>
+ <country>
+ <name>Ashmore and Cartier Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Australia</name>
+ <iso>AU/AUS/36</iso>
+ <domain>.au</domain>
+ </country>
+ <country>
+ <name>Austria</name>
+ <iso>AT/AUT/40</iso>
+ <domain>.at</domain>
+ </country>
+ <country>
+ <name>Azerbaijan</name>
+ <iso>AZ/AZE/31</iso>
+ <domain>.az</domain>
+ </country>
+ <country>
+ <name>Bahamas, The</name>
+ <iso>BS/BHS/44</iso>
+ <domain>.bs</domain>
+ </country>
+ <country>
+ <name>Bahrain</name>
+ <iso>BH/BHR/48</iso>
+ <domain>.bh</domain>
+ </country>
+ <country>
+ <name>Baker Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Bangladesh</name>
+ <iso>BD/BGD/50</iso>
+ <domain>.bd</domain>
+ </country>
+ <country>
+ <name>Barbados</name>
+ <iso>BB/BRB/52</iso>
+ <domain>.bb</domain>
+ </country>
+ <country>
+ <name>Bassas da India</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Belarus</name>
+ <iso>BY/BLR/112</iso>
+ <domain>.by</domain>
+ </country>
+ <country>
+ <name>Belgium</name>
+ <iso>BE/BEL/56</iso>
+ <domain>.be</domain>
+ </country>
+ <country>
+ <name>Belize</name>
+ <iso>BZ/BLZ/84</iso>
+ <domain>.bz</domain>
+ </country>
+ <country>
+ <name>Benin</name>
+ <iso>BJ/BEN/204</iso>
+ <domain>.bj</domain>
+ </country>
+ <country>
+ <name>Bermuda</name>
+ <iso>BM/BMU/60</iso>
+ <domain>.bm</domain>
+ </country>
+ <country>
+ <name>Bhutan</name>
+ <iso>BT/BTN/64</iso>
+ <domain>.bt</domain>
+ </country>
+ <country>
+ <name>Bolivia</name>
+ <iso>BO/BOL/68</iso>
+ <domain>.bo</domain>
+ </country>
+ <country>
+ <name>Bosnia and Herzegovina</name>
+ <iso>BA/BIH/70</iso>
+ <domain>.ba</domain>
+ </country>
+ <country>
+ <name>Botswana</name>
+ <iso>BW/BWA/72</iso>
+ <domain>.bw</domain>
+ </country>
+ <country>
+ <name>Bouvet Island</name>
+ <iso>BV/BVT/74</iso>
+ <domain>.bv</domain>
+ </country>
+ <country>
+ <name>Brazil</name>
+ <iso>BR/BRA/76</iso>
+ <domain>.br</domain>
+ </country>
+ <country>
+ <name>British Indian Ocean Territory</name>
+ <iso>IO/IOT/86</iso>
+ <domain>.io</domain>
+ </country>
+ <country>
+ <name>British Virgin Islands</name>
+ <iso>VG/VGB/92</iso>
+ <domain>.vg</domain>
+ </country>
+ <country>
+ <name>Brunei</name>
+ <iso>BN/BRN/96</iso>
+ <domain>.bn</domain>
+ </country>
+ <country>
+ <name>Bulgaria</name>
+ <iso>BG/BGR/100</iso>
+ <domain>.bg</domain>
+ </country>
+ <country>
+ <name>Burkina Faso</name>
+ <iso>BF/BFA/854</iso>
+ <domain>.bf</domain>
+ </country>
+ <country>
+ <name>Burma</name>
+ <iso>MM/MMR/104</iso>
+ <domain>.mm</domain>
+ </country>
+ <country>
+ <name>Burundi</name>
+ <iso>BI/BDI/108</iso>
+ <domain>.bi</domain>
+ </country>
+ <country>
+ <name>Cambodia</name>
+ <iso>KH/KHM/116</iso>
+ <domain>.kh</domain>
+ </country>
+ <country>
+ <name>Cameroon</name>
+ <iso>CM/CMR/120</iso>
+ <domain>.cm</domain>
+ </country>
+ <country>
+ <name>Canada</name>
+ <iso>CA/CAN/124</iso>
+ <domain>.ca</domain>
+ </country>
+ <country>
+ <name>Cape Verde</name>
+ <iso>CV/CPV/132</iso>
+ <domain>.cv</domain>
+ </country>
+ <country>
+ <name>Cayman Islands</name>
+ <iso>KY/CYM/136</iso>
+ <domain>.ky</domain>
+ </country>
+ <country>
+ <name>Central African Republic</name>
+ <iso>CF/CAF/140</iso>
+ <domain>.cf</domain>
+ </country>
+ <country>
+ <name>Chad</name>
+ <iso>TD/TCD/148</iso>
+ <domain>.td</domain>
+ </country>
+ <country>
+ <name>Chile</name>
+ <iso>CL/CHL/152</iso>
+ <domain>.cl</domain>
+ </country>
+ <country>
+ <name>China</name>
+ <iso>CN/CHN/156</iso>
+ <domain>.cn</domain>
+ </country>
+ <country>
+ <name>Christmas Island</name>
+ <iso>CX/CXR/162</iso>
+ <domain>.cx</domain>
+ </country>
+ <country>
+ <name>Clipperton Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Cocos (Keeling) Islands</name>
+ <iso>CC/CCK/166</iso>
+ <domain>.cc</domain>
+ </country>
+ <country>
+ <name>Colombia</name>
+ <iso>CO/COL/170</iso>
+ <domain>.co</domain>
+ </country>
+ <country>
+ <name>Comoros</name>
+ <iso>KM/COM/174</iso>
+ <domain>.km</domain>
+ </country>
+ <country>
+ <name>Congo, Democratic Republic of the</name>
+ <iso>CD/COD/180</iso>
+ <domain>.cd</domain>
+ </country>
+ <country>
+ <name>Congo, Republic of the</name>
+ <iso>CG/COG/178</iso>
+ <domain>.cg</domain>
+ </country>
+ <country>
+ <name>Cook Islands</name>
+ <iso>CK/COK/184</iso>
+ <domain>.ck</domain>
+ </country>
+ <country>
+ <name>Coral Sea Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Costa Rica</name>
+ <iso>CR/CRI/188</iso>
+ <domain>.cr</domain>
+ </country>
+ <country>
+ <name>Cote d'Ivoire</name>
+ <iso>CI/CIV/384</iso>
+ <domain>.ci</domain>
+ </country>
+ <country>
+ <name>Croatia</name>
+ <iso>HR/HRV/191</iso>
+ <domain>.hr</domain>
+ </country>
+ <country>
+ <name>Cuba</name>
+ <iso>CU/CUB/192</iso>
+ <domain>.cu</domain>
+ </country>
+ <country>
+ <name>Cyprus</name>
+ <iso>CY/CYP/196</iso>
+ <domain>.cy</domain>
+ </country>
+ <country>
+ <name>Czech Republic</name>
+ <iso>CZ/CZE/203</iso>
+ <domain>.cz</domain>
+ </country>
+ <country>
+ <name>Denmark</name>
+ <iso>DK/DNK/208</iso>
+ <domain>.dk</domain>
+ </country>
+ <country>
+ <name>Djibouti</name>
+ <iso>DJ/DJI/262</iso>
+ <domain>.dj</domain>
+ </country>
+ <country>
+ <name>Dominica</name>
+ <iso>DM/DMA/212</iso>
+ <domain>.dm</domain>
+ </country>
+ <country>
+ <name>Dominican Republic</name>
+ <iso>DO/DOM/214</iso>
+ <domain>.do</domain>
+ </country>
+ <country>
+ <name>Ecuador</name>
+ <iso>EC/ECU/218</iso>
+ <domain>.ec</domain>
+ </country>
+ <country>
+ <name>Egypt</name>
+ <iso>EG/EGY/818</iso>
+ <domain>.eg</domain>
+ </country>
+ <country>
+ <name>El Salvador</name>
+ <iso>SV/SLV/222</iso>
+ <domain>.sv</domain>
+ </country>
+ <country>
+ <name>Equatorial Guinea</name>
+ <iso>GQ/GNQ/226</iso>
+ <domain>.gq</domain>
+ </country>
+ <country>
+ <name>Eritrea</name>
+ <iso>ER/ERI/232</iso>
+ <domain>.er</domain>
+ </country>
+ <country>
+ <name>Estonia</name>
+ <iso>EE/EST/233</iso>
+ <domain>.ee</domain>
+ </country>
+ <country>
+ <name>Ethiopia</name>
+ <iso>ET/ETH/231</iso>
+ <domain>.et</domain>
+ </country>
+ <country>
+ <name>Europa Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Falkland Islands (Islas Malvinas)</name>
+ <iso>FK/FLK/238</iso>
+ <domain>.fk</domain>
+ </country>
+ <country>
+ <name>Faroe Islands</name>
+ <iso>FO/FRO/234</iso>
+ <domain>.fo</domain>
+ </country>
+ <country>
+ <name>Fiji</name>
+ <iso>FJ/FJI/242</iso>
+ <domain>.fj</domain>
+ </country>
+ <country>
+ <name>Finland</name>
+ <iso>FI/FIN/246</iso>
+ <domain>.fi</domain>
+ </country>
+ <country>
+ <name>France</name>
+ <iso>FR/FRA/250</iso>
+ <domain>.fr</domain>
+ </country>
+ <country>
+ <name>France, Metropolitan</name>
+ <iso>FX/FXX/249</iso>
+ <domain>.fx</domain>
+ </country>
+ <country>
+ <name>French Guiana</name>
+ <iso>GF/GUF/254</iso>
+ <domain>.gf</domain>
+ </country>
+ <country>
+ <name>French Polynesia</name>
+ <iso>PF/PYF/258</iso>
+ <domain>.pf</domain>
+ </country>
+ <country>
+ <name>French Southern and Antarctic Lands</name>
+ <iso>TF/ATF/260</iso>
+ <domain>.tf</domain>
+ </country>
+ <country>
+ <name>Gabon</name>
+ <iso>GA/GAB/266</iso>
+ <domain>.ga</domain>
+ </country>
+ <country>
+ <name>Gambia, The</name>
+ <iso>GM/GMB/270</iso>
+ <domain>.gm</domain>
+ </country>
+ <country>
+ <name>Gaza Strip</name>
+ <iso>PS/PSE/275</iso>
+ <domain>.ps</domain>
+ </country>
+ <country>
+ <name>Georgia</name>
+ <iso>GE/GEO/268</iso>
+ <domain>.ge</domain>
+ </country>
+ <country>
+ <name>Germany</name>
+ <iso>DE/DEU/276</iso>
+ <domain>.de</domain>
+ </country>
+ <country>
+ <name>Ghana</name>
+ <iso>GH/GHA/288</iso>
+ <domain>.gh</domain>
+ </country>
+ <country>
+ <name>Gibraltar</name>
+ <iso>GI/GIB/292</iso>
+ <domain>.gi</domain>
+ </country>
+ <country>
+ <name>Glorioso Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Greece</name>
+ <iso>GR/GRC/300</iso>
+ <domain>.gr</domain>
+ </country>
+ <country>
+ <name>Greenland</name>
+ <iso>GL/GRL/304</iso>
+ <domain>.gl</domain>
+ </country>
+ <country>
+ <name>Grenada</name>
+ <iso>GD/GRD/308</iso>
+ <domain>.gd</domain>
+ </country>
+ <country>
+ <name>Guadeloupe</name>
+ <iso>GP/GLP/312</iso>
+ <domain>.gp</domain>
+ </country>
+ <country>
+ <name>Guam</name>
+ <iso>GU/GUM/316</iso>
+ <domain>.gu</domain>
+ </country>
+ <country>
+ <name>Guatemala</name>
+ <iso>GT/GTM/320</iso>
+ <domain>.gt</domain>
+ </country>
+ <country>
+ <name>Guernsey</name>
+ <iso>GG/GGY/831</iso>
+ <domain>.gg</domain>
+ </country>
+ <country>
+ <name>Guinea</name>
+ <iso>GN/GIN/324</iso>
+ <domain>.gn</domain>
+ </country>
+ <country>
+ <name>Guinea-Bissau</name>
+ <iso>GW/GNB/624</iso>
+ <domain>.gw</domain>
+ </country>
+ <country>
+ <name>Guyana</name>
+ <iso>GY/GUY/328</iso>
+ <domain>.gy</domain>
+ </country>
+ <country>
+ <name>Haiti</name>
+ <iso>HT/HTI/332</iso>
+ <domain>.ht</domain>
+ </country>
+ <country>
+ <name>Heard Island and McDonald Islands</name>
+ <iso>HM/HMD/334</iso>
+ <domain>.hm</domain>
+ </country>
+ <country>
+ <name>Holy See (Vatican City)</name>
+ <iso>VA/VAT/336</iso>
+ <domain>.va</domain>
+ </country>
+ <country>
+ <name>Honduras</name>
+ <iso>HN/HND/340</iso>
+ <domain>.hn</domain>
+ </country>
+ <country>
+ <name>Hong Kong</name>
+ <iso>HK/HKG/344</iso>
+ <domain>.hk</domain>
+ </country>
+ <country>
+ <name>Howland Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Hungary</name>
+ <iso>HU/HUN/348</iso>
+ <domain>.hu</domain>
+ </country>
+ <country>
+ <name>Iceland</name>
+ <iso>IS/ISL/352</iso>
+ <domain>.is</domain>
+ </country>
+ <country>
+ <name>India</name>
+ <iso>IN/IND/356</iso>
+ <domain>.in</domain>
+ </country>
+ <country>
+ <name>Indonesia</name>
+ <iso>ID/IDN/360</iso>
+ <domain>.id</domain>
+ </country>
+ <country>
+ <name>Iran</name>
+ <iso>IR/IRN/364</iso>
+ <domain>.ir</domain>
+ </country>
+ <country>
+ <name>Iraq</name>
+ <iso>IQ/IRQ/368</iso>
+ <domain>.iq</domain>
+ </country>
+ <country>
+ <name>Ireland</name>
+ <iso>IE/IRL/372</iso>
+ <domain>.ie</domain>
+ </country>
+ <country>
+ <name>Isle of Man</name>
+ <iso>IM/IMN/833</iso>
+ <domain>.im</domain>
+ </country>
+ <country>
+ <name>Israel</name>
+ <iso>IL/ISR/376</iso>
+ <domain>.il</domain>
+ </country>
+ <country>
+ <name>Italy</name>
+ <iso>IT/ITA/380</iso>
+ <domain>.it</domain>
+ </country>
+ <country>
+ <name>Jamaica</name>
+ <iso>JM/JAM/388</iso>
+ <domain>.jm</domain>
+ </country>
+ <country>
+ <name>Jan Mayen</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Japan</name>
+ <iso>JP/JPN/392</iso>
+ <domain>.jp</domain>
+ </country>
+ <country>
+ <name>Jarvis Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Jersey</name>
+ <iso>JE/JEY/832</iso>
+ <domain>.je</domain>
+ </country>
+ <country>
+ <name>Johnston Atoll</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Jordan</name>
+ <iso>JO/JOR/400</iso>
+ <domain>.jo</domain>
+ </country>
+ <country>
+ <name>Juan de Nova Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Kazakhstan</name>
+ <iso>KZ/KAZ/398</iso>
+ <domain>.kz</domain>
+ </country>
+ <country>
+ <name>Kenya</name>
+ <iso>KE/KEN/404</iso>
+ <domain>.ke</domain>
+ </country>
+ <country>
+ <name>Kingman Reef</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Kiribati</name>
+ <iso>KI/KIR/296</iso>
+ <domain>.ki</domain>
+ </country>
+ <country>
+ <name>Korea, North</name>
+ <iso>KP/PRK/408</iso>
+ <domain>.kp</domain>
+ </country>
+ <country>
+ <name>Korea, South</name>
+ <iso>KR/KOR/410</iso>
+ <domain>.kr</domain>
+ </country>
+ <country>
+ <name>Kosovo</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Kuwait</name>
+ <iso>KW/KWT/414</iso>
+ <domain>.kw</domain>
+ </country>
+ <country>
+ <name>Kyrgyzstan</name>
+ <iso>KG/KGZ/417</iso>
+ <domain>.kg</domain>
+ </country>
+ <country>
+ <name>Laos</name>
+ <iso>LA/LAO/418</iso>
+ <domain>.la</domain>
+ </country>
+ <country>
+ <name>Latvia</name>
+ <iso>LV/LVA/428</iso>
+ <domain>.lv</domain>
+ </country>
+ <country>
+ <name>Lebanon</name>
+ <iso>LB/LBN/422</iso>
+ <domain>.lb</domain>
+ </country>
+ <country>
+ <name>Lesotho</name>
+ <iso>LS/LSO/426</iso>
+ <domain>.ls</domain>
+ </country>
+ <country>
+ <name>Liberia</name>
+ <iso>LR/LBR/430</iso>
+ <domain>.lr</domain>
+ </country>
+ <country>
+ <name>Libya</name>
+ <iso>LY/LBY/434</iso>
+ <domain>.ly</domain>
+ </country>
+ <country>
+ <name>Liechtenstein</name>
+ <iso>LI/LIE/438</iso>
+ <domain>.li</domain>
+ </country>
+ <country>
+ <name>Lithuania</name>
+ <iso>LT/LTU/440</iso>
+ <domain>.lt</domain>
+ </country>
+ <country>
+ <name>Luxembourg</name>
+ <iso>LU/LUX/442</iso>
+ <domain>.lu</domain>
+ </country>
+ <country>
+ <name>Macau</name>
+ <iso>MO/MAC/446</iso>
+ <domain>.mo</domain>
+ </country>
+ <country>
+ <name>Macedonia</name>
+ <iso>MK/MKD/807</iso>
+ <domain>.mk</domain>
+ </country>
+ <country>
+ <name>Madagascar</name>
+ <iso>MG/MDG/450</iso>
+ <domain>.mg</domain>
+ </country>
+ <country>
+ <name>Malawi</name>
+ <iso>MW/MWI/454</iso>
+ <domain>.mw</domain>
+ </country>
+ <country>
+ <name>Malaysia</name>
+ <iso>MY/MYS/458</iso>
+ <domain>.my</domain>
+ </country>
+ <country>
+ <name>Maldives</name>
+ <iso>MV/MDV/462</iso>
+ <domain>.mv</domain>
+ </country>
+ <country>
+ <name>Mali</name>
+ <iso>ML/MLI/466</iso>
+ <domain>.ml</domain>
+ </country>
+ <country>
+ <name>Malta</name>
+ <iso>MT/MLT/470</iso>
+ <domain>.mt</domain>
+ </country>
+ <country>
+ <name>Marshall Islands</name>
+ <iso>MH/MHL/584</iso>
+ <domain>.mh</domain>
+ </country>
+ <country>
+ <name>Martinique</name>
+ <iso>MQ/MTQ/474</iso>
+ <domain>.mq</domain>
+ </country>
+ <country>
+ <name>Mauritania</name>
+ <iso>MR/MRT/478</iso>
+ <domain>.mr</domain>
+ </country>
+ <country>
+ <name>Mauritius</name>
+ <iso>MU/MUS/480</iso>
+ <domain>.mu</domain>
+ </country>
+ <country>
+ <name>Mayotte</name>
+ <iso>YT/MYT/175</iso>
+ <domain>.yt</domain>
+ </country>
+ <country>
+ <name>Mexico</name>
+ <iso>MX/MEX/484</iso>
+ <domain>.mx</domain>
+ </country>
+ <country>
+ <name>Micronesia, Federated States of</name>
+ <iso>FM/FSM/583</iso>
+ <domain>.fm</domain>
+ </country>
+ <country>
+ <name>Midway Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Moldova</name>
+ <iso>MD/MDA/498</iso>
+ <domain>.md</domain>
+ </country>
+ <country>
+ <name>Monaco</name>
+ <iso>MC/MCO/492</iso>
+ <domain>.mc</domain>
+ </country>
+ <country>
+ <name>Mongolia</name>
+ <iso>MN/MNG/496</iso>
+ <domain>.mn</domain>
+ </country>
+ <country>
+ <name>Montenegro</name>
+ <iso>ME/MNE/499</iso>
+ <domain>.me</domain>
+ </country>
+ <country>
+ <name>Montserrat</name>
+ <iso>MS/MSR/500</iso>
+ <domain>.ms</domain>
+ </country>
+ <country>
+ <name>Morocco</name>
+ <iso>MA/MAR/504</iso>
+ <domain>.ma</domain>
+ </country>
+ <country>
+ <name>Mozambique</name>
+ <iso>MZ/MOZ/508</iso>
+ <domain>.mz</domain>
+ </country>
+ <country>
+ <name>Myanmar</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Namibia</name>
+ <iso>NA/NAM/516</iso>
+ <domain>.na</domain>
+ </country>
+ <country>
+ <name>Nauru</name>
+ <iso>NR/NRU/520</iso>
+ <domain>.nr</domain>
+ </country>
+ <country>
+ <name>Navassa Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Nepal</name>
+ <iso>NP/NPL/524</iso>
+ <domain>.np</domain>
+ </country>
+ <country>
+ <name>Netherlands</name>
+ <iso>NL/NLD/528</iso>
+ <domain>.nl</domain>
+ </country>
+ <country>
+ <name>Netherlands Antilles</name>
+ <iso>AN/ANT/530</iso>
+ <domain>.an</domain>
+ </country>
+ <country>
+ <name>New Caledonia</name>
+ <iso>NC/NCL/540</iso>
+ <domain>.nc</domain>
+ </country>
+ <country>
+ <name>New Zealand</name>
+ <iso>NZ/NZL/554</iso>
+ <domain>.nz</domain>
+ </country>
+ <country>
+ <name>Nicaragua</name>
+ <iso>NI/NIC/558</iso>
+ <domain>.ni</domain>
+ </country>
+ <country>
+ <name>Niger</name>
+ <iso>NE/NER/562</iso>
+ <domain>.ne</domain>
+ </country>
+ <country>
+ <name>Nigeria</name>
+ <iso>NG/NGA/566</iso>
+ <domain>.ng</domain>
+ </country>
+ <country>
+ <name>Niue</name>
+ <iso>NU/NIU/570</iso>
+ <domain>.nu</domain>
+ </country>
+ <country>
+ <name>Norfolk Island</name>
+ <iso>NF/NFK/574</iso>
+ <domain>.nf</domain>
+ </country>
+ <country>
+ <name>Northern Mariana Islands</name>
+ <iso>MP/MNP/580</iso>
+ <domain>.mp</domain>
+ </country>
+ <country>
+ <name>Norway</name>
+ <iso>NO/NOR/578</iso>
+ <domain>.no</domain>
+ </country>
+ <country>
+ <name>Oman</name>
+ <iso>OM/OMN/512</iso>
+ <domain>.om</domain>
+ </country>
+ <country>
+ <name>Pakistan</name>
+ <iso>PK/PAK/586</iso>
+ <domain>.pk</domain>
+ </country>
+ <country>
+ <name>Palau</name>
+ <iso>PW/PLW/585</iso>
+ <domain>.pw</domain>
+ </country>
+ <country>
+ <name>Palmyra Atoll</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Panama</name>
+ <iso>PA/PAN/591</iso>
+ <domain>.pa</domain>
+ </country>
+ <country>
+ <name>Papua New Guinea</name>
+ <iso>PG/PNG/598</iso>
+ <domain>.pg</domain>
+ </country>
+ <country>
+ <name>Paracel Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Paraguay</name>
+ <iso>PY/PRY/600</iso>
+ <domain>.py</domain>
+ </country>
+ <country>
+ <name>Peru</name>
+ <iso>PE/PER/604</iso>
+ <domain>.pe</domain>
+ </country>
+ <country>
+ <name>Philippines</name>
+ <iso>PH/PHL/608</iso>
+ <domain>.ph</domain>
+ </country>
+ <country>
+ <name>Pitcairn Islands</name>
+ <iso>PN/PCN/612</iso>
+ <domain>.pn</domain>
+ </country>
+ <country>
+ <name>Poland</name>
+ <iso>PL/POL/616</iso>
+ <domain>.pl</domain>
+ </country>
+ <country>
+ <name>Portugal</name>
+ <iso>PT/PRT/620</iso>
+ <domain>.pt</domain>
+ </country>
+ <country>
+ <name>Puerto Rico</name>
+ <iso>PR/PRI/630</iso>
+ <domain>.pr</domain>
+ </country>
+ <country>
+ <name>Qatar</name>
+ <iso>QA/QAT/634</iso>
+ <domain>.qa</domain>
+ </country>
+ <country>
+ <name>Reunion</name>
+ <iso>RE/REU/638</iso>
+ <domain>.re</domain>
+ </country>
+ <country>
+ <name>Romania</name>
+ <iso>RO/ROU/642</iso>
+ <domain>.ro</domain>
+ </country>
+ <country>
+ <name>Russia</name>
+ <iso>RU/RUS/643</iso>
+ <domain>.ru</domain>
+ </country>
+ <country>
+ <name>Rwanda</name>
+ <iso>RW/RWA/646</iso>
+ <domain>.rw</domain>
+ </country>
+ <country>
+ <name>Saint Barthelemy</name>
+ <iso>BL/BLM/652</iso>
+ <domain>.bl</domain>
+ </country>
+ <country>
+ <name>Saint Helena</name>
+ <iso>SH/SHN/654</iso>
+ <domain>.sh</domain>
+ </country>
+ <country>
+ <name>Saint Kitts and Nevis</name>
+ <iso>KN/KNA/659</iso>
+ <domain>.kn</domain>
+ </country>
+ <country>
+ <name>Saint Lucia</name>
+ <iso>LC/LCA/662</iso>
+ <domain>.lc</domain>
+ </country>
+ <country>
+ <name>Saint Martin</name>
+ <iso>MF/MAF/663</iso>
+ <domain>.mf</domain>
+ </country>
+ <country>
+ <name>Saint Pierre and Miquelon</name>
+ <iso>PM/SPM/666</iso>
+ <domain>.pm</domain>
+ </country>
+ <country>
+ <name>Saint Vincent and the Grenadines</name>
+ <iso>VC/VCT/670</iso>
+ <domain>.vc</domain>
+ </country>
+ <country>
+ <name>Samoa</name>
+ <iso>WS/WSM/882</iso>
+ <domain>.ws</domain>
+ </country>
+ <country>
+ <name>San Marino</name>
+ <iso>SM/SMR/674</iso>
+ <domain>.sm</domain>
+ </country>
+ <country>
+ <name>Sao Tome and Principe</name>
+ <iso>ST/STP/678</iso>
+ <domain>.st</domain>
+ </country>
+ <country>
+ <name>Saudi Arabia</name>
+ <iso>SA/SAU/682</iso>
+ <domain>.sa</domain>
+ </country>
+ <country>
+ <name>Senegal</name>
+ <iso>SN/SEN/686</iso>
+ <domain>.sn</domain>
+ </country>
+ <country>
+ <name>Serbia</name>
+ <iso>RS/SRB/688</iso>
+ <domain>.rs</domain>
+ </country>
+ <country>
+ <name>Seychelles</name>
+ <iso>SC/SYC/690</iso>
+ <domain>.sc</domain>
+ </country>
+ <country>
+ <name>Sierra Leone</name>
+ <iso>SL/SLE/694</iso>
+ <domain>.sl</domain>
+ </country>
+ <country>
+ <name>Singapore</name>
+ <iso>SG/SGP/702</iso>
+ <domain>.sg</domain>
+ </country>
+ <country>
+ <name>Slovakia</name>
+ <iso>SK/SVK/703</iso>
+ <domain>.sk</domain>
+ </country>
+ <country>
+ <name>Slovenia</name>
+ <iso>SI/SVN/705</iso>
+ <domain>.si</domain>
+ </country>
+ <country>
+ <name>Solomon Islands</name>
+ <iso>SB/SLB/90</iso>
+ <domain>.sb</domain>
+ </country>
+ <country>
+ <name>Somalia</name>
+ <iso>SO/SOM/706</iso>
+ <domain>.so</domain>
+ </country>
+ <country>
+ <name>South Africa</name>
+ <iso>ZA/ZAF/710</iso>
+ <domain>.za</domain>
+ </country>
+ <country>
+ <name>South Georgia and the Islands</name>
+ <iso>GS/SGS/239</iso>
+ <domain>.gs</domain>
+ </country>
+ <country>
+ <name>Spain</name>
+ <iso>ES/ESP/724</iso>
+ <domain>.es</domain>
+ </country>
+ <country>
+ <name>Spratly Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Sri Lanka</name>
+ <iso>LK/LKA/144</iso>
+ <domain>.lk</domain>
+ </country>
+ <country>
+ <name>Sudan</name>
+ <iso>SD/SDN/736</iso>
+ <domain>.sd</domain>
+ </country>
+ <country>
+ <name>Suriname</name>
+ <iso>SR/SUR/740</iso>
+ <domain>.sr</domain>
+ </country>
+ <country>
+ <name>Svalbard</name>
+ <iso>SJ/SJM/744</iso>
+ <domain>.sj</domain>
+ </country>
+ <country>
+ <name>Swaziland</name>
+ <iso>SZ/SWZ/748</iso>
+ <domain>.sz</domain>
+ </country>
+ <country>
+ <name>Sweden</name>
+ <iso>SE/SWE/752</iso>
+ <domain>.se</domain>
+ </country>
+ <country>
+ <name>Switzerland</name>
+ <iso>CH/CHE/756</iso>
+ <domain>.ch</domain>
+ </country>
+ <country>
+ <name>Syria</name>
+ <iso>SY/SYR/760</iso>
+ <domain>.sy</domain>
+ </country>
+ <country>
+ <name>Taiwan</name>
+ <iso>TW/TWN/158</iso>
+ <domain>.tw</domain>
+ </country>
+ <country>
+ <name>Tajikistan</name>
+ <iso>TJ/TJK/762</iso>
+ <domain>.tj</domain>
+ </country>
+ <country>
+ <name>Tanzania</name>
+ <iso>TZ/TZA/834</iso>
+ <domain>.tz</domain>
+ </country>
+ <country>
+ <name>Thailand</name>
+ <iso>TH/THA/764</iso>
+ <domain>.th</domain>
+ </country>
+ <country>
+ <name>Timor-Leste</name>
+ <iso>TL/TLS/626</iso>
+ <domain>.tl</domain>
+ </country>
+ <country>
+ <name>Togo</name>
+ <iso>TG/TGO/768</iso>
+ <domain>.tg</domain>
+ </country>
+ <country>
+ <name>Tokelau</name>
+ <iso>TK/TKL/772</iso>
+ <domain>.tk</domain>
+ </country>
+ <country>
+ <name>Tonga</name>
+ <iso>TO/TON/776</iso>
+ <domain>.to</domain>
+ </country>
+ <country>
+ <name>Trinidad and Tobago</name>
+ <iso>TT/TTO/780</iso>
+ <domain>.tt</domain>
+ </country>
+ <country>
+ <name>Tromelin Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Tunisia</name>
+ <iso>TN/TUN/788</iso>
+ <domain>.tn</domain>
+ </country>
+ <country>
+ <name>Turkey</name>
+ <iso>TR/TUR/792</iso>
+ <domain>.tr</domain>
+ </country>
+ <country>
+ <name>Turkmenistan</name>
+ <iso>TM/TKM/795</iso>
+ <domain>.tm</domain>
+ </country>
+ <country>
+ <name>Turks and Caicos Islands</name>
+ <iso>TC/TCA/796</iso>
+ <domain>.tc</domain>
+ </country>
+ <country>
+ <name>Tuvalu</name>
+ <iso>TV/TUV/798</iso>
+ <domain>.tv</domain>
+ </country>
+ <country>
+ <name>Uganda</name>
+ <iso>UG/UGA/800</iso>
+ <domain>.ug</domain>
+ </country>
+ <country>
+ <name>Ukraine</name>
+ <iso>UA/UKR/804</iso>
+ <domain>.ua</domain>
+ </country>
+ <country>
+ <name>United Arab Emirates</name>
+ <iso>AE/ARE/784</iso>
+ <domain>.ae</domain>
+ </country>
+ <country>
+ <name>United Kingdom</name>
+ <iso>GB/GBR/826</iso>
+ <domain>.uk</domain>
+ </country>
+ <country>
+ <name>United States</name>
+ <iso>US/USA/840</iso>
+ <domain>.us</domain>
+ </country>
+ <country>
+ <name>United States Minor Outlying Islands</name>
+ <iso>UM/UMI/581</iso>
+ <domain>.um</domain>
+ </country>
+ <country>
+ <name>Uruguay</name>
+ <iso>UY/URY/858</iso>
+ <domain>.uy</domain>
+ </country>
+ <country>
+ <name>Uzbekistan</name>
+ <iso>UZ/UZB/860</iso>
+ <domain>.uz</domain>
+ </country>
+ <country>
+ <name>Vanuatu</name>
+ <iso>VU/VUT/548</iso>
+ <domain>.vu</domain>
+ </country>
+ <country>
+ <name>Venezuela</name>
+ <iso>VE/VEN/862</iso>
+ <domain>.ve</domain>
+ </country>
+ <country>
+ <name>Vietnam</name>
+ <iso>VN/VNM/704</iso>
+ <domain>.vn</domain>
+ </country>
+ <country>
+ <name>Virgin Islands</name>
+ <iso>VI/VIR/850</iso>
+ <domain>.vi</domain>
+ </country>
+ <country>
+ <name>Virgin Islands (UK)</name>
+ <iso>-/-/-</iso>
+ <domain>.vg</domain>
+ </country>
+ <country>
+ <name>Virgin Islands (US)</name>
+ <iso>-/-/-</iso>
+ <domain>.vi</domain>
+ </country>
+ <country>
+ <name>Wake Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Wallis and Futuna</name>
+ <iso>WF/WLF/876</iso>
+ <domain>.wf</domain>
+ </country>
+ <country>
+ <name>West Bank</name>
+ <iso>PS/PSE/275</iso>
+ <domain>.ps</domain>
+ </country>
+ <country>
+ <name>Western Sahara</name>
+ <iso>EH/ESH/732</iso>
+ <domain>.eh</domain>
+ </country>
+ <country>
+ <name>Western Samoa</name>
+ <iso>-/-/-</iso>
+ <domain>.ws</domain>
+ </country>
+ <country>
+ <name>Yemen</name>
+ <iso>YE/YEM/887</iso>
+ <domain>.ye</domain>
+ </country>
+ <country>
+ <name>Zaire</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Zambia</name>
+ <iso>ZM/ZMB/894</iso>
+ <domain>.zm</domain>
+ </country>
+ <country>
+ <name>Zimbabwe</name>
+ <iso>ZW/ZWE/716</iso>
+ <domain>.zw</domain>
+ </country>
+</countries>
\ No newline at end of file
Added: root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xsd
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xsd (rev 0)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/resources/org/richfaces/demo/countries.xsd 2010-07-08 13:22:21 UTC (rev 17771)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://richfaces.org/demos/countries"
+ xmlns:tns="http://richfaces.org/demos/countries" elementFormDefault="unqualified">
+
+ <element name="countries">
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="country">
+ <complexType>
+ <sequence>
+ <element name="name" />
+ <element name="iso" />
+ <element name="domain" />
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+
+</schema>
\ No newline at end of file
Modified: root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-07-08 13:20:35 UTC (rev 17770)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-07-08 13:22:21 UTC (rev 17771)
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
+ 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
Modified: root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml 2010-07-08 13:20:35 UTC (rev 17770)
+++ root/examples-sandbox/trunk/components/combobox-demo/src/main/webapp/index.xhtml 2010-07-08 13:22:21 UTC (rev 17771)
@@ -15,12 +15,14 @@
<h:form id="form">
<div style="height: 300px; width: 300px; overflow: auto;">Text
block text block text block text block text block text block text
- block text block
-
- <combo:comboBox autocompleteList="#{dataBean.monthsData}" />
-
+ block text block
+
+ <combo:comboBox autocompleteMethod="#{testBean.autocomplete}" var="country">
+ #{country.name} #{country.iso} #{country.domain}
+ </combo:comboBox>
+
<br />
- <select style="width: 200px">
+ <select style="width: 200px" name="select">
<option>ccccc</option>
</select> text block text block text block text block text block text
block text block text block text block text block text block text
13 years, 10 months
JBoss Rich Faces SVN: r17770 - in root/ui-sandbox/inputs/trunk/combobox/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-08 09:20:35 -0400 (Thu, 08 Jul 2010)
New Revision: 17770
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java
root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.js
root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml
Log:
AJAXed comboBox functionality
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java 2010-07-08 09:45:35 UTC (rev 17769)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/component/AbstractComboBox.java 2010-07-08 13:20:35 UTC (rev 17770)
@@ -21,11 +21,15 @@
*/
package org.richfaces.component;
+import java.io.IOException;
import java.util.List;
import javax.el.MethodExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
import org.richfaces.cdk.annotations.Attribute;
@@ -33,14 +37,19 @@
import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.context.ExtendedVisitContext;
+import org.richfaces.context.ExtendedVisitContextMode;
+import org.richfaces.renderkit.MetaComponentRenderer;
/**
* @author Nick Belaevski
- *
+ *
*/
@JsfComponent(tag = @Tag(type = TagType.Facelets, handler = "org.richfaces.view.facelets.ComboBoxHandler"))
-public abstract class AbstractComboBox extends UIInput {
+public abstract class AbstractComboBox extends UIInput implements MetaComponentResolver, MetaComponentEncoder {
+ public static final String ITEMS_META_COMPONENT_ID = "items";
+
public static final String COMPONENT_TYPE = "org.richfaces.ComboBox";
public static final String COMPONENT_FAMILY = UIInput.COMPONENT_FAMILY;
@@ -55,4 +64,34 @@
@Attribute(literal = true)
public abstract String getVar();
+
+ public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
+ if (ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
+ return getClientId(facesContext) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + metaComponentId;
+ }
+
+ return null;
+ }
+
+ @Override
+ public boolean visitTree(VisitContext context, VisitCallback callback) {
+ if (context instanceof ExtendedVisitContext) {
+ ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) context;
+ if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
+
+ VisitResult result = extendedVisitContext.invokeMetaComponentVisitCallback(this, callback, ITEMS_META_COMPONENT_ID);
+ if (result == VisitResult.COMPLETE) {
+ return true;
+ } else if (result == VisitResult.REJECT) {
+ return false;
+ }
+ }
+ }
+
+ return super.visitTree(context, callback);
+ }
+
+ public void encodeMetaComponent(FacesContext context, String metaComponentId) throws IOException {
+ ((MetaComponentRenderer) getRenderer(context)).encodeMetaComponent(context, this, metaComponentId);
+ }
}
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java 2010-07-08 09:45:35 UTC (rev 17769)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/java/org/richfaces/renderkit/ComboBoxRendererBase.java 2010-07-08 13:20:35 UTC (rev 17770)
@@ -31,19 +31,24 @@
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.PartialResponseWriter;
+import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.convert.Converter;
-import org.ajax4jsf.renderkit.RendererBase;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.util.SelectUtils;
import org.richfaces.component.AbstractComboBox;
+import org.richfaces.component.MetaComponentResolver;
import com.google.common.collect.Iterators;
/**
* @author Nick Belaevski
- *
+ *
*/
@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "jquery.position.js"),
@ResourceDependency(name = "richfaces.js"),
@@ -53,19 +58,20 @@
@ResourceDependency(library = "org.richfaces", name = "SelectBase.js"),
@ResourceDependency(library = "org.richfaces", name = "ComboBox.js"),
@ResourceDependency(library = "org.richfaces", name = "ComboBox.ecss")
-
+
})
-public class ComboBoxRendererBase extends RendererBase {
+public abstract class ComboBoxRendererBase extends InputRendererBase implements MetaComponentRenderer {
//TODO nick - handle parameter
private Iterator<Object> getItems(FacesContext facesContext, AbstractComboBox component) {
Object itemsObject = null;
-
+
MethodExpression autocompleteMethod = component.getAutocompleteMethod();
if (autocompleteMethod != null) {
try {
- itemsObject = autocompleteMethod.invoke(facesContext.getELContext(),
- new Object[] {facesContext, component, null});
+ String value = getInputValue(facesContext, component);
+ itemsObject = autocompleteMethod.invoke(facesContext.getELContext(),
+ new Object[] {facesContext, component, value});
} catch (ELException e) {
// TODO: handle exception
e.printStackTrace();
@@ -75,7 +81,7 @@
}
Iterator<Object> result;
-
+
//TODO nick - primitive arrays support
if (itemsObject instanceof Object[]) {
result = Iterators.forArray((Object[]) itemsObject);
@@ -84,32 +90,44 @@
} else {
result = Iterators.emptyIterator();
}
-
+
return result;
}
-
+
private Object saveVar(FacesContext context, String var) {
if (var != null) {
Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
return requestMap.get(var);
}
-
+
return null;
}
-
+
private void setVar(FacesContext context, String var, Object varObject) {
if (var != null) {
Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
requestMap.put(var, varObject);
}
}
-
+
+ protected void encodeItemContainerBegin(FacesContext facesContext, AbstractComboBox comboBox, Object item) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+
+ writer.startElement(HTML.LI_ELEMENT, comboBox);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "cb_option cb_font rf-ac-i", null);
+ }
+
+ protected void encodeItemContainerEnd(FacesContext facesContext, AbstractComboBox comboBox, Object item) throws IOException {
+ ResponseWriter writer = facesContext.getResponseWriter();
+ writer.endElement(HTML.LI_ELEMENT);
+ }
+
protected void encodeItem(FacesContext facesContext, AbstractComboBox comboBox, Object item) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
-
+
writer.startElement(HTML.LI_ELEMENT, comboBox);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "cb_option cb_font rf-ac-i", null);
-
+
if (comboBox.getChildCount() > 0) {
for (UIComponent child: comboBox.getChildren()) {
child.encodeAll(facesContext);
@@ -120,40 +138,87 @@
writer.writeText(item, null);
}
}
-
+
writer.endElement(HTML.LI_ELEMENT);
}
-
+
+ protected void encodeFakeItem(FacesContext context, UIComponent component) throws IOException {
+ ResponseWriter responseWriter = context.getResponseWriter();
+ responseWriter.startElement(HTML.LI_ELEMENT, component);
+ responseWriter.writeAttribute(HTML.STYLE_ATTRIBUTE, "display:none", null);
+ responseWriter.endElement(HTML.LI_ELEMENT);
+ }
+
protected void encodeItems(FacesContext facesContext, UIComponent component) throws IOException {
AbstractComboBox comboBox = (AbstractComboBox) component;
-
- ResponseWriter responseWriter = facesContext.getResponseWriter();
- responseWriter.startElement(HTML.UL_ELEMENT, component);
- responseWriter.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(facesContext)+"Items", null);
- responseWriter.writeAttribute(HTML.CLASS_ATTRIBUTE, "cb_list_ul", null);
+ encodeItemsContainerBegin(facesContext, component);
+
boolean hasEncodedElements = false;
Object savedVar = saveVar(facesContext, comboBox.getVar());
-
+
for (Iterator<Object> items = getItems(facesContext, comboBox); items.hasNext(); ) {
hasEncodedElements = true;
-
+
Object nextItem = items.next();
setVar(facesContext, comboBox.getVar(), nextItem);
-
+
encodeItem(facesContext, comboBox, nextItem);
}
setVar(facesContext, comboBox.getVar(), savedVar);
-
+
if (!hasEncodedElements) {
- responseWriter.startElement(HTML.LI_ELEMENT, component);
- responseWriter.writeAttribute(HTML.STYLE_ATTRIBUTE, "display:none", null);
- responseWriter.endElement(HTML.LI_ELEMENT);
+ //TODO nick - ?
}
-
+
+ encodeItemsContainerEnd(facesContext, component);
+ }
+
+ protected String getContainerElementId(FacesContext facesContext, UIComponent component) {
+ return component.getClientId(facesContext) + "Items";
+ }
+
+ protected void encodeItemsContainerBegin(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter responseWriter = facesContext.getResponseWriter();
+ responseWriter.startElement(HTML.UL_ELEMENT, component);
+ responseWriter.writeAttribute(HTML.ID_ATTRIBUTE, getContainerElementId(facesContext, component), null);
+ responseWriter.writeAttribute(HTML.CLASS_ATTRIBUTE, "cb_list_ul", null);
+ }
+
+ protected void encodeItemsContainerEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ ResponseWriter responseWriter = facesContext.getResponseWriter();
responseWriter.endElement(HTML.UL_ELEMENT);
}
-
+
+ protected void encodeItemsContainer(FacesContext facesContext, UIComponent component) throws IOException {
+ encodeItemsContainerBegin(facesContext, component);
+ encodeFakeItem(facesContext, component);
+ encodeItemsContainerEnd(facesContext, component);
+ }
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+
+ Map<String, String> requestParameters = context.getExternalContext().getRequestParameterMap();
+ if (requestParameters.get(component.getClientId(context) + ".ajax") != null) {
+ PartialViewContext pvc = context.getPartialViewContext();
+ pvc.getRenderIds().add(component.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + AbstractComboBox.ITEMS_META_COMPONENT_ID);
+ }
+ }
+
+ public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
+ throws IOException {
+ if (AbstractComboBox.ITEMS_META_COMPONENT_ID.equals(metaComponentId)) {
+
+ PartialResponseWriter partialWriter = context.getPartialViewContext().getPartialResponseWriter();
+ partialWriter.startUpdate(getContainerElementId(context, component));
+ encodeItems(context, component);
+ partialWriter.endUpdate();
+ } else {
+ throw new IllegalArgumentException(metaComponentId);
+ }
+ }
}
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.js
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.js 2010-07-08 09:45:35 UTC (rev 17769)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/ComboBox.js 2010-07-08 13:20:35 UTC (rev 17770)
@@ -1,16 +1,16 @@
(function ($, rf) {
rf.utils = rf.utils || {};
-
+
rf.utils.Cache = function (data, options) {
this.key = options.key;
this.cache = {}
this.cache[this.key] = data || [];
this.values = options.parse && options.parse(data) || this.cache[this.key];
};
-
+
var getItems = function (key) {
var newCache = [];
-
+
if (this.cache[key]) {
newCache = this.cache[key];
} else {
@@ -31,21 +31,21 @@
}
}
}
-
+
return newCache;
};
-
+
$.extend(rf.utils.Cache.prototype, (function () {
return {
getItems: getItems
};
})());
-
+
})(jQuery, RichFaces);
(function ($, rf) {
- rf.ui = rf.ui || {};
+ rf.ui = rf.ui || {};
// Constructor definition
rf.ui.ComboBox = function(componentId, fieldId, options) {
this.namespace = "."+rf.Event.createNamespace(this.name, this.componentId);
@@ -60,31 +60,31 @@
bindEventHandlers.call(this);
updateItemsList.call(this, "");
};
-
+
var $p ={};
-
+
// Extend component class and add protected methods from parent class to our container
$p = rf.ui.SelectBase.extend(rf.ui.SelectBase, rf.ui.ComboBox, $p);
-
+
// define super class link
var $super = rf.ui.ComboBox.$super;
-
+
var defaultOptions = {
selectedItemClass:'cb_select',
autoFill:true,
minChars:0,
selectFirst:false
};
-
+
var ID = {
SELECT:'List',
ITEMS:'Items'
};
-
+
var bindEventHandlers = function () {
rf.Event.bind(rf.getDomElement(this.componentId+ID.ITEMS).parentNode, "mouseover"+this.namespace, onMouseOver, this);
};
-
+
var onMouseOver = function(event) {
console && console.log && console.log("mouseOver");
var element = $(event.target).closest(".rf-ac-i", event.currentTarget).get(0);
@@ -96,15 +96,15 @@
}
}
};
-
+
var updateItemsList = function (value) {
this.items = $(rf.getDomElement(this.componentId+ID.ITEMS)).find(".rf-ac-i");
this.cache = new rf.utils.Cache(this.items, {
parse: getData,
key: value
- });
+ });
};
-
+
var getData = function (nodeList) {
var data = [];
nodeList.each(function () {
@@ -112,7 +112,7 @@
});
return data;
};
-
+
var scrollToSelectedItem = function() {
var offset = 0;
this.items.slice(0, this.index).each(function() {
@@ -128,7 +128,7 @@
}
}
};
-
+
var autoFill = function (inputValue, value) {
if( this.options.autoFill) {
var field = rf.getDomElement(this.fieldId);
@@ -136,7 +136,15 @@
rf.Selection.set(field, inputValue.length, field.value.length);
}
};
-
+
+ var callAjax = function(event) {
+ //caution: JSF submits inputs with empty names causing "WARNING: Parameters: Invalid chunk ignored." in Tomcat log
+ var params = {};
+ params[this.componentId + ".ajax"] = "1";
+
+ rf.ajax(this.componentId, event, {parameters: params});
+ };
+
// Add new properties and methods
$.extend(rf.ui.ComboBox.prototype, (function () {
return {
@@ -149,19 +157,19 @@
getNamespace: function () {
return this.namespace;
},
-
+
selectItem: function(index, isOffset, noAutoFill) {
if (this.items.length==0) return;
-
+
if (this.index!=-1) {
this.items.eq(this.index).removeClass(this.options.selectedItemClass);
}
-
+
if (index==undefined) {
this.index = -1;
return;
}
-
+
if (isOffset) {
this.index += index;
if ( this.index<0 ) {
@@ -183,7 +191,7 @@
scrollToSelectedItem.call(this);
!noAutoFill && autoFill.call(this, this.newValue, item.text());
},
-
+
selectPrevItem: function () {
this.selectItem(-1, true);
},
@@ -191,17 +199,18 @@
this.selectItem(1, true);
},
selectPageUp: function () {
-
+
},
selectPageDown: function () {
-
+
},
onBeforeShow: function (event) {
+ callAjax.call(this, event);
},
-
+
changeValue: function (event, value) {
// TODO: ajax call here if needed
-
+
this.selectItem();
var newItems = this.cache.getItems(value);
this.items = $(newItems);
@@ -213,7 +222,7 @@
this.selectItem(0, false, event.which == rf.KEYS.BACKSPACE);
}
},
-
+
onShow: function (event) {
if (this.items && this.items.length>0) {
//??TODO it's nessesary only if not changed value
@@ -222,7 +231,7 @@
}
}
},
-
+
onHide: function () {
this.selectItem();
}
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml
===================================================================
--- root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml 2010-07-08 09:45:35 UTC (rev 17769)
+++ root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml 2010-07-08 13:20:35 UTC (rev 17770)
@@ -16,7 +16,7 @@
<cc:implementation>
<div id="#{clientId}" class="cb_field_width cb_field">
<div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
- <input id="#{clientId}Input" type="text" class="cb_font cb_input" />
+ <input id="#{clientId}Input" name="#{clientId}" type="text" class="cb_font cb_input" />
<div id="#{clientId}Button" class="cb_button">
<div class="cb_button_arrow"></div>
</div>
@@ -33,7 +33,7 @@
<div class="cb_list_decoration">
<div class="cb_list_scroll cb_list_width cb_list_height">
<cdk:body>
- <cdk:call expression="encodeItems(facesContext, component)"/>
+ <cdk:call expression="encodeItemsContainer(facesContext, component)"/>
</cdk:body>
</div>
</div>
13 years, 10 months
JBoss Rich Faces SVN: r17769 - in root/ui-sandbox/panels2: trunk and 24 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-08 05:45:35 -0400 (Thu, 08 Jul 2010)
New Revision: 17769
Added:
root/ui-sandbox/panels2/branches/
root/ui-sandbox/panels2/tags/
root/ui-sandbox/panels2/trunk/
root/ui-sandbox/panels2/trunk/bom/
root/ui-sandbox/panels2/trunk/bom/pom.xml
root/ui-sandbox/panels2/trunk/create-component.bat
root/ui-sandbox/panels2/trunk/parent/
root/ui-sandbox/panels2/trunk/parent/pom.xml
root/ui-sandbox/panels2/trunk/pom.xml
root/ui-sandbox/panels2/trunk/readme.txt
root/ui-sandbox/panels2/trunk/ui/
root/ui-sandbox/panels2/trunk/ui/pom.xml
root/ui-sandbox/panels2/trunk/ui/src/
root/ui-sandbox/panels2/trunk/ui/src/main/
root/ui-sandbox/panels2/trunk/ui/src/main/java/
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPanel.java
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
root/ui-sandbox/panels2/trunk/ui/src/main/resources/
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/MANIFEST.MF
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/panel.ecss
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/popupPanel.ecss
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/faces-config.xml
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/bg_header.png
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/close_act.gif
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/edit.gif
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/panels.taglib.xml
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanel.js
root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanelBorders.js
root/ui-sandbox/panels2/trunk/ui/src/main/templates/
root/ui-sandbox/panels2/trunk/ui/src/main/templates/panel.template.xml
root/ui-sandbox/panels2/trunk/ui/src/main/templates/popupPanel.template.xml
root/ui-sandbox/panels2/trunk/ui/src/test/
root/ui-sandbox/panels2/trunk/ui/src/test/java/
root/ui-sandbox/panels2/trunk/ui/src/test/java/org/
root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/
root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/renderkit/
root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/renderkit/html/
root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
root/ui-sandbox/panels2/trunk/ui/src/test/resources/
root/ui-sandbox/panels2/trunk/ui/src/test/resources/panelTest.xhtml
Log:
Added: root/ui-sandbox/panels2/trunk/bom/pom.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/bom/pom.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/bom/pom.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, 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-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.panels</groupId>
+ <artifactId>richfaces-ui-panels-bom</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: panels bom</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <org.richfaces.core.version>4.0.0-SNAPSHOT</org.richfaces.core.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-bom</artifactId>
+ <version>${org.richfaces.core.version}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+<groupId>org.richfaces.cdk</groupId>
+ <artifactId>commons</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>richfaces-ui-panels-ui</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>richfaces-ui-panels-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>richfaces-ui-panels-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui/panels/trunk/bom</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui/panels/trunk/bom</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
Added: root/ui-sandbox/panels2/trunk/create-component.bat
===================================================================
--- root/ui-sandbox/panels2/trunk/create-component.bat (rev 0)
+++ root/ui-sandbox/panels2/trunk/create-component.bat 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1 @@
+mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-component -Dcategory=panels -Dname=%1
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/parent/pom.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/parent/pom.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, 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-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.panels</groupId>
+ <artifactId>richfaces-ui-panels-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <name>Richfaces UI Components: panels parent</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <richfaces.checkstyle.version>1</richfaces.checkstyle.version>
+ <org.richfaces.cdk.version>4.0.0-SNAPSHOT</org.richfaces.cdk.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.panels</groupId>
+ <artifactId>richfaces-ui-panels-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>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle</artifactId>
+ <version>${richfaces.checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </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>
+
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <uri>http://richfaces.org/panels</uri>
+ <shortName>panels</shortName>
+ <displayName>panels components tags</displayName>
+ </taglib>
+ </library>
+ </configuration>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <javadocVersion>1.5</javadocVersion>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui/panels/trunk/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui/panels/trunk/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
Added: root/ui-sandbox/panels2/trunk/pom.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/pom.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/pom.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, 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-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.panels</groupId>
+ <artifactId>panels-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: panels Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+
+ <module>ui</module>
+
+ <!--<module>old-togglePanel</module>-->
+ <!--<module>old-tabPanel</module>-->
+
+ <!--<module>dist</module>-->
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </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>
+ </build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui/panels/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui/panels/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/readme.txt
===================================================================
Added: root/ui-sandbox/panels2/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/pom.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/pom.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, 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.ui.panels</groupId>
+ <artifactId>richfaces-ui-panels-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.panels</groupId>
+ <artifactId>richfaces-ui-panels-ui</artifactId>
+ <name>Richfaces UI Components: togglePanel ui</name>
+ <packaging>jar</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-bom</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <!-- runtime -->
+<!-- <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>togglePanel-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>-->
+ <dependency>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <!-- todo remove this dependency or move to test scope -->
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF with dependencies -->
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <!-- todo api? -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <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>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle</artifactId>
+ <version>${richfaces.checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </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>
+
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <uri>http://richfaces.org/panels</uri>
+ <shortName>panels</shortName>
+ <displayName>panels components tags</displayName>
+ </taglib>
+ </library>
+ </configuration>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <javadocVersion>1.5</javadocVersion>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-javadoc</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui/panels/trunk/tog...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui/panels/trunk/toggle...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPanel.java
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPanel.java (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,41 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * JSF component class
+ *
+ */
+public class UIPanel extends UIComponentBase
+{
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ @Override
+ public String getFamily() {
+ // TODO Auto-generated method stub
+ return "org.richfaces.Panel";
+ }
+}
Added: root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPopupPanel.java (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,328 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.json.JSONException;
+import org.richfaces.json.JSONMap;
+
+/**
+ * JSF component class
+ *
+ */
+public class UIPopupPanel extends UIComponentBase{
+
+ public static final String COMPONENT_TYPE = "org.richfaces.PopupPanel";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.PopupPanel";
+
+ private Map<String, Object> visualOptions;
+
+ protected enum PropertyKeys {
+ selectBehaviour, width, height, zIndex, minHeight, minWidth, maxHeight, maxWidth, top, left, moveable, autosized, modal, domElementAttachment, controlsClass, show, headerClass, keepVisualState, label, overlapEmbedObjects, resizeable, shadowDepth, shadowOpacity, trimOverlayedElements, style, styleClass, visualOptions, scrollerClass
+ }
+
+ public int getZIndex() {
+ return (Integer) getStateHelper().eval(PropertyKeys.zIndex, 100);
+ }
+
+ public void setZIndex(int zIndex) {
+ getStateHelper().put(PropertyKeys.zIndex, zIndex);
+ }
+
+ public int getHeight() {
+ return (Integer) getStateHelper().eval(PropertyKeys.height);
+ }
+
+ public void setHeight(int height) {
+ getStateHelper().put(PropertyKeys.height, height);
+ }
+
+ public int getWidth() {
+ return (Integer) getStateHelper().eval(PropertyKeys.width);
+ }
+
+ public void setWidth(int width) {
+ getStateHelper().put(PropertyKeys.width, width);
+ }
+
+ public int getMinHeight() {
+ return (Integer) getStateHelper().eval(PropertyKeys.minHeight, 10);
+ }
+
+ public void setMinHeight(int minheight) {
+ getStateHelper().put(PropertyKeys.minHeight, minheight);
+ }
+
+ public int getMinWidth() {
+ return (Integer) getStateHelper().eval(PropertyKeys.minWidth, 10);
+ }
+
+ public void setMinWidth(int minWidth) {
+ getStateHelper().put(PropertyKeys.minWidth, minWidth);
+ }
+
+ public int getMaxHeight() {
+ return (Integer) getStateHelper().eval(PropertyKeys.maxHeight);
+ }
+
+ public void setMaxHeight(int maxheight) {
+ getStateHelper().put(PropertyKeys.maxHeight, maxheight);
+ }
+
+ public int getMaxWidth() {
+ return (Integer) getStateHelper().eval(PropertyKeys.maxWidth);
+ }
+
+ public void setMaxWidth(int maxWidth) {
+ getStateHelper().put(PropertyKeys.maxWidth, maxWidth);
+ }
+
+ public String getSelectBehaviour() {
+ return (String) getStateHelper().eval(PropertyKeys.selectBehaviour);
+ }
+
+ public void setSelectBehaviour(String selectBehaviour) {
+ getStateHelper().put(PropertyKeys.selectBehaviour, selectBehaviour);
+ }
+
+ public String getTop() {
+ return (String) getStateHelper().eval(PropertyKeys.top);
+ }
+
+ public void setTop(String top) {
+ getStateHelper().put(PropertyKeys.top, top);
+ }
+
+ public String getLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.left);
+ }
+
+ public void setLeft(String left) {
+ getStateHelper().put(PropertyKeys.left, left);
+ }
+
+ public Boolean isShow() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.show);
+ }
+
+ public void setShow(Boolean show) {
+ getStateHelper().put(PropertyKeys.show, show);
+ }
+
+ public Boolean isMoveable() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.moveable);
+ }
+
+ public void setModeable(Boolean moveable) {
+ getStateHelper().put(PropertyKeys.moveable, moveable);
+ }
+
+ public Boolean isAutosized() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.autosized);
+ }
+
+ public void setAutosized(Boolean autosized) {
+ getStateHelper().put(PropertyKeys.autosized, autosized);
+ }
+
+ public Boolean isModal() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.modal, true);
+ }
+
+ public void setModal(Boolean modal) {
+ getStateHelper().put(PropertyKeys.modal, modal);
+ }
+
+ public Boolean isKeepVisualState() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.keepVisualState);
+ }
+
+ public void setKeepVisualState(Boolean keepVisualState) {
+ getStateHelper().put(PropertyKeys.keepVisualState, keepVisualState);
+ }
+
+ public Boolean isOverlapEmbedObjects() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.overlapEmbedObjects);
+ }
+
+ public void setOverlapEmbedObjects(Boolean overlapEmbedObjects) {
+ getStateHelper().put(PropertyKeys.overlapEmbedObjects, overlapEmbedObjects);
+ }
+
+ public Boolean isResizeable() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.resizeable, true);
+ }
+
+ public void setResizeable(Boolean resizeable) {
+ getStateHelper().put(PropertyKeys.resizeable, resizeable);
+ }
+
+ public Boolean isTrimOverlayedElements() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.trimOverlayedElements);
+ }
+
+ public void setTrimOverlayedElements(Boolean trimOverlayedElements) {
+ getStateHelper().put(PropertyKeys.trimOverlayedElements, trimOverlayedElements);
+ }
+
+ public String getDomElementAttachment() {
+ return (String) getStateHelper().eval(PropertyKeys.domElementAttachment);
+ }
+
+ public void setDomElementAttachment(String domElementAttachment) {
+ getStateHelper().put(PropertyKeys.domElementAttachment, domElementAttachment);
+ }
+
+ public String getControlsClass() {
+ return (String) getStateHelper().eval(PropertyKeys.controlsClass);
+ }
+
+ public void setControlsClass(String controlsClass) {
+ getStateHelper().put(PropertyKeys.controlsClass, controlsClass);
+ }
+
+ public String getLabel() {
+ return (String) getStateHelper().eval(PropertyKeys.label);
+ }
+
+ public void setLabel(String label) {
+ getStateHelper().put(PropertyKeys.label, label);
+ }
+
+ public String getHeaderClass() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClass);
+ }
+
+ public void setHeaderClass(String headerClass) {
+ getStateHelper().put(PropertyKeys.headerClass, headerClass);
+ }
+
+ public String getScrollerClass() {
+ return (String) getStateHelper().eval(PropertyKeys.scrollerClass);
+ }
+
+ public void setScrollerClass(String scrollerClass) {
+ getStateHelper().put(PropertyKeys.scrollerClass, scrollerClass);
+ }
+
+ public String getShadowDepth() {
+ return (String) getStateHelper().eval(PropertyKeys.shadowDepth);
+ }
+
+ public void setShadowDepth(String shadowDepth) {
+ getStateHelper().put(PropertyKeys.shadowDepth, shadowDepth);
+ }
+
+ public String getShadowOpacity() {
+ return (String) getStateHelper().eval(PropertyKeys.shadowOpacity);
+ }
+
+ public void setShadowOpacity(String shadowOpacity) {
+ getStateHelper().put(PropertyKeys.shadowOpacity, shadowOpacity);
+ }
+
+ public String getShadowStyle() {
+ String shadow = getShadowDepth();
+ String shadowStyle ="";
+ if (shadow != null) {
+ shadowStyle = "top: " + shadow + "px; left: " + shadow + "px;";
+ }
+
+ String opacity = getShadowOpacity();
+ String filterOpacity;
+
+ if (opacity != null) {
+ try {
+ Double op = Double.valueOf(opacity);
+ filterOpacity = Integer.toString(op.intValue() * 10);
+ opacity = Double.toString(op.doubleValue() / 10);
+ } catch (Exception e) {
+ // illegal opacity
+ return "";
+ }
+ shadowStyle += " opacity:" + opacity
+ + "; filter:alpha(opacity=" + filterOpacity + ");";
+ }
+ return shadowStyle;
+ }
+
+ public Object getVisualOptions() {
+ if (null != this.visualOptions) {
+ return this.visualOptions;
+ }
+
+ ValueExpression ve = getValueExpression("visualOptions");
+ if (null != ve) {
+ try {
+ Object value = ve.getValue(getFacesContext().getELContext());
+ this.visualOptions = prepareVisualOptions(value);
+ return this.visualOptions;
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ }
+
+ if (null == this.visualOptions) {
+ this.visualOptions = new HashMap<String, Object>();
+ }
+ return this.visualOptions;
+ }
+ public void setVisualOptions(Object visualOptions) {
+ this.visualOptions = prepareVisualOptions(visualOptions);
+ }
+
+ private Map<String, Object> prepareVisualOptions(Object value) {
+ if (null == value) {
+ return new HashMap<String, Object>();
+ } else if (value instanceof Map) {
+ return (Map<String, Object>) value;
+ } else if (value instanceof String) {
+ String s = (String) value;
+ if (!s.startsWith("{")) {
+ s = "{" + s + "}";
+ }
+ try {
+ return new HashMap<String, Object>(new JSONMap(s));
+ } catch (JSONException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ throw new FacesException("Attribute visualOptions of component [" +
+ this.getClientId(getFacesContext()) + "] must be instance of Map or String, but its type is " +
+ value.getClass().getSimpleName());
+ }
+ }
+
+ @Override
+ public String getFamily() {
+ // TODO Auto-generated method stub
+ return COMPONENT_FAMILY;
+ }
+}
Added: root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,52 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.renderkit.RendererBase;
+import org.richfaces.component.UIPanel;
+
+/**
+ * @author amarkhel
+ * @since Jun 14, 2010
+ */
+@ResourceDependency(name = "css/panel.ecss")
+public class PanelBaseRenderer extends RendererBase {
+
+ public PanelBaseRenderer() {
+ }
+
+ public void renderHeaderFacet(FacesContext context, UIComponent component) throws IOException {
+ UIComponent headerFacet = component.getFacet("header");
+ headerFacet.encodeAll(context);
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIPanel.class;
+ }
+}
Added: root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,264 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.renderkit.RendererBase;
+import org.richfaces.component.UIPopupPanel;
+@ResourceDependencies( {
+ @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "script/popupPanel.js"),
+ @ResourceDependency(name = "script/popupPanelBorders.ecss")
+
+})
+public class PopupPanelBaseRenderer extends RendererBase{
+
+ private static final String CONTROLS_FACET = "controls";
+ private static final String HEADER_FACET = "header";
+ private static final int sizeA = 10;
+
+ public String getShadowStyle(FacesContext context, UIComponent component) {
+ UIPopupPanel panel = (UIPopupPanel)component;
+ return panel.getShadowStyle();
+ }
+ public void renderHeaderFacet(FacesContext context, UIComponent component) throws IOException {
+ renderFacet(context, component, HEADER_FACET);
+ }
+
+ public void renderControlsFacet(FacesContext context, UIComponent component) throws IOException {
+ renderFacet(context, component, CONTROLS_FACET);
+ }
+
+ private void renderFacet(FacesContext context, UIComponent component, String facet) throws IOException{
+ UIComponent headerFacet = component.getFacet(facet);
+ headerFacet.encodeAll(context);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+
+ /*UIPopupPanel panel = (UIPopupPanel)component;
+ ExternalContext exCtx = context.getExternalContext();
+ Map<String, String> rqMap = exCtx.getRequestParameterMap();
+ Object panelOpenState = rqMap.get(panel.getClientId(context) + "OpenedState");
+
+ if (panel.isKeepVisualState()) {
+ if (null != panelOpenState) {
+ // Bug https://jira.jboss.org/jira/browse/RF-2466
+ // Incorrect old:
+ // panel.setShowWhenRendered(Boolean.parseBoolean((String) clnId));
+ // ShowWhenRendered can be settled separately with modal panel "showWhenRendered" attribute
+ // so we should combine ShowWhenRendered || KeepVisualState && (OpenedState==TRUE) against rewriting
+ boolean show = panel.isShow() || Boolean.parseBoolean((String) panelOpenState);
+ panel.setShow(show);
+
+ Map<String, Object> visualOptions = (Map<String, Object>) panel.getVisualOptions();
+ Iterator<Entry<String, String>> it = rqMap.entrySet().iterator();
+ while ( it.hasNext()) {
+ Map.Entry<String, String> entry = it.next();
+ int suffixPos = entry.getKey().toString().indexOf(STATE_OPTION_SUFFIX);
+ if (-1 != suffixPos) {
+ String key = entry.getKey().toString().substring(suffixPos + STATE_OPTION_SUFFIX.length());
+ visualOptions.put(key, entry.getValue());
+ }
+ }
+ }*/
+ //}
+ }
+
+ protected Class getComponentClass() {
+ return UIPopupPanel.class;
+ }
+
+ private static final Set<String> ALLOWED_ATTACHMENT_OPTIONS = new HashSet<String>();
+ static {
+ ALLOWED_ATTACHMENT_OPTIONS.add("body");
+ ALLOWED_ATTACHMENT_OPTIONS.add("parent");
+ ALLOWED_ATTACHMENT_OPTIONS.add("form");
+ }
+
+ //TODO nick - add messages
+ public void checkOptions(FacesContext context, UIComponent component) {
+ UIPopupPanel panel = (UIPopupPanel)component;
+ if (panel.isAutosized() && panel.isResizeable()) {
+ throw new IllegalArgumentException("Autosized modal panel can't be resizeable.");
+ }
+
+ String domElementAttachment = panel.getDomElementAttachment();
+ if (domElementAttachment != null && domElementAttachment.trim().length() != 0) {
+ if (!ALLOWED_ATTACHMENT_OPTIONS.contains(domElementAttachment)) {
+ throw new IllegalArgumentException("Value '" + domElementAttachment + "' of domElementAttachment attribute is illegal. " +
+ "Allowed values are: " + ALLOWED_ATTACHMENT_OPTIONS);
+ }
+ }
+
+ if (panel.getMinHeight() != -1) {
+ if (panel.getMinHeight() < sizeA) {
+ throw new IllegalArgumentException();
+ }
+
+// if (panel.getHeight() < panel.getMinHeight()) {
+// panel.setHeight(panel.getMinHeight());
+// }
+ }
+
+ if (panel.getMinWidth() != -1) {
+ if (panel.getMinWidth() < sizeA) {
+ throw new IllegalArgumentException();
+ }
+
+// if (panel.getWidth() < panel.getMinWidth()) {
+// panel.setWidth(panel.getMinWidth());
+// }
+ }
+ }
+
+// protected String buildOptions(FacesContext context, UIModalPanel panel) {
+// return getOptions(context, panel, getUtils());
+// }
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ public String buildShowScript(FacesContext context, UIComponent component) {
+ UIPopupPanel panel = (UIPopupPanel)component;
+ StringBuilder result = new StringBuilder();
+
+ // Bug https://jira.jboss.org/jira/browse/RF-2466
+ // We are already processed KeepVisualState and current open state in
+ // doDecode, so no need to check panel.isKeepVisualState() here.
+ if (/*panel.isKeepVisualState() || */panel.isShow()) {
+ result.append("Richfaces.showModalPanel('" + panel.getClientId(context) + "', {");
+
+ Iterator<Map.Entry<String, Object>> it = ((Map<String, Object>) panel.getVisualOptions()).entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, Object> entry = it.next();
+
+ result.append(entry.getKey() + ": '" + entry.getValue() + "'");
+ if (it.hasNext()) {
+ result.append(", ");
+ }
+ }
+
+ result.append("});");
+ }
+ return result.toString();
+ }
+
+ public String buildScript(FacesContext context, UIComponent component) throws IOException {
+ UIPopupPanel panel = (UIPopupPanel)component;
+ StringBuilder result = new StringBuilder();
+ result.append("new ModalPanel('");
+ result.append(panel.getClientId());
+ result.append("',{");
+ result.append("width:");
+ result.append(panel.getWidth());
+ result.append(",");
+ result.append("height:");
+ result.append(panel.getHeight());
+ result.append(",");
+ result.append("minWidth:");
+ result.append(panel.getMinWidth());
+ result.append(",");
+ result.append("minHeight:");
+ result.append(panel.getMinHeight());
+ result.append(",");
+ result.append("maxWidth:");
+ result.append(panel.getMaxWidth());
+ result.append(",");
+ result.append("maxHeight:");
+ result.append(panel.getMaxHeight());
+ result.append(",");
+ result.append("resizable:");
+ result.append(panel.isResizeable());
+ result.append(",");
+ result.append("moveable:");
+ result.append(panel.isMoveable());
+ result.append(",");
+ result.append("left:");
+ result.append(panel.getLeft());
+ result.append(",");
+ result.append("top:");
+ result.append(panel.getTop());
+ result.append(",");
+ result.append("zIndex:");
+ result.append(panel.getZIndex());
+ result.append(",");
+ result.append(writeEventHandlerFunction(context, panel,"onresize"));
+ result.append(writeEventHandlerFunction(context, panel,"onmove"));
+ result.append(writeEventHandlerFunction(context, panel,"onshow"));
+ result.append(writeEventHandlerFunction(context, panel,"onhide"));
+ result.append(writeEventHandlerFunction(context, panel,"onbeforeshow"));
+ result.append(writeEventHandlerFunction(context, panel,"onbeforehide"));
+ result.append("domElementAttachment:");
+ result.append(panel.getDomElementAttachment());
+ result.append(",");
+ result.append("keepVisualState:");
+ result.append(panel.isKeepVisualState());
+ result.append(",");
+ result.append("show:");
+ result.append(panel.isShow());
+ result.append(",");
+ result.append("selectBehaviour:");
+ result.append(panel.getSelectBehaviour());
+ result.append(",");
+ result.append("autosized:");
+ result.append(panel.isAutosized());
+ result.append(",");
+ result.append("overlapEmbedObjects:");
+ result.append(panel.isOverlapEmbedObjects());
+ result.append(",");
+ writeVisualOptions(context, panel);
+ result.append("}');");
+ return result.toString();
+ }
+
+ public String writeEventHandlerFunction(FacesContext context, UIComponent component, String eventName) throws IOException{
+ String event = (String) component.getAttributes().get(eventName);
+
+ if (event != null) {
+ event = event.trim();
+
+ if (event.length() != 0) {
+ JSFunctionDefinition function = new JSFunctionDefinition();
+
+ function.addParameter("event");
+ function.addToBody(event);
+
+ return function.toScript();
+ }
+ }
+
+ return "";
+ }
+
+ private String writeVisualOptions(FacesContext context, UIPopupPanel panel)
+ throws IOException {
+ StringBuffer result = new StringBuffer();
+
+ Iterator<Map.Entry<String, Object>> it = ((Map<String, Object>) panel.getVisualOptions()).entrySet().iterator();
+ if (it.hasNext()) {
+ result.append(",\n");
+ }
+ while (it.hasNext()) {
+ Map.Entry<String, Object> entry = it.next();
+
+ result.append(entry.getKey() + ": '" + entry.getValue() + "'");
+ if (it.hasNext()) {
+ result.append(",\n");
+ }
+ }
+ return result.toString();
+ }
+}
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/MANIFEST.MF (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/MANIFEST.MF 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/panel.ecss
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/panel.ecss (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/panel.ecss 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,29 @@
+.rf-panel{
+ background-color:'#{richSkin.generalBackgroundColor}';
+ color:'#{richSkin.panelBorderColor}';
+ border-width:1px;
+ border-style:solid;
+ padding:1px;
+}
+
+.rf-panel-header{
+ background-color:'#{richSkin.headerBackgroundColor}';
+ border-color:'#{richSkin.headerBackgroundColor}';
+ font-size:'#{richSkin.headerSizeFont}';
+ color:'#{richSkin.headerTextColor}';
+ font-weight:'#{richSkin.headerWeightFont}';
+ font-family:'#{richSkin.headerFamilyFont}';
+ padding:2px;
+ border-width:1px;
+ border-style:solid;
+ background-position:top left;
+ background-repeat:repeat-x;
+ background-image:"url(#{resource['org.richfaces.renderkit.html.GradientA']})";
+}
+
+.rf-panel-body{
+ font-size:'#{richSkin.generalSizeFont}';
+ color:'#{richSkin.generalTextColor}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ padding:10px;
+}
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/popupPanel.ecss
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/popupPanel.ecss (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/css/popupPanel.ecss 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,172 @@
+.mp-button {
+ outline-style: none;
+ position: absolute;
+ border: 10px solid red;
+ position: absolute;
+ clip: rect(0px 0px 1px 1px);
+ height: 10px;
+ width: 10px;
+ left: 0px;
+ top: 0px;
+ z-index: -300;
+}
+
+.mp_shade {
+ position : fixed;
+ width : 100%;
+ height : 100%;
+ top:0px;
+ left : 0px;
+ background : black;
+ filter : alpha(opacity=50); opacity:0.5;
+}
+.mp_iframe {
+ position : absolute;
+ width : 100%;
+ height : 100%;
+ top:0px;
+ left : 0px;
+ filter : alpha(opacity=0);
+}
+.mp_shadow {
+ background-image:"url(#{resource['images/bg_shadow.png']})";
+ position : fixed;
+ top : 50%;
+ left : 50%;
+ width : 620px /*visible modal panel width plus 20px*/;
+ height : 420px /*visible modal panel height plus 20px*/;
+ background : none;
+ margin-top : -208px /*half of width minus 2px*/;
+ margin-left : -308px /*half of height minus 2px*/;
+}
+.mp_container {
+ position : fixed;
+ top : 50%;
+ left : 50%;
+ width : 600px /*visible modal panel width*/;
+ height : 400px /*visible modal panel height*/;
+ margin-top : -200px /*half of height*/;
+ margin-left : -300px /*half of width*/;
+ border : '1px solid #{richSkin.panelBorderColor}';
+ background : '#{richSkin.generalBackgroundColor}';
+}
+.mp_header {
+ background : "url(#{resource['org.richfaces.renderkit.html.GradientA']})";
+ repeat-x : 'top left #{richSkin.headerBackgroundColor};;
+ height : 30px /*header height*/;
+ position : relative;
+ padding-right : 60px;
+ padding-left : 10px;
+ cursor : move;
+}
+.mp_header_content {
+ overflow : hidden;
+ width : 100%;
+ white-space : nowrap;
+ padding-top : 8px;
+ text-overflow: ellipsis;
+ font-weight : '#{richSkin.headerWeightFont}';
+ color : '#{richSkin.headerTextColor}';
+ font-family : '#{richSkin.headerFamilyFont}';
+ font-size : '#{richSkin.headerSizeFont}';
+}
+.mp_header_controls {
+ background : "url(#{resource['images/close_act.gif']}) no-repeat center";
+ width : 16px;
+ height : 16px;
+ position : absolute;
+ top : 8px;
+ right : 8px;
+ white-space : nowrap;
+ cursor : default
+}
+.mp_header_icon {
+ background : "url(#{resource['images/edit.gif']}) no-repeat center";
+ width : 16px;
+ height : 16px;
+ margin-right : 5px;
+ vertical-align : middle;
+ display : inline-block;
+ text-align : middle;
+}
+.mp_content_scroller {
+ width : 600px /*visible modal panel width*/;
+ height : 370px /*visible modal panel height minus header height*/;
+ position : relative;
+ top : 0px;
+ left : 0px;
+ !overflow : auto;
+ !overflow-x : hidden;
+}
+.mp_content {
+ position : relative;
+ padding : 10px;
+ color : '#{richSkin.generalTextColor}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
+}
+.mp_handler {
+ background : red;
+ filter : alpha(opacity=0);
+ opacity:0;
+ position : absolute;
+ margin : -4px;
+}
+.mp_handler_left {
+ width : 7px;
+ height : 100%;
+ top : 0px;
+ left : 0px;
+ cursor : w-resize;
+}
+
+.mp_handler_right {
+ width : 7px;
+ height : 100%;
+ top : 0px;
+ right : 0px;
+ cursor : w-resize;
+}
+.mp_handler_top {
+ width : 100%;
+ height : 7px;
+ top : 0px;
+ left : 0px;
+ cursor : n-resize;
+}
+.mp_handler_bottom {
+ width : 100%;
+ height : 7px;
+ bottom : 0px;
+ left : 0px;
+ cursor : n-resize;
+}
+
+.mp_handler_top_left {
+ width : 10px;
+ height : 10px;
+ top : 0px;
+ left : 0px;
+ cursor : nw-resize;
+}
+.mp_handler_top_right {
+ width : 10px;
+ height : 10px;
+ top : 0px;
+ right : 0px;
+ cursor : ne-resize;
+}
+.mp_handler_bottom_left {
+ width : 10px;
+ height : 10px;
+ bottom : 0px;
+ left : 0px;
+ cursor : ne-resize;
+}
+.mp_handler_bottom_right {
+ width : 10px;
+ height : 10px;
+ bottom : 0px;
+ right : 0px;
+ cursor : nw-resize;
+}
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/faces-config.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/faces-config.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<faces-config version="2.0" metadata-complete="false"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://richfaces.org/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<component>
+ <component-type>org.richfaces.Panel</component-type>
+ <component-class>org.richfaces.component.UIPanel</component-class>
+ </component>
+ <render-kit>
+ <render-kit-id>HTML_BASIC</render-kit-id>
+ <renderer>
+ <component-family>org.richfaces.Panel</component-family>
+ <renderer-type>org.richfaces.PanelRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.PanelRenderer</renderer-class>
+ </renderer>
+ </render-kit>
+ <faces-config-extension>
+ <cdk:taglib>
+ <cdk:shortName>panels</cdk:shortName>
+ <cdk:uri>http://richfaces.org/panels</cdk:uri>
+ </cdk:taglib>
+ </faces-config-extension>
+</faces-config>
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/bg_header.png
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/bg_header.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/close_act.gif
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/close_act.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/edit.gif
===================================================================
(Binary files differ)
Property changes on: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/images/edit.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/panels.taglib.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/panels.taglib.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/panels.taglib.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<facelet-taglib 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-facelettaglibrary_2_0.xsd" version="2.0" id="a4j">
+ <namespace>http://richfaces.org/panels</namespace>
+ <tag>
+ <tag-name>panel</tag-name>
+ <component>
+ <component-type>org.richfaces.Panel</component-type>
+ <renderer-type>org.richfaces.PanelRenderer</renderer-type>
+ </component>
+ </tag>
+</facelet-taglib>
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanel.js
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanel.js (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanel.js 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,1087 @@
+/*if (!window.DW) {
+ window.DW = {};
+}
+
+if (!window.Richfaces) {
+ window.Richfaces = {};
+}
+
+function discardElement(element) {
+ var garbageBin = document.getElementById('IELeakGarbageBin');
+ if (!garbageBin) {
+ garbageBin = document.createElement('DIV');
+ garbageBin.id = 'IELeakGarbageBin';
+ garbageBin.style.display = 'none';
+ document.body.appendChild(garbageBin);
+ }
+
+ window.RichFaces.Memory.clean(element);
+ // move the element to the garbage bin
+ garbageBin.appendChild(element);
+ garbageBin.innerHTML = '';
+}*/
+
+Selection = {};
+Selection.eventHandler=function(event){Event.stop(event);};
+Selection.eventHandler = Selection.eventHandler.bindAsEventListener(Selection);
+Selection.disableSelection = function (element)
+{
+ if (typeof element.onselectstart!="undefined") //IE
+ {
+ Event.observe(element, 'selectstart', this.eventHandler);
+ }
+ else if (typeof element.style.MozUserSelect!="undefined") //Firefox
+ {
+ element.style.MozUserSelect="none";
+ }
+ else //All other (ie: Opera)
+ {
+ Event.observe(element, 'mousedown', this.eventHandler);
+ }
+}
+
+Selection.enableSelection = function (element)
+{
+ if (typeof element.onselectstart!="undefined") //IE
+ {
+ Event.stopObserving(element, 'selectstart', this.eventHandler);
+ }
+ else if (typeof element.style.MozUserSelect!="undefined") //Firefox
+ {
+ element.style.MozUserSelect="";
+ }
+ else //All other (ie: Opera)
+ {
+ Event.stopObserving(element, 'mousedown', this.eventHandler);
+ }
+}
+
+ModalPanel = Class.create();
+
+ModalPanel.panels = new Array();
+ModalPanel.activePanels = new Array();
+
+function getSizeElement() {
+ /*var element;
+ if (RichFaces.navigatorType() != RichFaces.OPERA && document.compatMode=='CSS1Compat') {
+ element = document.documentElement;
+ } else {
+ element = document.body;
+ }*/
+
+ return document.body;
+}
+
+ModalPanel.getMinimumSize = function(size) {
+ return Math.max(size, 2*ModalPanel.Sizer.INITIAL_MIN + 2);
+};
+
+ModalPanel.prototype = {
+ initialize: function(id, options) {
+ this["rich:destructor"] = "destroy";
+
+ this.markerId = $(id);
+
+ this.id = $(id + "Container");
+
+ this.options = options;
+
+ this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
+
+ this.minWidth = ModalPanel.getMinimumSize(this.options.minWidth);
+ this.minHeight = ModalPanel.getMinimumSize(this.options.minHeight);
+
+ this.div = id + "Div";
+ this.cursorDiv = id + "CursorDiv";
+ this.cdiv = id + "CDiv";
+ this.contentDiv = id + "ContentDiv";
+ this.contentTable = id + "ContentTable";
+ this.shadowDiv = id + "ShadowDiv";
+
+ this.borders = new Array();
+
+ if (this.options.resizeable) {
+ this.borders.push(new ModalPanel.Border(id + "ResizerN", this, "N-resize", ModalPanel.Sizer.N));
+ this.borders.push(new ModalPanel.Border(id + "ResizerE", this, "E-resize", ModalPanel.Sizer.E));
+ this.borders.push(new ModalPanel.Border(id + "ResizerS", this, "S-resize", ModalPanel.Sizer.S));
+ this.borders.push(new ModalPanel.Border(id + "ResizerW", this, "W-resize", ModalPanel.Sizer.W));
+
+ this.borders.push(new ModalPanel.Border(id + "ResizerNWU", this, "NW-resize", ModalPanel.Sizer.NWU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerNEU", this, "NE-resize", ModalPanel.Sizer.NEU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerNEL", this, "NE-resize", ModalPanel.Sizer.NEL));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSEU", this, "SE-resize", ModalPanel.Sizer.SEU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSEL", this, "SE-resize", ModalPanel.Sizer.SEL));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSWL", this, "SW-resize", ModalPanel.Sizer.SWL));
+ this.borders.push(new ModalPanel.Border(id + "ResizerSWU", this, "SW-resize", ModalPanel.Sizer.SWU));
+ this.borders.push(new ModalPanel.Border(id + "ResizerNWL", this, "NW-resize", ModalPanel.Sizer.NWL));
+ }
+
+ if (this.options.moveable && $(id + "Header")) {
+ this.header = new ModalPanel.Border(id + "Header", this, "move", ModalPanel.Header);
+ }
+
+ this.markerId.component = this;
+
+ var eDiv = $(this.div);
+ if (eDiv.style.setExpression)
+ /*if (ModalPanel.disableSelects *//* IE 6 */ /*|| Richfaces.getComputedStyle(eDiv, "position") != "fixed" /* IE again, not in strict mode*//*)*/
+
+ /*{
+ eDiv.style.position = "absolute";
+
+ var eCursorDiv = $(this.cursorDiv);
+ eCursorDiv.style.position = "absolute";
+
+ //that is to apply filter
+ eDiv.style.zoom = "1";
+ eCursorDiv.style.zoom = "1";
+
+ var eCdiv = $(this.cdiv);
+ eCdiv.style.position = "absolute";
+ eCdiv.parentNode.style.position = "absolute";
+
+ eCdiv.mpUseExpr = true;
+ }*/
+
+ ModalPanel.panels.push(this);
+
+ this.eventFirstOnfocus = this.firstOnfocus.bindAsEventListener(this);
+ this.eventLastOnfocus = this.lastOnfocus.bindAsEventListener(this);
+
+ this.firstHref = id + "FirstHref";
+ this.lastHref = id + "LastHref";
+
+ this.selectBehavior = options.selectBehavior;
+ },
+
+ _saveInputValues: function(element) {
+ /* Fix for RF-3856 - Checkboxes in modal panel does not hold their states after modal was closed and opened again */
+ if (Prototype.Browser.IE /* reproducible for checkbox/radio in IE6, radio in IE 7/8 beta 2 */) {
+ var inputs = element.getElementsByTagName('input');
+ if (inputs) {
+ for (var i = 0; i < inputs.length; i++) {
+ var input = inputs[i];
+ if (input.type == 'checkbox' || input.type == 'radio') {
+ input.defaultChecked = input.checked;
+ }
+ }
+ }
+ }
+ },
+
+ width: function() {
+ return this.getSizedElement().clientWidth;
+ },
+
+ height: function() {
+ return this.getSizedElement().clientHeight;
+ },
+
+ getSizedElement: function() {
+ if (!this._sizedElement) {
+ this._sizedElement = $(this.cdiv);
+ }
+
+ return this._sizedElement;
+ },
+
+ getContentElement: function() {
+ if (!this._contentElement) {
+ this._contentElement = this.options.autosized ? $(this.contentTable) : $(this.contentDiv);
+ }
+
+ return this._contentElement;
+ },
+
+ destroy: function() {
+
+ if (this.observerSize) {
+ window.clearInterval(this.observerSize);
+ this.observerSize = null;
+ }
+
+ this._contentElement = null;
+ this._sizedElement = null;
+
+ ModalPanel.panels = ModalPanel.panels.without(this);
+
+ this.enableSelects();
+
+ ModalPanel.activePanels = ModalPanel.activePanels.without(this);
+
+ this.parent = null;
+ this.firstOutside = null;
+ this.lastOutside = null;
+ if (this.header) {
+ this.header.destroy();
+ this.header=null;
+ }
+
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].destroy();
+ }
+ this.borders = null;
+
+ setTimeout(function() {
+ if (this.domReattached) {
+ var element = this.id;
+ var parent = element.parentNode;
+ if (parent) {
+ parent.removeChild(element);
+ discardElement(element);
+ }
+ }
+ }.bind(this), 0);
+
+ this.markerId.component = null;
+ this.markerId = null;
+ },
+
+ initIframe : function() {
+ if (this.contentWindow) {
+ Element.setStyle(this.contentWindow.document.body, { "margin" : "0px 0px 0px 0px" });
+ } else {
+ //TODO opera etc.
+
+ }
+
+ if("transparent" == Element.getStyle(document.body, "background-color")) {
+ this.style.filter = "alpha(opacity=0)";
+ this.style.opacity = "0";
+ }
+
+ //this.style.opacity = "0.5";
+ //this.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)';
+ //var iframeBodyStyle = this.contentWindow.document.body.style;
+ //iframeBodyStyle.backgroundColor = "#d0d0d0";
+ //iframeBodyStyle.filter = "alpha(opacity=50)";
+ //iframeBodyStyle.opacity = "0.5";
+ //iframeBodyStyle.zIndex = "99";
+ },
+
+ enableSelect: function(elt) {
+ if (elt._mdwProcessed) {
+ elt._mdwProcessed = undefined;
+
+ if (elt._mdwDisabled) {
+ elt.disabled = false;
+ elt._mdwDisabled = undefined;
+ }
+
+ if (typeof elt._mdwHidden != "undefined") {
+ elt.style.visibility = elt._mdwHidden;
+ elt._mdwHidden = undefined;
+ }
+ }
+ },
+
+ disableSelect: function(elt) {
+ if (!elt._mdwProcessed) {
+ elt._mdwProcessed = true;
+
+ if ("hide" == this.selectBehavior) {
+ if (elt.style.visibility != "hidden") {
+ elt._mdwHidden = elt.style.visibility;
+ elt.style.visibility = "hidden";
+ }
+ } else {
+ if (!elt.disabled) {
+ elt.disabled = true;
+ elt._mdwDisabled = true;
+ }
+ }
+ }
+ },
+
+ enableInnerSelects: function() {
+ if (ModalPanel.disableSelects) {
+ var selects = this.id.getElementsByTagName("SELECT");
+ for (var k = 0; k < selects.length; k++) {
+ this.enableSelect(selects[k]);
+ }
+ }
+ },
+
+ disableInnerSelects: function() {
+ if (ModalPanel.disableSelects) {
+ var selects = this.id.getElementsByTagName("SELECT");
+ for (var k = 0; k < selects.length; k++) {
+ this.disableSelect(selects[k]);
+ }
+ }
+ },
+
+ enableSelects: function() {
+ if (!ModalPanel.disableSelects) {
+ return ;
+ }
+
+ var lastPanel = ModalPanel.activePanels[ModalPanel.activePanels.length - 1];
+ var newLastPanel = ModalPanel.activePanels[ModalPanel.activePanels.length - 2];
+
+ if (newLastPanel) {
+ if (lastPanel == this) {
+ //we've just closed top panel, re-enable next panel if any
+ newLastPanel.enableInnerSelects();
+ }
+ } else {
+ var selects = document.body.getElementsByTagName("SELECT");
+ for (var i = 0; i < selects.length; i++) {
+ this.enableSelect(selects[i]);
+ }
+ }
+ },
+
+ disableOuterSelects: function() {
+ if (!ModalPanel.disableSelects) {
+ return ;
+ }
+
+ var lastPanel = ModalPanel.activePanels.last();
+
+ if (lastPanel) {
+ //we need to disable only the last opened panel
+ lastPanel.disableInnerSelects();
+ this.enableInnerSelects();
+ } else {
+ //disable all outer
+ var selects = document.body.getElementsByTagName("SELECT");
+
+ var innerSelects = this.id.getElementsByTagName("SELECT");
+ var firstInnerSelect = innerSelects[0];
+ var lastInnerSelect = innerSelects[innerSelects.length - 1];
+
+ var selectsAreInner = false;
+
+ for (var i = 0; i < selects.length; i++) {
+ var select = selects[i];
+ if (select == firstInnerSelect) {
+ selectsAreInner = true;
+ }
+
+ if (!selectsAreInner) {
+ this.disableSelect(select);
+ }
+
+ if (select == lastInnerSelect) {
+ selectsAreInner = false;
+ }
+ }
+ }
+ },
+
+ setLeft: function(pos) {
+ var eCdiv = $(this.cdiv);
+ if (eCdiv.mpUseExpr) {
+ eCdiv.mpLeft = pos;
+ } else {
+ eCdiv.style.left = pos + "px";
+ }
+ },
+
+ setTop: function(pos) {
+ var eCdiv = $(this.cdiv);
+ if (eCdiv.mpUseExpr) {
+ eCdiv.mpTop = pos;
+ } else {
+ eCdiv.style.top = pos + "px";
+ }
+ },
+
+ firstOnfocus: function(event) {
+ var e = $(this.firstHref)
+ if (e && (ModalPanel.activePanels.last() == this)) {
+ e.focus();
+ }
+ },
+
+ lastOnfocus: function(event) {
+ var e = $(this.lastHref);
+ if (e && (ModalPanel.activePanels.last() == this)) {
+ e.focus();
+ }
+ },
+
+ formElements: "|a|input|select|button|textarea|",
+
+ processAllFocusElements: function(root, callback) {
+ var idx = -1;
+ var tagName;
+
+ if (root.focus && root.nodeType == 1 && (tagName = root.tagName) &&
+ // Many not visible elements have focus method, we is had to avoid processing them.
+ (idx = this.formElements.indexOf(tagName.toLowerCase())) != -1 &&
+ this.formElements.charAt(idx - 1) === '|' &&
+ this.formElements.charAt(idx + tagName.length) === '|' &&
+ !root.disabled && root.type!="hidden") {
+ callback.call(this, root);
+ } else {
+ if (root != this.id) {
+ var child = root.firstChild;
+ while (child) {
+ if (!child.style || child.style.display != 'none') {
+ this.processAllFocusElements(child, callback);
+ }
+ child = child.nextSibling;
+ }
+ }
+ }
+ },
+
+ processTabindexes: function(input) {
+ if (!this.firstOutside && !(input.tagName.toLowerCase()=="select" && ModalPanel.disableSelects)) {
+ this.firstOutside = input;
+ }
+ this.lastOutside = input;
+ if (input.tabIndex && !input.prevTabIndex) {
+ input.prevTabIndex = input.tabIndex;
+ }
+ input.tabIndex = undefined;
+ if (input.accesskey && !input.prevAccesskey) {
+ input.prevAccesskey = input.accesskey;
+ }
+ input.accesskey = undefined;
+ },
+
+ restoreTabindexes: function(input) {
+ if (input.prevTabIndex) {
+ input.tabIndex = input.prevTabIndex;
+ input.prevTabIndex = undefined;
+ }
+ if (input.prevAccesskey) {
+ input.accesskey = input.prevAccesskey;
+ input.prevAccesskey = undefined;
+ }
+ },
+
+ preventFocus: function() {
+ this.processAllFocusElements(document, this.processTabindexes);
+
+ if (this.firstOutside) {
+ Event.observe(this.firstOutside, "focus", this.eventFirstOnfocus);
+ }
+ if (this.lastOutside && this.lastOutside != this.firstOutside) {
+ Event.observe(this.lastOutside, "focus", this.eventLastOnfocus);
+ }
+ },
+
+ restoreFocus: function() {
+ this.processAllFocusElements(document, this.restoreTabindexes);
+
+ if (this.firstOutside) {
+ Event.stopObserving(this.firstOutside, "focus", this.eventFirstOnfocus);
+ this.firstOutside = null;
+ }
+ if (this.lastOutside) {
+ Event.stopObserving(this.lastOutside, "focus", this.eventLastOnfocus);
+ this.lastOutside = null;
+ }
+ },
+
+ show: function(event, opts) {
+ if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
+
+ var element = this.id;
+
+ this.preventFocus();
+
+ if (!this.domReattached) {
+ this.parent = element.parentNode;
+
+ var domElementAttachment;
+ if (opts) {
+ domElementAttachment = opts.domElementAttachment;
+ }
+
+ if (!domElementAttachment) {
+ domElementAttachment = this.options.domElementAttachment;
+ }
+
+ var newParent;
+ if ('parent' == domElementAttachment) {
+ newParent = this.parent;
+ } else if ('form' == domElementAttachment) {
+ newParent = this._findForm(element) || document.body;
+ } else {
+ //default - body
+ newParent = document.body;
+ }
+
+ if (newParent != this.parent) {
+ this._saveInputValues(element);
+ newParent.insertBefore(element, null);
+ this.domReattached = true;
+ } else {
+ Element.show(this.parent);
+ }
+ }
+
+ var eCdiv = $(this.cdiv);
+ var forms = eCdiv.getElementsByTagName("form");
+
+ if (this.options.keepVisualState && forms) {
+ this.formOnsubmit = this.setStateInput.bindAsEventListener(this);
+ for (var i = 0; i < forms.length; i++) {
+ Event.observe(forms[i], "submit", this.formOnsubmit);
+ }
+ }
+
+ var eIframe;
+ if ((ModalPanel.disableSelects || this.options.overlapEmbedObjects) && !this.iframe) {
+ this.iframe = this.id.id + "IFrame";
+ new Insertion.Top(eCdiv,
+ "<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
+ "class=\"rich-mpnl-iframe\" style=\"width: 1px; height: 1px;\">" +
+ "</iframe>");
+
+ eIframe = $(this.iframe);
+
+ //alert("IFrame:" + eIframe + "created!");
+
+ //eIframe.onload = this.initIframe.bind(eIframe);
+ Event.observe(eIframe, 'load', this.initIframe.bindAsEventListener(eIframe));
+ }
+
+ var options = {};
+ this.userOptions = {};
+
+ if (!eCdiv.mpSet) {
+ Object.extend(options, this.options);
+ }
+
+ if (opts) {
+ Object.extend(options, opts);
+ Object.extend(this.userOptions, opts);
+ }
+
+ this.currentMinHeight = ModalPanel.getMinimumSize((options.minHeight || options.minHeight == 0) ? options.minHeight : this.minHeight);
+ this.currentMinWidth = ModalPanel.getMinimumSize((options.minWidth || options.minWidth == 0) ? options.minWidth : this.minWidth);
+
+ var eContentElt = this.getContentElement();
+
+ if (!this.options.autosized) {
+ if (options.width && options.width == -1)
+ options.width = 300;
+ if (options.height && options.height == -1)
+ options.height = 200;
+ }
+
+ if (options.width && options.width != -1) {
+ if (this.currentMinWidth > options.width) {
+ options.width = this.currentMinWidth;
+ }
+
+ eContentElt.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
+ }
+
+ if (options.height && options.height != -1) {
+ if (this.currentMinHeight > options.height) {
+ options.height = this.currentMinHeight;
+ }
+
+ eContentElt.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
+ }
+
+ eCdiv.mpSet = true;
+
+ //Element.setStyle(this.dialogWindow.document.body, { "margin" : "0px 0px 0px 0px" });
+ //if("transparent" == Element.getStyle(document.body, "background-color")) {
+ // eIframe.allowTransparency = true;
+ //}
+
+ this.disableOuterSelects();
+ ModalPanel.activePanels = ModalPanel.activePanels.without(this);
+ ModalPanel.activePanels.push(this);
+
+ //this.shape.init(eCdiv, this.options);
+
+ var eDiv = $(this.div);
+ if (eDiv.style.position == "absolute")
+ {
+ var we = "getSizeElement().clientWidth + \"px\"";
+ var he = "getSizeElement().clientHeight + \"px\"";
+ eDiv.style.setExpression("width", we);
+ eDiv.style.setExpression("height", he);
+
+ var eCursorDiv = $(this.cursorDiv);
+ eCursorDiv.style.setExpression("width", we);
+ eCursorDiv.style.setExpression("height", he);
+
+ var le = "-Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft + \"px\"";
+ var te = "-Position.cumulativeOffset(this.parentNode)[1] + getSizeElement().scrollTop + \"px\"";
+
+ eDiv.style.setExpression("left", le);
+ eDiv.style.setExpression("top", te);
+
+ eCursorDiv.style.setExpression("left", le);
+ eCursorDiv.style.setExpression("top", te);
+
+ var leftExpr = "(this.mpLeft || 0) + -Position.cumulativeOffset(this.parentNode)[0] + getSizeElement().scrollLeft + \"px\"";
+ var topExpr = "(this.mpTop || 0) + -Position.cumulativeOffset(this.parentNode)[1] + getSizeElement().scrollTop + \"px\"";
+
+ eCdiv.style.setExpression("left", leftExpr);
+ eCdiv.style.setExpression("top", topExpr);
+
+
+ /* That's how we output debug info - DOM inspector rulez */
+ /*
+ document.body.setExpression("_clientLeft", "getSizeElement().clientLeft");
+ document.body.setExpression("_clientTop", "getSizeElement().clientTop");
+ document.body.setExpression("_scrollLeft", "getSizeElement().scrollLeft");
+ document.body.setExpression("_scrollTop", "getSizeElement().scrollTop");
+ */
+ /* */
+ }
+
+ element.style.visibility = "hidden";
+ Element.show(element);
+ this.correctShadowSize();
+
+ if (options.left) {
+ var _left;
+ if (options.left != "auto") {
+ _left = parseInt(options.left, 10);
+ } else {
+ var cw = getSizeElement().clientWidth;
+ var _width = this.width(); //Richfaces.getComputedStyleSize(eContentElt, "width");
+ if (cw >= _width) {
+ _left = (cw - _width) / 2;
+ } else {
+ _left = 0;
+ }
+ }
+
+ this.setLeft(Math.round(_left));
+ }
+
+ if (options.top) {
+ var _top;
+ if (options.top != "auto") {
+ _top = parseInt(options.top, 10);
+ } else {
+ var cw = getSizeElement().clientHeight;
+ var _height = this.height(); //Richfaces.getComputedStyleSize(eContentElt, "height");
+ if (cw >= _height) {
+ _top = (cw - _height) / 2;
+ } else {
+ _top = 0;
+ }
+ }
+
+ this.setTop(Math.round(_top));
+ }
+
+ if (this.options.autosized) {
+ this.observerSize =
+ window.setInterval(this.correctShadowSize.bindAsEventListener(this), 500);
+ }
+
+ this.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
+
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].doPosition();
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ Element.hide(eCdiv);
+ element.style.visibility = "";
+
+ this.lastOnfocus();
+
+ Element.show(eCdiv);
+
+ var event = {};
+ event.parameters = opts || {};
+ this.shown = true;
+ this.invokeEvent("show",event,null,element);
+ }
+ },
+
+ startDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].hide();
+ }
+ Selection.disableSelection(document.body);
+ },
+
+ endDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].show();
+ this.borders[k].doPosition();
+ }
+ Selection.enableSelection(document.body);
+ },
+
+ hide: function(event, opts) {
+ if (this.shown && this.invokeEvent("beforehide",event,null,element)) {
+
+ this.currentMinHeight = undefined;
+ this.currentMinWidth = undefined;
+
+ this.restoreFocus();
+
+ this.enableSelects();
+
+ ModalPanel.activePanels = ModalPanel.activePanels.without(this);
+
+ var eDiv = $(this.div);
+ var eCdiv = $(this.cdiv);
+
+ if (eDiv.style.position == "absolute") {
+ eDiv.style.removeExpression("width");
+ eDiv.style.removeExpression("height");
+
+ eDiv.style.removeExpression("left");
+ eDiv.style.removeExpression("top");
+
+ var eCursorDiv = $(this.cursorDiv);
+ eCursorDiv.style.removeExpression("width");
+ eCursorDiv.style.removeExpression("height");
+
+ eCursorDiv.style.removeExpression("left");
+ eCursorDiv.style.removeExpression("top");
+
+ eCdiv.style.removeExpression("left");
+ eCdiv.style.removeExpression("top");
+ }
+
+ var element = $(this.id);
+ Element.hide(element);
+
+ if (this.parent) {
+ if (this.domReattached) {
+ this._saveInputValues(element);
+
+ this.parent.appendChild(element);
+
+ this.domReattached = false;
+ } else {
+ Element.hide(this.parent);
+ }
+ }
+
+ var event = {};
+ event.parameters = opts || {};
+ if (this.options && this.options.onhide) {
+ this.options.onhide(event);
+ }
+
+ var forms = eCdiv.getElementsByTagName("form");
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ Event.stopObserving(forms[i], "submit", this.formOnsubmit);
+ }
+ }
+
+ this.shown = false;
+
+ if (this.observerSize) {
+ window.clearInterval(this.observerSize);
+ this.observerSize = null;
+ }
+
+ if (ModalPanel.activePanels.length > 0) {
+ ModalPanel.activePanels.last().preventFocus();
+ }
+ }
+ },
+
+ _getStyle: function(elt, name) {
+ return parseInt(elt.style[name].replace("px", ""), 10);
+ },
+
+ doResizeOrMove: function(diff) {
+ var vetoes = {};
+ var cssHash = {};
+ var cssHashWH = {};
+
+ var vetoeChange = false;
+ var newSize;
+
+ var eContentElt = this.getContentElement();
+
+ newSize = this._getStyle(eContentElt, "width");//Richfaces.getComputedStyleSize(eContentDiv, "width");
+
+ var oldSize = newSize;
+ newSize += diff.deltaWidth || 0;
+
+ if (newSize >= this.currentMinWidth || this.options.autosized) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = newSize + 'px';
+ }
+ } else {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.currentMinWidth + 'px';
+
+ vetoes.vx = oldSize - this.currentMinWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (vetoes.vx && diff.deltaX) {
+ diff.deltaX = -vetoes.vx;
+ }
+
+ var eCdiv = $(this.cdiv);
+
+ if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
+ if (vetoes.vx) {
+ diff.deltaX = vetoes.vx;
+ }
+ var newPos;
+
+ newPos = this._getStyle(eCdiv, "left");//Richfaces.getComputedStyleSize(eCdiv, "left");
+ newPos += diff.deltaX;
+ cssHash.left = newPos + 'px';
+ }
+
+ newSize = this._getStyle(eContentElt, "height")//;Richfaces.getComputedStyleSize(eContentDiv, "height");
+
+ var oldSize = newSize;
+ newSize += diff.deltaHeight || 0;
+
+ if (newSize >= this.currentMinHeight || this.options.autosized) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = newSize + 'px';
+ }
+ } else {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMinHeight + 'px';
+
+ vetoes.vy = oldSize - this.currentMinHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (vetoes.vy && diff.deltaY) {
+ diff.deltaY = -vetoes.vy;
+ }
+
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+
+ var newPos;
+ if (eCdiv.mpUseExpr) {
+ newPos = eCdiv.mpTop || 0;
+ newPos += diff.deltaY;
+
+ eCdiv.mpTop = newPos;
+ cssHash.top = newPos + 'px';
+ } else {
+ newPos = this._getStyle(eCdiv, "top");//Richfaces.getComputedStyleSize(eCdiv, "top");
+ newPos += diff.deltaY;
+ cssHash.top = newPos + 'px';
+ }
+ }
+
+ Element.setStyle(eContentElt, cssHashWH);
+
+ Element.setStyle(eCdiv, cssHash);
+
+ this.correctShadowSize();
+
+ Object.extend(this.userOptions, cssHash);
+ Object.extend(this.userOptions, cssHashWH);
+
+ var w = this.width();
+ var h = this.height();
+
+ this.reductionData = null;
+
+ if (w <= 2*ModalPanel.Sizer.INITIAL_MAX) {
+ this.reductionData = {};
+ this.reductionData.w = w;
+ }
+
+ if (h <= 2*ModalPanel.Sizer.INITIAL_MAX) {
+ if (!this.reductionData) {
+ this.reductionData = {};
+ }
+
+ this.reductionData.h = h;
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ return vetoes;
+ },
+
+ _findForm: function(elt) {
+ var target = elt;
+ while (target) {
+ if (!target.tagName /* document node doesn't have tagName */
+ || target.tagName.toLowerCase() != "form") {
+
+ target = target.parentNode;
+ } else {
+ break;
+ }
+ }
+
+ return target;
+ },
+
+ setStateInput: function(e) {
+ var target = Event.element(e);
+ if (e && target) {
+ // Concret input but not entire form is a target element for onsubmit in FF
+ target = this._findForm(target);
+
+ var input = document.createElement("input");
+ input.type = "hidden";
+ input.id = this.markerId.id + "OpenedState";
+ input.name = this.markerId.id + "OpenedState";
+ input.value = this.shown ? "true" : "false";
+ target.appendChild(input);
+
+ var keys = $H(this.userOptions).keys();
+ if (keys) {
+ for (var i = 0; i < keys.length; i++) {
+ input = document.createElement("input");
+ input.type = "hidden";
+ input.id = this.id.id + "StateOption_" + keys[i];
+ input.name = this.id.id + "StateOption_" + keys[i];
+ input.value = this.userOptions[keys[i]];
+ target.appendChild(input);
+
+ }
+ }
+
+ return true;
+ }
+ },
+
+ correctShadowSize: function() {
+ var eShadowDiv = $(this.shadowDiv);
+ if (!eShadowDiv) {
+ return;
+ }
+ var eIframe = $(this.iframe);
+
+ var dx = 0;
+ var dy = 0;
+ if (!Richfaces.browser.isIE)
+ {
+ dx = eShadowDiv.offsetWidth-eShadowDiv.clientWidth;
+ dy = eShadowDiv.offsetHeight-eShadowDiv.clientHeight;
+ }
+ var w = this.width();
+ var h = this.height();
+ eShadowDiv.style.width = (w-dx)+"px";
+ eShadowDiv.style.height = (h-dy)+"px";
+
+ if (eIframe) {
+ eIframe.style.width = w+"px";
+ eIframe.style.height = h+"px";
+ }
+ },
+
+ invokeEvent: function(eventName, event, value, element) {
+
+ var eventFunction = this.options['on'+eventName];
+ var result;
+
+ if (eventFunction) {
+ var eventObj;
+ if (event) {
+ eventObj = event;
+ }
+ else if(document.createEventObject) {
+ eventObj = document.createEventObject();
+ }
+ else if( document.createEvent ) {
+ eventObj = document.createEvent('Events');
+ eventObj.initEvent( eventName, true, false );
+ }
+
+ eventObj.rich = {component:this};
+ eventObj.rich.value = value;
+
+ try {
+ result = eventFunction.call(element, eventObj);
+ }
+ catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
+ }
+
+ if (result!=false) {
+ result = true;
+ }
+ return result;
+ }
+}
+
+Richfaces.findModalPanel = function (id) {
+ if (id) {
+ var prefId = (id.charAt(0) == ':' ? id : ':' + id);
+
+ for (var i = 0; i < ModalPanel.panels.length; i++ ) {
+ var pnl = ModalPanel.panels[i];
+ if (pnl && pnl.markerId) {
+ var pnlId = pnl.markerId.id;
+
+ if (pnlId) {
+ //try to match ids
+ if (pnlId.length >= prefId.length) {
+ var substr = pnlId.substring(pnlId.length - prefId.length, pnlId.length);
+ if (substr == prefId) {
+ return pnl.markerId;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+Richfaces.showModalPanel = function (id, opts, event) {
+
+ var invoke =
+ (Richfaces.browser.isIE || Richfaces.browser.isSafari) ?
+ function(f) {
+ if (document.readyState != "complete") {
+ var args = arguments;
+ var dis = this;
+ window.setTimeout(
+ function() {
+ args.callee.apply(dis,args );
+ }, 50);
+ } else {
+ f();
+ }
+ } :
+ function(f) {
+ f();
+ };
+
+ var panel = $(id);
+ if (!panel) {
+ panel = Richfaces.findModalPanel(id);
+ }
+ invoke(function() {
+ panel.component.show(event, opts);
+ });
+};
+
+Richfaces.hideModalPanel = function (id, opts, event) {
+ var panel = $(id);
+ if (!panel) {
+ panel = Richfaces.findModalPanel(id);
+ }
+ panel.component.hide(event, opts);
+};
+
+/*Richfaces.hideTopModalPanel = function(event, opts) {
+ var mp = ModalPanel.activePanels.last();
+ if (mp) {
+ mp.hide(event, opts);
+ }
+}*/
Added: root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanelBorders.js
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanelBorders.js (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/resources/META-INF/script/popupPanelBorders.js 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,356 @@
+ModalPanel.Border = Class.create();
+
+ModalPanel.Border.prototype = {
+ initialize: function(id, modalPanel, cursor, sizer) {
+ this.id = id;
+ var element = $(id);
+ element.style.cursor = cursor;
+
+ this.boundStartDrag = this.startDrag.bindAsEventListener(this, new Date());
+ Event.observe(this.id, 'mousedown', this.boundStartDrag);
+
+ this.modalPanel = modalPanel;
+ this.sizer = sizer;
+
+ this.boundDoDrag = this.doDrag.bindAsEventListener(this);
+ this.boundEndDrag = this.endDrag.bindAsEventListener(this);
+ },
+
+ destroy: function()
+ {
+ if (this.doingDrag)
+ {
+ Event.stopObserving(document, 'mousemove', this.boundDoDrag);
+ Event.stopObserving(document, 'mouseup', this.boundEndDrag);
+ }
+
+ Event.stopObserving(this.id, 'mousedown', this.boundStartDrag);
+ this.modalPanel=null;
+ },
+
+ show: function() {
+ Element.show(this.id);
+ },
+
+ hide: function() {
+ Element.hide(this.id);
+ },
+
+ startDrag: function(event) {
+ this.doingDrag = true;
+
+ this.dragX = event.clientX;
+ this.dragY = event.clientY;
+
+ Event.observe(document, 'mousemove', this.boundDoDrag);
+ Event.observe(document, 'mouseup', this.boundEndDrag);
+
+ var eCursorDiv = $(this.modalPanel.cursorDiv);
+ eCursorDiv.style.cursor = $(this.id).style.cursor;
+ eCursorDiv.style.zIndex = 10;
+
+ this.modalPanel.startDrag(this);
+
+ this.onselectStartHandler = document.onselectstart;
+ document.onselectstart = function() { return false; }
+ },
+
+ doDrag: function(event) {
+ if (!this.doingDrag) {
+ return ;
+ }
+
+ var evtX = event.clientX;
+ var evtY = event.clientY;
+
+ var winSize = Richfaces.getWindowSize();
+
+ //window.status = "" + evtX + " " + evtY;
+
+ if (evtX < 0) {
+ evtX = 0;
+ } else if (evtX >= winSize.width) {
+ evtX = winSize.width - 1;
+ }
+
+ if (evtY < 0) {
+ evtY = 0;
+ } else if (evtY >= winSize.height) {
+ evtY = winSize.height - 1;
+ }
+
+ var dx = evtX - this.dragX;
+ var dy = evtY - this.dragY;
+
+ if (dx != 0 || dy != 0) {
+
+ var id = this.id;
+
+ var diff = this.sizer.doDiff(dx, dy);
+ var doResize;
+
+ var element = $(this.modalPanel.cdiv);
+
+ if (diff.deltaWidth || diff.deltaHeight) {
+ doResize = this.modalPanel.invokeEvent("resize",event,null,element);
+ } else if (diff.deltaX || diff.deltaY) {
+ doResize = this.modalPanel.invokeEvent("move",event,null,element);
+ }
+
+ var vetoes;
+
+ if (doResize) {
+ vetoes = this.modalPanel.doResizeOrMove(diff);
+ }
+
+ if(vetoes){
+ if (!vetoes.x) {
+ this.dragX = evtX;
+ } else {
+ if (!diff.deltaX) {
+ this.dragX -= vetoes.vx || 0;
+ } else {
+ this.dragX += vetoes.vx || 0;
+ }
+ }
+
+ if (!vetoes.y) {
+ this.dragY = evtY;
+ } else {
+ if (!diff.deltaY) {
+ this.dragY -= vetoes.vy || 0;
+ } else {
+ this.dragY += vetoes.vy || 0;
+ }
+ }
+ }
+ }
+ },
+
+ endDrag: function(event) {
+ this.doingDrag = undefined;
+
+ Event.stopObserving(document, 'mousemove', this.boundDoDrag);
+ Event.stopObserving(document, 'mouseup', this.boundEndDrag);
+
+ this.modalPanel.endDrag(this);
+
+ this.modalPanel.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
+ $(this.modalPanel.cursorDiv).style.zIndex = -200;
+
+ document.onselectstart = this.onselectStartHandler;
+ this.onselectStartHandler = null;
+
+ var id = this.id;
+ },
+
+ doPosition: function() {
+ this.sizer.doPosition(this.modalPanel, $(this.id));
+ }
+};
+
+ModalPanel.Sizer = Class.create();
+
+ModalPanel.Sizer.INITIAL_MIN = 4;
+ModalPanel.Sizer.INITIAL_MAX = 40;
+
+ModalPanel.Sizer.Diff = Class.create();
+ModalPanel.Sizer.Diff.prototype = {
+ initialize: function(dX, dY, dWidth, dHeight) {
+ this.deltaX = dX;
+ this.deltaY = dY;
+
+ this.deltaWidth = dWidth;
+ this.deltaHeight = dHeight;
+ }
+}
+
+ModalPanel.Sizer.Diff.EMPTY = new ModalPanel.Sizer.Diff(0, 0, 0, 0);
+
+ModalPanel.Sizer.prototype = {
+ initialize: function() {
+
+ },
+
+ doSetupSize: function (modalPanel, elt) {
+ var width = 0;
+ var height = 0;
+
+ var reductionData = modalPanel.reductionData;
+
+ if (reductionData) {
+ if (reductionData.w) {
+ width = reductionData.w / 2;
+ }
+
+ if (reductionData.h) {
+ height = reductionData.h / 2;
+ }
+ }
+
+ if (width > 0) {
+ if (elt.clientWidth > width) {
+ if (!elt.reducedWidth) {
+ elt.reducedWidth = elt.style.width;
+ }
+ elt.style.width = width + 'px';
+ } else if (width < ModalPanel.Sizer.INITIAL_MAX && /* TODO fix the dirty code */elt.reducedWidth == ModalPanel.Sizer.INITIAL_MAX + 'px') {
+ elt.style.width = width + 'px';
+ }
+ } else {
+ if (elt.reducedWidth) {
+ elt.style.width = elt.reducedWidth;
+ elt.reducedWidth = undefined;
+ }
+ }
+
+ if (height > 0) {
+ if (elt.clientHeight > height) {
+ if (!elt.reducedHeight) {
+ elt.reducedHeight = elt.style.height;
+ }
+ elt.style.height = height + 'px';
+ } else if (height < ModalPanel.Sizer.INITIAL_MAX && /* TODO fix the dirty code */elt.reducedHeight == ModalPanel.Sizer.INITIAL_MAX + 'px') {
+ elt.style.height = height + 'px';
+ }
+ } else {
+ if (elt.reducedHeight) {
+ elt.style.height = elt.reducedHeight;
+ elt.reducedHeight = undefined;
+ }
+ }
+ },
+
+ doSetupPosition: function (modalPanel, elt, left, top) {
+ elt.style.left = left + 'px';
+ elt.style.top = top + 'px';
+ },
+
+ doPosition: function (modalPanel, elt) {
+
+ },
+
+ doDiff: function (dx, dy) {
+
+ }
+}
+
+ModalPanel.Sizer.NWU = Object.extend(new ModalPanel.Sizer(), {
+ doPosition: function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, 0, 0);
+ },
+
+ doDiff: function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(dx, dy, -dx, -dy);
+ }
+});
+
+ModalPanel.Sizer.N = new ModalPanel.Sizer();
+ModalPanel.Sizer.N.doPosition = function (modalPanel, elt) {
+ elt.style.width = modalPanel.width() + 'px';
+ this.doSetupPosition(modalPanel, elt, 0, 0);
+};
+ModalPanel.Sizer.N.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, dy, 0, -dy);
+};
+
+ModalPanel.Sizer.NEU = new ModalPanel.Sizer();
+ModalPanel.Sizer.NEU.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, modalPanel.width() - elt.clientWidth, 0);
+};
+ModalPanel.Sizer.NEU.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, dy, dx, -dy);
+};
+
+ModalPanel.Sizer.NEL = new ModalPanel.Sizer();
+ModalPanel.Sizer.NEL.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, modalPanel.width() - elt.clientWidth, 0);
+};
+ModalPanel.Sizer.NEL.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, dy, dx, -dy);
+};
+
+ModalPanel.Sizer.E = new ModalPanel.Sizer();
+ModalPanel.Sizer.E.doPosition = function (modalPanel, elt) {
+ elt.style.height = modalPanel.height() + 'px';
+ this.doSetupPosition(modalPanel, elt, modalPanel.width() - elt.clientWidth, 0);
+};
+ModalPanel.Sizer.E.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, 0, dx, 0);
+};
+
+ModalPanel.Sizer.SEU = new ModalPanel.Sizer();
+ModalPanel.Sizer.SEU.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, modalPanel.width() - elt.clientWidth,
+ modalPanel.height() - elt.clientHeight);
+};
+ModalPanel.Sizer.SEU.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, 0, dx, dy);
+};
+
+ModalPanel.Sizer.SEL = new ModalPanel.Sizer();
+ModalPanel.Sizer.SEL.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, modalPanel.width() - elt.clientWidth,
+ modalPanel.height() - elt.clientHeight);
+};
+ModalPanel.Sizer.SEL.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, 0, dx, dy);
+};
+
+ModalPanel.Sizer.S = new ModalPanel.Sizer();
+ModalPanel.Sizer.S.doPosition = function (modalPanel, elt) {
+ elt.style.width = modalPanel.width() + 'px';
+ this.doSetupPosition(modalPanel, elt, 0, modalPanel.height() - elt.clientHeight);
+};
+ModalPanel.Sizer.S.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(0, 0, 0, dy);
+};
+
+ModalPanel.Sizer.SWL = new ModalPanel.Sizer();
+ModalPanel.Sizer.SWL.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, 0, modalPanel.height() - elt.clientHeight);
+};
+ModalPanel.Sizer.SWL.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(dx, 0, -dx, dy);
+};
+
+ModalPanel.Sizer.SWU = new ModalPanel.Sizer();
+ModalPanel.Sizer.SWU.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, 0, modalPanel.height() - elt.clientHeight);
+};
+ModalPanel.Sizer.SWU.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(dx, 0, -dx, dy);
+};
+
+ModalPanel.Sizer.W = new ModalPanel.Sizer();
+ModalPanel.Sizer.W.doPosition = function (modalPanel, elt) {
+ elt.style.height = modalPanel.height() + 'px';
+ this.doSetupPosition(modalPanel, elt, 0, 0);
+};
+ModalPanel.Sizer.W.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(dx, 0, -dx, 0);
+};
+
+ModalPanel.Sizer.NWL = new ModalPanel.Sizer();
+ModalPanel.Sizer.NWL.doPosition = function (modalPanel, elt) {
+ this.doSetupSize(modalPanel, elt);
+ this.doSetupPosition(modalPanel, elt, 0, 0);
+};
+ModalPanel.Sizer.NWL.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(dx, dy, -dx, -dy);
+};
+
+ModalPanel.Header = new ModalPanel.Sizer();
+ModalPanel.Header.doPosition = function (modalPanel, elt) {
+
+};
+ModalPanel.Header.doDiff = function(dx, dy) {
+ return new ModalPanel.Sizer.Diff(dx, dy, 0, 0);
+};
Added: root/ui-sandbox/panels2/trunk/ui/src/main/templates/panel.template.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/templates/panel.template.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/templates/panel.template.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el"
+ xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:c="http://richfaces.org/cdk/jstl/core"
+ xmlns:cc="http://richfaces.org/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.PanelRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.html.PanelBaseRenderer</cdk:superclass>
+ <cdk:component-family>org.richfaces.Panel</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.PanelRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <div cdk:passThruWithExclusions="id,value,styleClass,class" id="#{clientId}" class="rf-panel #{component.attributes['styleClass']}">
+ <c:choose>
+ <c:when test="#{component.getFacet('header') != null and component.getFacet('header').rendered}">
+ <div id="#{clientId}_header" class="rf-panel-header #{component.attributes['headerClass']}">
+ <!-- <cc:renderFacet name="header" />-->
+ <cdk:call expression="renderHeaderFacet(facesContext, component)" />
+ </div>
+ </c:when>
+ <c:when test="#{component.attributes['header']!= null and not component.attributes['header'].equals('')}">
+ <div id="#{clientId}_header" class="rf-panel-header #{component.attributes['headerClass']}">
+ #{component.attributes['header']}
+ </div>
+ </c:when>
+ <c:otherwise>
+ </c:otherwise>
+ </c:choose>
+ <div id="#{clientId}_body" class="rf-panel-body #{component.attributes['bodyClass']}">
+ <cdk:call expression="renderChildren(facesContext, component)" />
+ </div>
+ </div>
+
+ </cc:implementation>
+</cdk:root>
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/main/templates/popupPanel.template.xml (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/main/templates/popupPanel.template.xml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el"
+ xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:c="http://richfaces.org/cdk/jstl/core"
+ xmlns:cc="http://richfaces.org/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.PopupPanelRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.html.PopupPanelBaseRenderer</cdk:superclass>
+ <cdk:component-family>org.richfaces.PopupPanel</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.PopupPanelRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <cdk:call expression="checkOptions(facesContext, component)" />
+ <input autocomplete="off" type="hidden" id="#{clientId}OpenedState" name="#{clientId}OpenedState" />
+ <c:if test="#{component.attributes['modal']}">
+ <div onclick="#{component.attributes['onmaskclick']}"
+ ondblclick="#{component.attributes['onmaskdblclick']}"
+ oncontextmenu="#{component.attributes['onmaskcontextmenu']}"
+ onmouseup="#{component.attributes['onmaskmouseup']}"
+ onmousedown="#{component.attributes['onmaskmousedown']}"
+ onmousemove="#{component.attributes['onmaskmousemove']}"
+ onmouseover="#{component.attributes['onmaskmouseover']}"
+ onmouseout="#{component.attributes['onmaskmouseout']}" class="mp_shade"/>
+
+</c:if>
+<cdk:object type="java.lang.String" name="shadowStyle" value="#{getShadowStyle(facesContext,component)}" />
+ <button class="rich-mpnl-button" id="#{clientId}FirstHref"></button>
+ <img style="#{shadowStyle}" width="0" height="0" class="mp_shadow"/>
+ <div id="#{clientId}_container" cdk:passThruWithExclusions="id,style,class,styleClass" class="mp_container #{component.attributes['styleClass']}">
+ <div id="#{clientId}_header" class="mp_header #{component.attributes['headerClass']}" >
+ <c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
+ <div id="#{clientId}_header_content" class="mp_header_content">
+ <cdk:call expression="renderHeaderFacet(facesContext, component)"/>
+ </div>
+ </c:if>
+ <c:else>
+ <div id="#{clientId}_header_content" class="mp_header_content">
+ <div id="#{clientId}_header_icon" class="mp_header_icon"></div>Modal panel header name
+ </div>
+ </c:else>
+ <c:if test="#{component.getFacet('controls')!=null and component.getFacet('controls').rendered}">
+ <div id="#{clientId}_header_controls" class="mp_header_controls #{component.attributes['controlsClass']}">
+ <cdk:call expression="renderControlsFacet(facesContext, component)"/>
+ </div>
+ </c:if>
+ </div>
+ <div id="#{clientId}_content_scroller" class="mp_content_scroller #{component.attributes['scrollerClass']}">
+ <div id="#{clientId}_content" class="mp_content" style="#{component.attributes['style']}">
+ <cdk:call expression="renderChildren(facesContext, component)"/>
+ </div>
+ </div>
+ <c:if test="#{component.attributes['resizeable']}">
+ <div id="#{clientId}_handler_left" class="mp_handler mp_handler_left"></div>
+ <div id="#{clientId}_handler_right" class="mp_handler mp_handler_right"></div>
+ <div id="#{clientId}_handler_top" class="mp_handler mp_handler_top"></div>
+
+ <div id="#{clientId}_handler_bottom" class="mp_handler mp_handler_bottom"></div>
+ <div id="#{clientId}_handler_top_left" class="mp_handler mp_handler_top_left"></div>
+ <div id="#{clientId}_handler_top_right" class="mp_handler mp_handler_top_right"></div>
+ <div id="#{clientId}_handler_bottom_left" class="mp_handler mp_handler_bottom_left"></div>
+ <div id="#{clientId}_handler_bottom_right" class="mp_handler mp_handler_bottom_right"></div>
+ </c:if>
+ <button class="rich-mpnl-button" id="#{clientId}LastHref"></button>
+ </div>
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(facesContext, component)"/>
+ </script>
+ <script type="text/javascript">
+ <cdk:call expression="buildShowScript(facesContext, component);"/>
+ </script>
+
+
+
+
+
+
+ </cc:implementation>
+</cdk:root>
\ No newline at end of file
Added: root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,157 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.faces.application.ViewHandler;
+import javax.faces.context.FacesContext;
+import javax.faces.view.ViewDeclarationLanguage;
+
+import org.jboss.test.faces.FacesEnvironment.FacesRequest;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.component.UIPanel;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * @author Andrey Markhel
+ *
+ */
+public class PanelRendererTest {
+
+ private HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new File("src/test/resources"));
+ environment.start();
+ }
+
+ @After
+ public void tearDown() {
+ environment.release();
+ environment = null;
+ }
+
+ private FacesRequest startFacesRequest() throws IOException {
+ FacesRequest facesRequest = environment.createFacesRequest("http://localhost/panelTest.jsf");
+ facesRequest.withViewId("/panelTest.jsf");
+ facesRequest.start();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ViewHandler vh = facesContext.getApplication().getViewHandler();
+ ViewDeclarationLanguage vdl = vh.getViewDeclarationLanguage(facesContext, facesContext.getViewRoot()
+ .getViewId());
+ vdl.buildView(facesContext, facesContext.getViewRoot());
+ return facesRequest;
+ }
+ /**
+ * Test method for {@link org.richfaces.renderkit.ExtendedDataTableRenderer#getComponentClass()}.
+ *
+ * @throws IOException
+ */
+ @Test
+ public final void testGetComponentClass() throws IOException {
+ FacesRequest facesRequest = startFacesRequest();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ UIPanel component = (UIPanel) facesContext.getViewRoot().findComponent("panelWithFacet");
+ PanelRenderer renderer = (PanelRenderer) FacesContext.getCurrentInstance()
+ .getRenderKit().getRenderer(component.getFamily(), component.getRendererType());
+ assertEquals(UIPanel.class, renderer.getComponentClass());
+ facesRequest.release();
+ }
+
+ /**
+ * Test method for
+ * {@link org.richfaces.renderkit.ExtendedDataTableRenderer#doEncodeBegin(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)}.
+ *
+ * @throws IOException
+ */
+ /*@Test
+ public final void testDoEncode() throws IOException {
+ HtmlPage page = environment.getPage("/panelTest.jsf");
+ HtmlElement panelWithFacet = page.getElementById("panelWithFacet");
+ assertEquals("rf-panel panel", panelWithFacet.getAttribute("class"));
+ assertEquals("Write your own custom rich components with built-in AJAX support", panelWithFacet.getElementById("panelWithFacet_header").getTextContent().trim());
+ assertEquals("The CDK includes", panelWithFacet.getElementById("panelWithFacet_body")
+ .getTextContent().trim().substring(0, 16));
+ HtmlElement simplePanel = page.getElementById("simplePanel");
+ assertEquals("rf-panel ", simplePanel.getAttribute("class"));
+ try{
+ simplePanel.getElementById("simplePanel_header");
+ }catch(Exception e){
+ assertTrue(true);
+ }
+ assertEquals("RichFaces is a l", simplePanel
+ .getElementById("simplePanel_body")
+ .getTextContent().trim().substring(0, 16));
+ HtmlElement simplePanelBody = page.getElementById("simplePanel_body");
+ assertEquals("rf-panel-body rich-laguna-panel-no-header", simplePanelBody.getAttribute("class"));
+ HtmlElement simplePanel2 = page.getElementById("simplePanelWithTextHeader");
+ assertEquals("rf-panel ", simplePanel2.getAttribute("class"));
+ assertNotNull(simplePanel2.getElementById("simplePanelWithTextHeader_header"));
+ assertEquals("rich-laguna-panel-no-header", simplePanel2.getElementById("simplePanelWithTextHeader_header").getTextContent().trim());
+ assertEquals("RichFaces is a l", simplePanel2
+ .getElementById("simplePanelWithTextHeader_body")
+ .getTextContent().trim().substring(0, 16));
+
+ HtmlElement nestedPanelContainer = page.getElementById("nestedPanelContainer");
+ assertEquals("rf-panel ", nestedPanelContainer.getAttribute("class"));
+ assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
+ assertEquals("||||", nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
+ HtmlElement nestedPanelContainerHeader = page.getElementById("nestedPanelContainer_header");
+ assertEquals("rf-panel-header outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
+ assertEquals("Benefits of Usin", nestedPanelContainer
+ .getElementById("nestedPanelContainer_body")
+ .getTextContent().trim().substring(0, 16));
+ HtmlElement nestedPanel1 = nestedPanelContainer.getElementById("nestedPanel1");
+ assertEquals("rf-panel ", nestedPanel1.getAttribute("class"));
+ HtmlElement nestedPanel1Body = page.getElementById("nestedPanel1_body");
+ assertEquals("rf-panel-body inpanelBody", nestedPanel1Body.getAttribute("class"));
+ assertNotNull(nestedPanel1.getElementById("nestedPanel1_header"));
+ assertEquals("For Application Developers", nestedPanel1.getElementById("nestedPanel1_header").getTextContent().trim());
+ assertEquals("Production quali", nestedPanel1
+ .getElementById("nestedPanel1_body")
+ .getTextContent().trim().substring(0, 16));
+ HtmlElement nestedPanel2 = nestedPanelContainer.getElementById("nestedPanel2");
+ assertEquals("rf-panel ", nestedPanel2.getAttribute("class"));
+ HtmlElement nestedPanel2Body = page.getElementById("nestedPanel2_body");
+ assertEquals("rf-panel-body inpanelBody", nestedPanel2Body.getAttribute("class"));
+ assertNotNull(nestedPanel2.getElementById("nestedPanel2_header"));
+ assertEquals("For Component Developers", nestedPanel2.getElementById("nestedPanel2_header").getTextContent().trim());
+ assertEquals("Ajax4jsf is Open", nestedPanel2
+ .getElementById("nestedPanel2_body")
+ .getTextContent().trim().substring(0, 16));
+ }*/
+
+}
Added: root/ui-sandbox/panels2/trunk/ui/src/test/resources/panelTest.xhtml
===================================================================
--- root/ui-sandbox/panels2/trunk/ui/src/test/resources/panelTest.xhtml (rev 0)
+++ root/ui-sandbox/panels2/trunk/ui/src/test/resources/panelTest.xhtml 2010-07-08 09:45:35 UTC (rev 17769)
@@ -0,0 +1,98 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:panel="http://richfaces.org/panels"
+ xmlns:rich="http://richfaces.org/rich">
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, 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.
+-->
+ <h:head>
+ <title>Richfaces ExtendedDataTable Test</title>
+ </h:head>
+
+ <h:body>
+ <panel:panel styleClass="panel" id="panelWithFacet">
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX support
+ </f:facet>
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These capabilities help
+ to avoid a routine process of a component creation. The component factory
+ works like a well-oiled machine allowing the creation of first-class
+ rich components with built-in Ajax functionality even more easily than
+ the creation of simpler components by means of the traditional coding
+ approach.
+ </panel:panel>
+ <panel:panel id="simplePanel" bodyClass="rich-laguna-panel-no-header">
+ RichFaces is a library for adding rich user interface features to JSF
+ applications. It extends the Ajax4jsf framework to include a large
+ (and growing) set of powerful rich AJAX-enabled components that come
+ with extensive skins support.
+ </panel:panel>
+ <panel:panel id="simplePanelWithTextHeader" header="rich-laguna-panel-no-header">
+ RichFaces is a library for adding rich user interface features to JSF
+ applications. It extends the Ajax4jsf framework to include a large
+ (and growing) set of powerful rich AJAX-enabled components that come
+ with extensive skins support.
+ </panel:panel>
+ <panel:panel id="nestedPanelContainer" style="padding:0" headerClass="outpanelHeader">
+ <f:facet name="header">
+ ||||
+ </f:facet>
+ <h2 align="center"><h:outputText value="Benefits of Using Ajax4jsf" /></h2>
+ <h:panelGrid columns="2" columnClasses="gridContent">
+ <panel:panel id="nestedPanel1" bodyClass="inpanelBody">
+ <f:facet name="header">
+ For Application Developers
+ </f:facet>
+ <ul>
+ <li>Production quality Open Source</li>
+ <li>Does Open Source and has an Open Architecture</li>
+ <li>Compatible with any JSF Implementation - MyFaces, JSF1.1, JSF1.2</li>
+ <li>Allows to Ajaxify JSF application without writing Javascript</li>
+ <li>Works with standard and third party components</li>
+ <li>Adds the Ajax capability to existing non-Ajax components</li>
+ </ul>
+ </panel:panel>
+ <panel:panel id="nestedPanel2" bodyClass="inpanelBody">
+ <f:facet name="header" >
+ For Component Developers
+ </f:facet>
+ <ul>
+ <li>Ajax4jsf is Open Source and has an Open Architecture</li>
+ <li>Gives an API to create components with built-in Ajax support</li>
+ <li>Has a Component Development Kit for rapid development</li>
+ <li>Allows to skin the look-n-feel using both CSS and set of skin-parameters</li>
+ <li>Automatically generates the unit test-cases for developing components</li>
+ <li>Allows to pack javascript code, images, css inside the final jar</li>
+ </ul>
+ </panel:panel>
+ </h:panelGrid>
+ </panel:panel>
+ </h:body>
+</html>
13 years, 10 months
JBoss Rich Faces SVN: r17767 - in root/cdk/branches/RF8755/plugins/generator/src/main: resources/META-INF/templates/java and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-07 19:41:01 -0400 (Wed, 07 Jul 2010)
New Revision: 17767
Modified:
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/AttributesStatement.java
root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetStatement.java
root/cdk/branches/RF8755/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl
Log:
https://jira.jboss.org/browse/RF-8306
Modified: root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/AttributesStatement.java
===================================================================
--- root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/AttributesStatement.java 2010-07-07 22:30:23 UTC (rev 17766)
+++ root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/AttributesStatement.java 2010-07-07 23:41:01 UTC (rev 17767)
@@ -36,7 +36,7 @@
*/
public class AttributesStatement extends StatementsContainer {
- private static final Splitter PASS_THGOUGH_SPLITTER = Splitter.on(Pattern.compile("\\s*,\\s*"));
+ private static final Splitter PASS_THGOUGH_SPLITTER = Splitter.on(Pattern.compile("\\s+,?\\s*"));
private final Schema attributesSchema;
private final Provider<WriteAttributeStatement> statementProvider;
Modified: root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetStatement.java
===================================================================
--- root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetStatement.java 2010-07-07 22:30:23 UTC (rev 17766)
+++ root/cdk/branches/RF8755/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/WriteAttributesSetStatement.java 2010-07-07 23:41:01 UTC (rev 17767)
@@ -46,6 +46,14 @@
String type;
Object defaultValue;
Set<String> behaviors = Sets.newHashSet();
+
+ public String getBuilderMethod() {
+ if(Kind.BOOLEAN.equals(kind)){
+ return "bool";
+ } else {
+ return kind.toString().toLowerCase();
+ }
+ }
@Override
public int compareTo(PassThrough o) {
@@ -60,24 +68,41 @@
private static AtomicInteger fieldCounter = new AtomicInteger(0);
- private String passThroughFieldName;
+ private String fieldName;
+ private TreeSet<PassThrough> attributes;
+
@Inject
public WriteAttributesSetStatement(@TemplateModel FreeMarkerRenderer renderer) {
super(renderer, "write-attributes-set");
- passThroughFieldName = PASS_THROUGH_ATTRIBUTES_FIELD_NAME + fieldCounter.getAndIncrement();
+ fieldName = PASS_THROUGH_ATTRIBUTES_FIELD_NAME + fieldCounter.getAndIncrement();
}
/**
- * @return the passThroughFieldName
+ * @return the fieldName
*/
- public String getPassThroughFieldName() {
- return passThroughFieldName;
+ public String getFieldName() {
+ return fieldName;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param fieldName the fieldName to set
+ */
+ public void setFieldName(String fieldName) {
+ this.fieldName = fieldName;
+ }
+
public void setAttributes(TreeSet<PassThrough> passThroughAttributes) {
- // TODO Auto-generated method stub
-
+ this.attributes = passThroughAttributes;
}
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the attributes
+ */
+ public TreeSet<PassThrough> getAttributes() {
+ return this.attributes;
+ }
+
}
Modified: root/cdk/branches/RF8755/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl
===================================================================
--- root/cdk/branches/RF8755/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl 2010-07-07 22:30:23 UTC (rev 17766)
+++ root/cdk/branches/RF8755/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl 2010-07-07 23:41:01 UTC (rev 17767)
@@ -1,2 +1,6 @@
-RenderKitUtils.renderPassThroughAttributes(${facesContextVariable}, ${componentVariable},
- ${modelItem.passThroughFieldName});
\ No newline at end of file
+<@util.constant "Attributes" "${fieldName}"><#list attributes as attribute>
+ .{attribute.builderMethod}(${attribute.name},${attribute.componentAttribute}<#list attribute.behaviors as behavior>,${behavior}</#list>)
+</#list></(a)util.constant>
+<@util.require "RENDER_ATTRIBUTES_SET"/>
+renderPassThroughAttributes(${facesContextVariable}, ${componentVariable},
+ ${fieldName});
\ No newline at end of file
13 years, 10 months
JBoss Rich Faces SVN: r17766 - in root: docs/trunk/Component_Reference and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-07 18:30:23 -0400 (Wed, 07 Jul 2010)
New Revision: 17766
Modified:
root/build/parent/trunk/pom.xml
root/docs/trunk/Component_Reference/pom.xml
root/docs/trunk/Developer_Guide/pom.xml
root/docs/trunk/Migration_Guide/pom.xml
Log:
fix documentation build
Modified: root/build/parent/trunk/pom.xml
===================================================================
--- root/build/parent/trunk/pom.xml 2010-07-07 20:16:14 UTC (rev 17765)
+++ root/build/parent/trunk/pom.xml 2010-07-07 22:30:23 UTC (rev 17766)
@@ -245,7 +245,7 @@
<artifactId>maven-jstools-plugin</artifactId>
<version>0.7</version>
<configuration>
- <jsDir>${basedir}/src/main/resources/Meta-inf/resources
+ <jsDir>${project.basedir}/src/main/resources/META-INF/resources
</jsDir>
<includes>**/*.js</includes>
<caseSensitive>true</caseSensitive>
@@ -264,7 +264,7 @@
<dependencies>
<dependency>
<groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-xslt</artifactId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
Modified: root/docs/trunk/Component_Reference/pom.xml
===================================================================
--- root/docs/trunk/Component_Reference/pom.xml 2010-07-07 20:16:14 UTC (rev 17765)
+++ root/docs/trunk/Component_Reference/pom.xml 2010-07-07 22:30:23 UTC (rev 17766)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>7</version>
+ <version>8-SNAPSHOT</version>
</parent>
<properties>
@@ -78,7 +78,6 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
-
<executions>
<execution>
<phase>process-resources</phase>
Modified: root/docs/trunk/Developer_Guide/pom.xml
===================================================================
--- root/docs/trunk/Developer_Guide/pom.xml 2010-07-07 20:16:14 UTC (rev 17765)
+++ root/docs/trunk/Developer_Guide/pom.xml 2010-07-07 22:30:23 UTC (rev 17766)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>7</version>
+ <version>8-SNAPSHOT</version>
</parent>
<properties>
Modified: root/docs/trunk/Migration_Guide/pom.xml
===================================================================
--- root/docs/trunk/Migration_Guide/pom.xml 2010-07-07 20:16:14 UTC (rev 17765)
+++ root/docs/trunk/Migration_Guide/pom.xml 2010-07-07 22:30:23 UTC (rev 17766)
@@ -12,7 +12,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-parent</artifactId>
- <version>7</version>
+ <version>8-SNAPSHOT</version>
</parent>
<properties>
13 years, 10 months