Package net.pterodactylus.util.notify

Examples of net.pterodactylus.util.notify.Notification


   */
  @Override
  protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
    super.processTemplate(request, templateContext);
    String notificationId = request.getHttpRequest().getPartAsStringFailsafe("notification", 36);
    Notification notification = webInterface.getNotifications().getNotification(notificationId);
    if ((notification != null) && notification.isDismissable()) {
      notification.dismiss();
    }
    String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
    throw new RedirectException(returnPage);
  }
View Full Code Here


   *            loaded, {@code false} otherwise
   */
  public void setFirstStart(boolean firstStart) {
    if (firstStart) {
      Template firstStartNotificationTemplate = TemplateParser.parse(createReader("/templates/notify/firstStartNotification.html"));
      Notification firstStartNotification = new TemplateNotification("first-start-notification", firstStartNotificationTemplate);
      notificationManager.addNotification(firstStartNotification);
    }
  }
View Full Code Here

   *            {@code false} if the existing configuration could be read
   */
  public void setNewConfig(boolean newConfig) {
    if (newConfig && !hasFirstStartNotification()) {
      Template configNotReadNotificationTemplate = TemplateParser.parse(createReader("/templates/notify/configNotReadNotification.html"));
      Notification configNotReadNotification = new TemplateNotification("config-not-read-notification", configNotReadNotificationTemplate);
      notificationManager.addNotification(configNotReadNotification);
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  protected JsonReturnObject createJsonObject(FreenetRequest request) {
    String notificationId = request.getHttpRequest().getParam("notification");
    Notification notification = webInterface.getNotifications().getNotification(notificationId);
    if (notification == null) {
      return createErrorJsonObject("invalid-notification-id");
    }
    if (!notification.isDismissable()) {
      return createErrorJsonObject("not-dismissable");
    }
    notification.dismiss();
    return createSuccessJsonObject();
  }
View Full Code Here

TOP

Related Classes of net.pterodactylus.util.notify.Notification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.