/** The “new reply” notification. */
private final ListNotification<Reply> newReplyNotification;
+ /** The “rescuing Sone” notification. */
+ private final ListNotification<Sone> rescuingSonesNotification;
+
+ /** The “Sone rescued” notification. */
+ private final ListNotification<Sone> sonesRescuedNotification;
+
/**
* Creates a new web interface.
*
Template newReplyNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newReplyNotification.html"));
newReplyNotification = new ListNotification<Reply>("new-replies-notification", "replies", newReplyNotificationTemplate);
+
+ Template rescuingSonesTemplate = templateFactory.createTemplate(createReader("/templates/notify/rescuingSonesNotification.html"));
+ rescuingSonesNotification = new ListNotification<Sone>("sones-being-rescued-notification", "sones", rescuingSonesTemplate);
+
+ Template sonesRescuedTemplate = templateFactory.createTemplate(createReader("/templates/notify/sonesRescuedNotification.html"));
+ sonesRescuedNotification = new ListNotification<Sone>("sones-rescued-notification", "sones", sonesRescuedTemplate);
}
//
* {@inheritDoc}
*/
@Override
+ public void rescuingSone(Sone sone) {
+ rescuingSonesNotification.add(sone);
+ notificationManager.addNotification(rescuingSonesNotification);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void rescuedSone(Sone sone) {
+ rescuingSonesNotification.remove(sone);
+ sonesRescuedNotification.add(sone);
+ notificationManager.addNotification(sonesRescuedNotification);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
public void newSoneFound(Sone sone) {
newSoneNotification.add(sone);
notificationManager.addNotification(newSoneNotification);