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