From 2ab6aa8f5af1cee8aa41ee6d1ca9c46ad2549360 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Wed, 26 Jun 2013 19:10:43 +0400 Subject: [PATCH] Github: use NotificationListener.URL_OPENING_LISTENER --- .../jetbrains/plugins/github/GithubCreateGistAction.java | 9 +-------- .../org/jetbrains/plugins/github/GithubShareAction.java | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubCreateGistAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubCreateGistAction.java index 1e853ea660f9..b75b65c4902e 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubCreateGistAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubCreateGistAction.java @@ -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: " + url + "", - 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 diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java index 1345f170f377..67592a7dcfb7 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubShareAction.java @@ -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, "" + title + "", - 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); } }