@Test public void testNotify() { final NotificationService n = new NotificationCenter(); n.notify(null, null, "title", "test"); }
@Override public void notify(final String group, final String identifier, final String title, final String description) { if (filter.shouldSuppress()) { log.debug(String.format("Suppressing notification for %s, %s, %s, %s", group, identifier, title, description)); return; } final NSUserNotification notification = NSUserNotification.notification(); if(StringUtils.isNotBlank(identifier)) { if(notification.respondsToSelector(Foundation.selector("setIdentifier:"))) { notification.setIdentifier(identifier); } if(StringUtils.isNotBlank(Path.getExtension(identifier))) { notification.setContentImage(IconCacheFactory.<NSImage>get().documentIcon(Path.getExtension(identifier), 32)); } } notification.setTitle(LocaleFactory.localizedString(title, "Status")); notification.setInformativeText(description); notification.setHasActionButton(false); center.scheduleNotification(notification); }
NotificationCenter extends ProxyController implements NotificationService, NSUserNotificationCenter.Delegate { @Override public void notify(final String group, final String identifier, final String title, final String description) { if (filter.shouldSuppress()) { log.debug(String.format("Suppressing notification for %s, %s, %s, %s", group, identifier, title, description)); return; } final NSUserNotification notification = NSUserNotification.notification(); if(StringUtils.isNotBlank(identifier)) { if(notification.respondsToSelector(Foundation.selector("setIdentifier:"))) { notification.setIdentifier(identifier); } if(StringUtils.isNotBlank(Path.getExtension(identifier))) { notification.setContentImage(IconCacheFactory.<NSImage>get().documentIcon(Path.getExtension(identifier), 32)); } } notification.setTitle(LocaleFactory.localizedString(title, "Status")); notification.setInformativeText(description); notification.setHasActionButton(false); center.scheduleNotification(notification); } }
NotificationCenter extends ProxyController implements NotificationService, NSUserNotificationCenter.Delegate { @Override public void notify(final String group, final String identifier, final String title, final String description) { if (filter.shouldSuppress()) { log.debug(String.format("Suppressing notification for %s, %s, %s, %s", group, identifier, title, description)); return; } final NSUserNotification notification = NSUserNotification.notification(); if(StringUtils.isNotBlank(identifier)) { if(notification.respondsToSelector(Foundation.selector("setIdentifier:"))) { notification.setIdentifier(identifier); } if(StringUtils.isNotBlank(Path.getExtension(identifier))) { notification.setContentImage(IconCacheFactory.<NSImage>get().documentIcon(Path.getExtension(identifier), 32)); } } notification.setTitle(LocaleFactory.localizedString(title, "Status")); notification.setInformativeText(description); notification.setHasActionButton(false); center.scheduleNotification(notification); }  }
NotificationCenter extends ProxyController implements NotificationService, NSUserNotificationCenter.Delegate { @Override public void notify(final String group, final String identifier, final String title, final String description) { if (filter.shouldSuppress()) { log.debug(String.format("Suppressing notification for %s, %s, %s, %s", group, identifier, title, description)); return; } final NSUserNotification notification = NSUserNotification.notification(); if(StringUtils.isNotBlank(identifier)) { if(notification.respondsToSelector(Foundation.selector("setIdentifier:"))) { notification.setIdentifier(identifier); } if(StringUtils.isNotBlank(Path.getExtension(identifier))) { notification.setContentImage(IconCacheFactory.<NSImage>get().documentIcon(Path.getExtension(identifier), 32)); } } notification.setTitle(LocaleFactory.localizedString(title, "Status")); notification.setInformativeText(description); notification.setHasActionButton(false); center.scheduleNotification(notification); }  @Override NotificationService setup(); @Override void unregister(); @Override void addListener(final Listener listener); @Override void notify(final String group, final String identifier, final String title, final String description); @Override void notify(final String group, final String identifier, final String title, final String description, final String action); @Override void userNotificationCenter_didActivateNotification(final NSUserNotificationCenter center, final NSUserNotification notification); @Override boolean userNotificationCenter_shouldPresentNotification(final NSUserNotificationCenter center, final NSUserNotification notification); }
NotificationCenter extends ProxyController implements NotificationService, NSUserNotificationCenter.Delegate { @Override public void notify(final String group, final String identifier, final String title, final String description) { if (filter.shouldSuppress()) { log.debug(String.format("Suppressing notification for %s, %s, %s, %s", group, identifier, title, description)); return; } final NSUserNotification notification = NSUserNotification.notification(); if(StringUtils.isNotBlank(identifier)) { if(notification.respondsToSelector(Foundation.selector("setIdentifier:"))) { notification.setIdentifier(identifier); } if(StringUtils.isNotBlank(Path.getExtension(identifier))) { notification.setContentImage(IconCacheFactory.<NSImage>get().documentIcon(Path.getExtension(identifier), 32)); } } notification.setTitle(LocaleFactory.localizedString(title, "Status")); notification.setInformativeText(description); notification.setHasActionButton(false); center.scheduleNotification(notification); }  @Override NotificationService setup(); @Override void unregister(); @Override void addListener(final Listener listener); @Override void notify(final String group, final String identifier, final String title, final String description); @Override void notify(final String group, final String identifier, final String title, final String description, final String action); @Override void userNotificationCenter_didActivateNotification(final NSUserNotificationCenter center, final NSUserNotification notification); @Override boolean userNotificationCenter_shouldPresentNotification(final NSUserNotificationCenter center, final NSUserNotification notification);  }