use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.
the class NSScrollerHelper method updateBehaviorPreferences.
private static void updateBehaviorPreferences() {
if (!SystemInfo.isMac)
return;
Foundation.NSAutoreleasePool pool = new Foundation.NSAutoreleasePool();
try {
ID defaults = invoke("NSUserDefaults", "standardUserDefaults");
invoke(defaults, "synchronize");
ourClickBehavior = invoke(defaults, "boolForKey:", Foundation.nsString("AppleScrollerPagingBehavior")).intValue() == 1 ? ClickBehavior.JumpToSpot : ClickBehavior.NextPage;
} finally {
pool.drain();
}
}
use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.
the class MountainLionNotifications method notify.
@Override
public void notify(@NotNull String name, @NotNull String title, @NotNull String description) {
final ID notification = invoke(Foundation.getObjcClass("NSUserNotification"), "new");
invoke(notification, "setTitle:", nsString(StringUtil.stripHtml(title, true).replace("%", "%%")));
invoke(notification, "setInformativeText:", nsString(StringUtil.stripHtml(description, true).replace("%", "%%")));
final ID center = invoke(Foundation.getObjcClass("NSUserNotificationCenter"), "defaultUserNotificationCenter");
invoke(center, "deliverNotification:", notification);
}
use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.
the class MountainLionNotifications method cleanupDeliveredNotifications.
private static void cleanupDeliveredNotifications() {
final ID center = invoke(Foundation.getObjcClass("NSUserNotificationCenter"), "defaultUserNotificationCenter");
invoke(center, "removeAllDeliveredNotifications");
}
use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.
the class Growl method notifyGrowlOf.
public void notifyGrowlOf(final String notification, final String title, final String description) {
final ID autoReleasePool = createAutoReleasePool();
final ID dict = Foundation.createDict(new String[] { GROWL_NOTIFICATION_NAME, GROWL_NOTIFICATION_TITLE, GROWL_NOTIFICATION_DESCRIPTION, GROWL_APP_NAME }, new Object[] { notification, title, description, myProductName });
final ID center = invoke("NSDistributedNotificationCenter", "defaultCenter");
final Object notificationName = Foundation.nsString(GROWL_NOTIFICATION);
invoke(center, "postNotificationName:object:userInfo:deliverImmediately:", notificationName, null, dict, true);
invoke(autoReleasePool, "release");
}
use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.
the class Growl method register.
public void register() {
final ID autoReleasePool = createAutoReleasePool();
final ID applicationIcon = getApplicationIcon();
final ID defaultNotifications = Foundation.fillArray(myDefaultNotification);
final ID allNotifications = Foundation.fillArray(myAllNotifications);
final ID userDict = Foundation.createDict(new String[] { GROWL_APP_NAME, GROWL_APP_ICON, GROWL_DEFAULT_NOTIFICATIONS, GROWL_ALL_NOTIFICATIONS }, new Object[] { myProductName, applicationIcon, defaultNotifications, allNotifications });
final ID center = invoke("NSDistributedNotificationCenter", "defaultCenter");
final Object notificationName = Foundation.nsString(GROWL_APPLICATION_REGISTRATION_NOTIFICATION);
invoke(center, "postNotificationName:object:userInfo:deliverImmediately:", notificationName, null, userDict, true);
invoke(autoReleasePool, "release");
}
Aggregations