projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use new template engine.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
notify
/
ListNotification.java
diff --git
a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java
b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java
index
64c2ecb
..
c7e5b7c
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/notify/ListNotification.java
+++ b/
src/main/java/net/pterodactylus/sone/notify/ListNotification.java
@@
-48,7
+48,7
@@
public class ListNotification<T> extends TemplateNotification {
*/
public ListNotification(String id, String key, Template template) {
super(id, template);
*/
public ListNotification(String id, String key, Template template) {
super(id, template);
- template.set(key, elements);
+ template.
getInitialContext().
set(key, elements);
}
//
}
//
@@
-56,6
+56,15
@@
public class ListNotification<T> extends TemplateNotification {
//
/**
//
/**
+ * Returns the current list of elements.
+ *
+ * @return The current list of elements
+ */
+ public List<T> getElements() {
+ return new ArrayList<T>(elements);
+ }
+
+ /**
* Returns whether there are any new elements.
*
* @return {@code true} if there are no new elements, {@code false} if there
* Returns whether there are any new elements.
*
* @return {@code true} if there are no new elements, {@code false} if there
@@
-84,6
+93,9
@@
public class ListNotification<T> extends TemplateNotification {
*/
public void remove(T element) {
elements.remove(element);
*/
public void remove(T element) {
elements.remove(element);
+ if (elements.isEmpty()) {
+ dismiss();
+ }
touch();
}
touch();
}