Package net.pterodactylus.util.notify

Examples of net.pterodactylus.util.notify.TemplateNotification


    Template lockedSonesTemplate = TemplateParser.parse(createReader("/templates/notify/lockedSonesNotification.html"));
    lockedSonesNotification = new ListNotification<Sone>("sones-locked-notification", "sones", lockedSonesTemplate);

    Template newVersionTemplate = TemplateParser.parse(createReader("/templates/notify/newVersionNotification.html"));
    newVersionNotification = new TemplateNotification("new-version-notification", newVersionTemplate);

    Template insertingImagesTemplate = TemplateParser.parse(createReader("/templates/notify/inserting-images-notification.html"));
    insertingImagesNotification = new ListNotification<Image>("inserting-images-notification", "images", insertingImagesTemplate);

    Template insertedImagesTemplate = TemplateParser.parse(createReader("/templates/notify/inserted-images-notification.html"));
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

    registerToadlets();

    /* notification templates. */
    Template startupNotificationTemplate = TemplateParser.parse(createReader("/templates/notify/startupNotification.html"));

    final TemplateNotification startupNotification = new TemplateNotification("startup-notification", startupNotificationTemplate);
    notificationManager.addNotification(startupNotification);

    ticker.schedule(new Runnable() {

      @Override
      public void run() {
        startupNotification.dismiss();
      }
    }, 2, TimeUnit.MINUTES);

    Template wotMissingNotificationTemplate = TemplateParser.parse(createReader("/templates/notify/wotMissingNotification.html"));
    final TemplateNotification wotMissingNotification = new TemplateNotification("wot-missing-notification", wotMissingNotificationTemplate);
    ticker.scheduleAtFixedRate(new Runnable() {

      @Override
      @SuppressWarnings("synthetic-access")
      public void run() {
        if (getCore().getIdentityManager().isConnected()) {
          wotMissingNotification.dismiss();
        } else {
          notificationManager.addNotification(wotMissingNotification);
        }
      }

View Full Code Here

   *            The Sone to get the insert notification for
   * @return The Sone insert notification
   */
  private TemplateNotification getSoneInsertNotification(Sone sone) {
    synchronized (soneInsertNotifications) {
      TemplateNotification templateNotification = soneInsertNotifications.get(sone);
      if (templateNotification == null) {
        templateNotification = new TemplateNotification(TemplateParser.parse(createReader("/templates/notify/soneInsertNotification.html")));
        templateNotification.set("insertSone", sone);
        soneInsertNotifications.put(sone, templateNotification);
      }
      return templateNotification;
    }
  }
View Full Code Here

   * @param soneInsertingEvent
   *            The event
   */
  @Subscribe
  public void soneInserting(SoneInsertingEvent soneInsertingEvent) {
    TemplateNotification soneInsertNotification = getSoneInsertNotification(soneInsertingEvent.sone());
    soneInsertNotification.set("soneStatus", "inserting");
    if (soneInsertingEvent.sone().getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
      notificationManager.addNotification(soneInsertNotification);
    }
  }
View Full Code Here

   * @param soneInsertedEvent
   *            The event
   */
  @Subscribe
  public void soneInserted(SoneInsertedEvent soneInsertedEvent) {
    TemplateNotification soneInsertNotification = getSoneInsertNotification(soneInsertedEvent.sone());
    soneInsertNotification.set("soneStatus", "inserted");
    soneInsertNotification.set("insertDuration", soneInsertedEvent.insertDuration() / 1000);
    if (soneInsertedEvent.sone().getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
      notificationManager.addNotification(soneInsertNotification);
    }
  }
View Full Code Here

   * @param soneInsertAbortedEvent
   *            The event
   */
  @Subscribe
  public void soneInsertAborted(SoneInsertAbortedEvent soneInsertAbortedEvent) {
    TemplateNotification soneInsertNotification = getSoneInsertNotification(soneInsertAbortedEvent.sone());
    soneInsertNotification.set("soneStatus", "insert-aborted");
    soneInsertNotification.set("insert-error", soneInsertAbortedEvent.cause());
    if (soneInsertAbortedEvent.sone().getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
      notificationManager.addNotification(soneInsertNotification);
    }
  }
View Full Code Here

TOP

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

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.