summaryrefslogtreecommitdiff
path: root/platform/platform-api/src/com/intellij/notification
diff options
context:
space:
mode:
Diffstat (limited to 'platform/platform-api/src/com/intellij/notification')
-rw-r--r--platform/platform-api/src/com/intellij/notification/Notification.java3
-rw-r--r--platform/platform-api/src/com/intellij/notification/NotificationGroup.java6
-rw-r--r--platform/platform-api/src/com/intellij/notification/NotificationListener.java4
3 files changed, 10 insertions, 3 deletions
diff --git a/platform/platform-api/src/com/intellij/notification/Notification.java b/platform/platform-api/src/com/intellij/notification/Notification.java
index 674e20282334..7b3ecd67ca47 100644
--- a/platform/platform-api/src/com/intellij/notification/Notification.java
+++ b/platform/platform-api/src/com/intellij/notification/Notification.java
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.ui.popup.JBPopupAdapter;
import com.intellij.openapi.ui.popup.LightweightWindowEvent;
+import com.intellij.openapi.util.text.StringUtil;
import com.intellij.reference.SoftReference;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -62,7 +63,7 @@ public class Notification {
myType = type;
myListener = listener;
- LOG.assertTrue(myContent.trim().length() > 0, "Notification should have content, groupId: " + myGroupId);
+ LOG.assertTrue(!StringUtil.isEmptyOrSpaces(myContent), "Notification should have content, groupId: " + myGroupId);
}
@SuppressWarnings("MethodMayBeStatic")
diff --git a/platform/platform-api/src/com/intellij/notification/NotificationGroup.java b/platform/platform-api/src/com/intellij/notification/NotificationGroup.java
index df68daff1584..a1b838676f41 100644
--- a/platform/platform-api/src/com/intellij/notification/NotificationGroup.java
+++ b/platform/platform-api/src/com/intellij/notification/NotificationGroup.java
@@ -54,18 +54,22 @@ public final class NotificationGroup {
ourRegisteredGroups.put(displayId, this);
}
+ @NotNull
public static NotificationGroup balloonGroup(@NotNull String displayId) {
return new NotificationGroup(displayId, NotificationDisplayType.BALLOON, true);
}
+ @NotNull
public static NotificationGroup logOnlyGroup(@NotNull String displayId) {
return new NotificationGroup(displayId, NotificationDisplayType.NONE, true);
}
+ @NotNull
public static NotificationGroup toolWindowGroup(@NotNull String displayId, @NotNull String toolWindowId, final boolean logByDefault) {
return new NotificationGroup(displayId, NotificationDisplayType.TOOL_WINDOW, logByDefault, toolWindowId);
}
+ @NotNull
public static NotificationGroup toolWindowGroup(@NotNull String displayId, @NotNull String toolWindowId) {
return toolWindowGroup(displayId, toolWindowId, true);
}
@@ -78,10 +82,12 @@ public final class NotificationGroup {
return createNotification(content, type.toNotificationType());
}
+ @NotNull
public Notification createNotification(@NotNull final String content, @NotNull final NotificationType type) {
return createNotification("", content, type, null);
}
+ @NotNull
public Notification createNotification(@NotNull final String title,
@NotNull final String content,
@NotNull final NotificationType type,
diff --git a/platform/platform-api/src/com/intellij/notification/NotificationListener.java b/platform/platform-api/src/com/intellij/notification/NotificationListener.java
index 8577d7d6a469..e88204f6888a 100644
--- a/platform/platform-api/src/com/intellij/notification/NotificationListener.java
+++ b/platform/platform-api/src/com/intellij/notification/NotificationListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ public interface NotificationListener {
protected abstract void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e);
}
- NotificationListener URL_OPENING_LISTENER = new UrlOpeningListener(false);
+ NotificationListener URL_OPENING_LISTENER = new UrlOpeningListener(true);
class UrlOpeningListener extends Adapter {
private final boolean myExpireNotification;