From aefde8b5c2a0c924181c8b2b24e5fd0c300c8f16 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 1 Jul 2013 11:13:38 +0400 Subject: [PATCH] Github: remove useless EDT check --- .../plugins/github/GithubNotifications.java | 75 +------------------ 1 file changed, 4 insertions(+), 71 deletions(-) diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubNotifications.java b/plugins/github/src/org/jetbrains/plugins/github/GithubNotifications.java index 88874364138b..66ebc1763c35 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubNotifications.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubNotifications.java @@ -21,13 +21,9 @@ import com.intellij.notification.NotificationType; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; -import com.intellij.openapi.util.Ref; import git4idea.Notificator; import org.jetbrains.annotations.NotNull; -import java.awt.*; - - /** * @author Aleksey Pivovarov */ @@ -64,81 +60,18 @@ public class GithubNotifications { } public static void showInfoDialog(final @NotNull Project project, final @NotNull String title, final @NotNull String message) { - if (EventQueue.isDispatchThread()) { - Messages.showInfoMessage(project, message, title); - } - else { - try { - EventQueue.invokeAndWait(new Runnable() { - @Override - public void run() { - Messages.showInfoMessage(project, message, title); - } - }); - } - catch (Exception e) { - LOG.error("Notification error", e); - } - } + Messages.showInfoMessage(project, message, title); } public static void showWarningDialog(final @NotNull Project project, final @NotNull String title, final @NotNull String message) { - if (EventQueue.isDispatchThread()) { - Messages.showWarningDialog(project, message, title); - } - else { - try { - EventQueue.invokeAndWait(new Runnable() { - @Override - public void run() { - Messages.showWarningDialog(project, message, title); - } - }); - } - catch (Exception e) { - LOG.error("Notification error", e); - } - } + Messages.showWarningDialog(project, message, title); } public static void showErrorDialog(final @NotNull Project project, final @NotNull String title, final @NotNull String message) { - if (EventQueue.isDispatchThread()) { - Messages.showErrorDialog(project, message, title); - } - else { - try { - EventQueue.invokeAndWait(new Runnable() { - @Override - public void run() { - Messages.showErrorDialog(project, message, title); - } - }); - } - catch (Exception e) { - LOG.error("Notification error", e); - } - } + Messages.showErrorDialog(project, message, title); } public static int showYesNoDialog(final @NotNull Project project, final @NotNull String title, final @NotNull String message) { - if (EventQueue.isDispatchThread()) { - return Messages.showYesNoDialog(project, message, title, Messages.getQuestionIcon()); - } - else { - try { - final Ref result = new Ref(); - EventQueue.invokeAndWait(new Runnable() { - @Override - public void run() { - result.set(Messages.showYesNoDialog(project, message, title, Messages.getQuestionIcon())); - } - }); - return result.get(); - } - catch (Exception e) { - LOG.error("Notification error", e); - return Messages.CANCEL; - } - } + return Messages.showYesNoDialog(project, message, title, Messages.getQuestionIcon()); } }