Github: use NotificationListener.URL_OPENING_LISTENER

This commit is contained in:
Aleksey Pivovarov
2013-06-26 19:10:43 +04:00
parent afaaadc43f
commit 2ab6aa8f5a
2 changed files with 2 additions and 16 deletions
@@ -180,14 +180,7 @@ public class GithubCreateGistAction extends DumbAwareAction {
private static void showNotificationWithLink(@NotNull Project project, @NotNull final String url) {
Notificator.getInstance(project)
.notify(GitVcs.IMPORTANT_ERROR_NOTIFICATION, "Gist Created Successfully", "Your gist url: <a href='open'>" + url + "</a>",
NotificationType.INFORMATION, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
BrowserUtil.launchBrowser(url);
}
}
});
NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER);
}
@NotNull
@@ -449,14 +449,7 @@ public class GithubShareAction extends DumbAwareAction {
@NotNull String title,
@NotNull final String url) {
Notification notification = new Notification(GithubUtil.GITHUB_NOTIFICATION_GROUP, message, "<a href='" + url + "'>" + title + "</a>",
NotificationType.INFORMATION, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
BrowserUtil.launchBrowser(url);
}
}
});
NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER);
Notificator.getInstance(project).notify(notification);
}
}