From 9e2a51094897eedac12d5b24570a3bdd1795ae01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 7 Apr 2011 21:38:44 +0200 Subject: [PATCH] Add constructor to allow to specify the dismissable flag. --- .../pterodactylus/sone/notify/ListNotification.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java index 5f7c1eb..0383648 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java @@ -51,7 +51,24 @@ public class ListNotification extends TemplateNotification { * The template to render */ public ListNotification(String id, String key, Template template) { - super(id, template); + this(id, key, template, true); + } + + /** + * Creates a new list notification. + * + * @param id + * The ID of the notification + * @param key + * The key under which to store the elements in the template + * @param template + * The template to render + * @param dismissable + * {@code true} if this notification should be dismissable by the + * user, {@code false} otherwise + */ + public ListNotification(String id, String key, Template template, boolean dismissable) { + super(id, System.currentTimeMillis(), System.currentTimeMillis(), dismissable, template); this.key = key; template.getInitialContext().set(key, elements); } -- 2.7.4