You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ka...@apache.org on 2012/09/03 16:59:33 UTC
[2/2] git commit: Added Severity.SUCCESS for alerts
Added Severity.SUCCESS for alerts
Signed-off-by: Kalle Korhonen <ka...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6e3de5d4
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6e3de5d4
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6e3de5d4
Branch: refs/heads/5.3
Commit: 6e3de5d4b7f3701fcd16667f796e9d360c555b65
Parents: e08ac9e
Author: dmitrygusev <dm...@gmail.com>
Authored: Sun Sep 2 00:39:54 2012 +0400
Committer: Kalle Korhonen <ka...@apache.org>
Committed: Sun Sep 2 09:05:39 2012 -0700
----------------------------------------------------------------------
.../org/apache/tapestry5/alerts/AlertManager.java | 7 +++++++
.../java/org/apache/tapestry5/alerts/Severity.java | 2 +-
.../internal/alerts/AlertManagerImpl.java | 5 +++++
.../resources/org/apache/tapestry5/silk/accept.png | Bin 0 -> 781 bytes
.../resources/org/apache/tapestry5/t5-alerts.css | 12 +++++++++++-
5 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e3de5d4/tapestry-core/src/main/java/org/apache/tapestry5/alerts/AlertManager.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/alerts/AlertManager.java b/tapestry-core/src/main/java/org/apache/tapestry5/alerts/AlertManager.java
index 2888c0a..2c22039 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/alerts/AlertManager.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/alerts/AlertManager.java
@@ -22,6 +22,13 @@ package org.apache.tapestry5.alerts;
*/
public interface AlertManager
{
+ /**
+ * Adds an {@link Severity#SUCCESS} alert with the default duration, {@link Duration#SINGLE}.
+ *
+ * @param message to present to the user
+ */
+ void success(String message);
+
/**
* Adds an {@link Severity#INFO} alert with the default duration, {@link Duration#SINGLE}.
*
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e3de5d4/tapestry-core/src/main/java/org/apache/tapestry5/alerts/Severity.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/alerts/Severity.java b/tapestry-core/src/main/java/org/apache/tapestry5/alerts/Severity.java
index 82d98cb..524a9f8 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/alerts/Severity.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/alerts/Severity.java
@@ -19,7 +19,7 @@ package org.apache.tapestry5.alerts;
*/
public enum Severity
{
- INFO, WARN, ERROR;
+ SUCCESS, INFO, WARN, ERROR;
/**
* The CSS class to be used for the client list element.
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e3de5d4/tapestry-core/src/main/java/org/apache/tapestry5/internal/alerts/AlertManagerImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/alerts/AlertManagerImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/alerts/AlertManagerImpl.java
index 3c1acce..56ea534 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/alerts/AlertManagerImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/alerts/AlertManagerImpl.java
@@ -42,6 +42,11 @@ public class AlertManagerImpl implements AlertManager
needAlertStorageCleanup = perThreadManager.createValue();
}
+ public void success(String message)
+ {
+ alert(Duration.SINGLE, Severity.SUCCESS, message);
+ }
+
public void info(String message)
{
alert(Duration.SINGLE, Severity.INFO, message);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e3de5d4/tapestry-core/src/main/resources/org/apache/tapestry5/silk/accept.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/silk/accept.png b/tapestry-core/src/main/resources/org/apache/tapestry5/silk/accept.png
new file mode 100644
index 0000000..89c8129
Binary files /dev/null and b/tapestry-core/src/main/resources/org/apache/tapestry5/silk/accept.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6e3de5d4/tapestry-core/src/main/resources/org/apache/tapestry5/t5-alerts.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/t5-alerts.css b/tapestry-core/src/main/resources/org/apache/tapestry5/t5-alerts.css
index 50c3b54..b8ae6b0 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/t5-alerts.css
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/t5-alerts.css
@@ -40,7 +40,17 @@ DIV.t-alert-container DIV.t-warn {
}
DIV.t-alert-container DIV.t-info {
- background: green url("silk/information.png") no-repeat;
+ background: #08f url("silk/information.png") no-repeat;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ margin-bottom: 5px;
+ padding-left: 22px;
+ color: white;
+}
+
+DIV.t-alert-container DIV.t-success {
+ background: green url("silk/accept.png") no-repeat;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;