Package net.hearthstats.osx.jna

Examples of net.hearthstats.osx.jna.NSUserNotification


  public void add(String header, String message, boolean allowFocus) {
    debugLog.debug("    Showing OS X notification \"{}\", \"{}\"", header, message);

    final NSAutoreleasePool pool = NSAutoreleasePool.new_();
    try {
      NSUserNotification nsUserNotification = NSUserNotification.CLASS.alloc();

      nsUserNotification.setTitle(header);
      nsUserNotification.setSubtitle(message);

      NSUserNotificationCenter defaultNotificationCenter = NSUserNotificationCenter.CLASS.defaultUserNotificationCenter();
      defaultNotificationCenter.setDelegate(defaultNotificationCenter);
      defaultNotificationCenter.deliverNotification(nsUserNotification);
    } finally {
View Full Code Here

TOP

Related Classes of net.hearthstats.osx.jna.NSUserNotification

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.