@Override public void send(Notification notification) { changeIcon(notification.icon()); }
@Override public void send(Notification notification) { changeIcon(notification.icon()); }
@Override public void send(Notification notification) { List<String> commands = new ArrayList<>(); commands.add(configuration.bin()); commands.add("-t"); commands.add(DOUBLE_QUOTE + notification.title() + DOUBLE_QUOTE); commands.add("-m"); commands.add(DOUBLE_QUOTE + notification.message() + DOUBLE_QUOTE); commands.add("-p"); commands.add(DOUBLE_QUOTE + notification.icon().asPath() + DOUBLE_QUOTE); try { executor.exec(commands.toArray(new String[0])); } catch (RuntimeException e) { throw new ToasterNotificationException("Error while sending notification with toaster", e); } }
@Override public void send(Notification notification) { List<String> commands = new ArrayList<>(); commands.add(configuration.bin()); commands.add("-t"); commands.add(DOUBLE_QUOTE + notification.title() + DOUBLE_QUOTE); commands.add("-m"); commands.add(DOUBLE_QUOTE + notification.message() + DOUBLE_QUOTE); commands.add("-p"); commands.add(DOUBLE_QUOTE + notification.icon().asPath() + DOUBLE_QUOTE); try { executor.exec(commands.toArray(new String[0])); } catch (RuntimeException e) { throw new ToasterNotificationException("Error while sending notification with toaster", e); } }
@Override public void send(Notification notification) { List<String> commands = new ArrayList<>(); commands.add(configuration.bin()); commands.add("--passivepopup"); commands.add(notification.message()); if (application.timeout() != -1) { commands.add(String.valueOf(TimeUnit.MILLISECONDS.toSeconds(application.timeout()))); } commands.add("--title"); commands.add(notification.title()); commands.add("--icon"); commands.add(notification.icon().asPath()); try { executor.exec(commands.toArray(new String[0])); } catch (RuntimeException e) { throw new KdialogException("Error while sending notification with Kdialog.", e); } }
@Override public void send(Notification notification) { List<String> commands = new ArrayList<>(); commands.add(configuration.bin()); commands.add("--passivepopup"); commands.add(notification.message()); if (application.timeout() != -1) { commands.add(String.valueOf(TimeUnit.MILLISECONDS.toSeconds(application.timeout()))); } commands.add("--title"); commands.add(notification.title()); commands.add("--icon"); commands.add(notification.icon().asPath()); try { executor.exec(commands.toArray(new String[0])); } catch (RuntimeException e) { throw new KdialogException("Error while sending notification with Kdialog.", e); } }
@Override public void send(Notification notification) { List<String> commands = new ArrayList<>(); commands.add(configuration.bin()); commands.add(notification.title()); commands.add(notification.message()); if (application.timeout() != -1) { commands.add(CMD_TIMEOUT); commands.add(String.valueOf(application.timeout())); } commands.add(CMD_ICON); commands.add(notification.icon().asPath()); commands.add(CMD_URGENCY); commands.add(toUrgency(notification.level())); try { executor.exec(commands.toArray(new String[0])); } catch (RuntimeException e) { throw new NotifySendNotificationException("Error while sending notification to notify-send.", e.getCause()); } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Notification) { Notification that = (Notification) o; return (this.message.equals(that.message())) && (this.title.equals(that.title())) && ((this.subtitle == null) ? (that.subtitle() == null) : this.subtitle.equals(that.subtitle())) && (this.icon.equals(that.icon())) && (this.level.equals(that.level())); } return false; }
@Override public void send(Notification notification) { List<String> commands = new ArrayList<>(); commands.add(configuration.bin()); commands.add(notification.title()); commands.add(notification.message()); if (application.timeout() != -1) { commands.add(CMD_TIMEOUT); commands.add(String.valueOf(application.timeout())); } commands.add(CMD_ICON); commands.add(notification.icon().asPath()); commands.add(CMD_URGENCY); commands.add(toUrgency(notification.level())); try { executor.exec(commands.toArray(new String[0])); } catch (RuntimeException e) { throw new NotifySendNotificationException("Error while sending notification to notify-send.", e.getCause()); } }
@Override public void send(Notification notification) { StringBuilder command = new StringBuilder() .append("New-BurntToastNotification -Text '") .append(notification.title()) .append("', '") .append(notification.message()) .append("' -AppLogo ") .append(notification.icon().asPath()) .append(" -AppId '") .append(application.id()) .append("'"); if (configuration.sound() == null) { command.append(" -Silent"); } else { command.append(" -Sound ") .append(configuration.sound()); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Will execute PowerShell: {}", command.toString()); } PowerShellResponse response = PowerShell.executeSingleCommand(command.toString()); LOGGER.debug("Response: {}", response.getCommandOutput()); if (response.isError()) { throw new BurntToastException(response.getCommandOutput()); } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Notification) { Notification that = (Notification) o; return (this.message.equals(that.message())) && (this.title.equals(that.title())) && ((this.subtitle == null) ? (that.subtitle() == null) : this.subtitle.equals(that.subtitle())) && (this.icon.equals(that.icon())) && (this.level.equals(that.level())); } return false; }
commands.add(notification.icon().asPath()); if (configuration.sound() != null) { commands.add("-sound");
@Override public void send(Notification notification) { if (isClientRegistered()) { GntpNotification success = Gntp.notification(gNotification, notification.title()) .text(notification.message()) .icon(notification.icon().toImage()) .priority(toPriority(notification.level())) .build(); try { gClient.notify(success, 5, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
@Override public void send(Notification notification) { if (isClientRegistered()) { GntpNotification success = Gntp.notification(gNotification, notification.title()) .text(notification.message()) .icon(notification.icon().toImage()) .priority(toPriority(notification.level())) .build(); try { gClient.notify(success, 5, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
@Override public void send(Notification notification) { if (!skipNotifications) { icon.setImage(createImage(notification.icon().toByteArray())); icon.displayMessage(notification.title(), notification.message(), toMessageType(notification.level())); } }
@Override public void send(Notification notification) { if (!skipNotifications) { icon.setImage(createImage(notification.icon().toByteArray())); icon.displayMessage(notification.title(), notification.message(), toMessageType(notification.level())); } }
@Override public void send(Notification notification) { Notify notify = Notify.create() .title(notification.title()) .text(notification.message()) .image(notification.icon().toImage()) .position(configuration.position()) .hideAfter((int) (application.timeout() == -1 ? SECONDS.toMillis(3) : application.timeout())); if (configuration.withDarkStyle()) { notify.darkStyle(); } notify.show(); }
@Override public void send(Notification notification) { Notify notify = Notify.create() .title(notification.title()) .text(notification.message()) .image(notification.icon().toImage()) .position(configuration.position()) .hideAfter((int) (application.timeout() == -1 ? SECONDS.toMillis(3) : application.timeout())); if (configuration.withDarkStyle()) { notify.darkStyle(); } notify.show(); }
@Override public void send(Notification notification) { if (snarl == null) { LOGGER.warn("Snarl notifier is not initialized, cannot send notification."); return; } fr.jcgay.snp4j.request.Notification snarlNotification = new fr.jcgay.snp4j.request.Notification(); snarlNotification.setIcon(Icon.base64(notification.icon().toByteArray())); snarlNotification.setText(notification.message()); snarlNotification.setTitle(notification.title()); snarlNotification.setPriority(toPriority(notification.level())); init(); try { snarl.send(snarlNotification); } catch (SnpException e) { throw new SnarlNotificationException("Cannot send notification to Snarl.", e); } }
@Override public void send(Notification notification) { if (snarl == null) { LOGGER.warn("Snarl notifier is not initialized, cannot send notification."); return; } fr.jcgay.snp4j.request.Notification snarlNotification = new fr.jcgay.snp4j.request.Notification(); snarlNotification.setIcon(Icon.base64(notification.icon().toByteArray())); snarlNotification.setText(notification.message()); snarlNotification.setTitle(notification.title()); snarlNotification.setPriority(toPriority(notification.level())); init(); try { snarl.send(snarlNotification); } catch (SnpException e) { throw new SnarlNotificationException("Cannot send notification to Snarl.", e); } }