diff --git a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java index 764a3f6f95a2..8e20a924497b 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java @@ -38,7 +38,7 @@ import com.intellij.openapi.vcs.FilePathImpl; import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.changes.*; import com.intellij.openapi.vcs.changes.patch.ApplyPatchAction; -import com.intellij.openapi.vcs.update.AbstractCommonUpdateAction; +import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vfs.ReadonlyStatusHandler; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; @@ -384,7 +384,7 @@ public class PatchApplier { showError(project, VcsBundle.message("patch.apply.partially.applied"), false); } else if (ApplyPatchStatus.SUCCESS.equals(status)) { final String message = VcsBundle.message("patch.apply.success.applied.text"); - AbstractCommonUpdateAction.NOTIFICATION_GROUP.createNotification(message, MessageType.INFO).notify(project); + VcsBalloonProblemNotifier.NOTIFICATION_GROUP.createNotification(message, MessageType.INFO).notify(project); } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java index e86ad72552d2..cca7926e64b0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java @@ -37,7 +37,7 @@ import com.intellij.openapi.vcs.changes.actions.MoveChangesToAnotherListAction; import com.intellij.openapi.vcs.changes.committed.CommittedChangesCache; import com.intellij.openapi.vcs.checkin.CheckinEnvironment; import com.intellij.openapi.vcs.checkin.CheckinHandler; -import com.intellij.openapi.vcs.update.AbstractCommonUpdateAction; +import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vcs.update.RefreshVFsSynchronously; import com.intellij.util.Consumer; import com.intellij.util.NullableFunction; @@ -136,7 +136,7 @@ public class CommitHelper { text += ", " + failed + " " + StringUtil.pluralize("change", failed) + " failed to commit"; } String content = StringUtil.isEmpty(myCommitMessage) ? text : text + ": " + myCommitMessage; - AbstractCommonUpdateAction.NOTIFICATION_GROUP.createNotification(content, NotificationType.INFORMATION).notify( myProject); + VcsBalloonProblemNotifier.NOTIFICATION_GROUP.createNotification(content, NotificationType.INFORMATION).notify( myProject); return new NotificationInfo("VCS Commit", "VCS Commit Finished", text, true); } }; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java index 5cb6b9b81318..598046bf27f1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java @@ -15,13 +15,12 @@ */ package com.intellij.openapi.vcs.ui; +import com.intellij.notification.NotificationGroup; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; -import com.intellij.openapi.vcs.update.AbstractCommonUpdateAction; - -import java.util.Collection; +import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager; /** * Shows a notification balloon over one of version control related tool windows: Changes View or Version Control View. @@ -29,6 +28,8 @@ import java.util.Collection; * Use the special method or supply additional parameter to the constructor to show the balloon over the Version Control View. */ public class VcsBalloonProblemNotifier implements Runnable { + public static final NotificationGroup + NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); private final Project myProject; private final String myMessage; private final MessageType myMessageType; @@ -65,20 +66,11 @@ public class VcsBalloonProblemNotifier implements Runnable { showErrorAction.run(); } else { - ApplicationManager.getApplication().invokeLater(showErrorAction); + application.invokeLater(showErrorAction); } } public void run() { - final Collection projects; - if (myProject != null) { - doForProject(myProject); - } else { - doForProject(null); - } - } - - private void doForProject(final Project project) { - AbstractCommonUpdateAction.NOTIFICATION_GROUP.createNotification(myMessage, myMessageType).notify(project); + NOTIFICATION_GROUP.createNotification(myMessage, myMessageType).notify(myProject); } } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java index 5a1f110a94d0..c8977cfef03e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java @@ -19,7 +19,6 @@ import com.intellij.history.Label; import com.intellij.history.LocalHistory; import com.intellij.history.LocalHistoryAction; import com.intellij.ide.errorTreeView.HotfixData; -import com.intellij.notification.NotificationGroup; import com.intellij.notification.NotificationType; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.Presentation; @@ -44,7 +43,6 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManagerImpl; import com.intellij.openapi.vcs.changes.committed.CommittedChangesAdapter; import com.intellij.openapi.vcs.changes.committed.CommittedChangesCache; import com.intellij.openapi.vcs.changes.committed.IntoSelfVirtualFileConvertor; -import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager; import com.intellij.openapi.vcs.ex.ProjectLevelVcsManagerEx; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList; @@ -62,7 +60,6 @@ import java.io.File; import java.util.*; public abstract class AbstractCommonUpdateAction extends AbstractVcsAction { - public static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); private final boolean myAlwaysVisible; private final static Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.update.AbstractCommonUpdateAction"); @@ -458,7 +455,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction { if (text.length() > 0) { log += ": " + text.toString(); } - NOTIFICATION_GROUP.createNotification(log, NotificationType.INFORMATION).notify(myProject); + VcsBalloonProblemNotifier.NOTIFICATION_GROUP.createNotification(log, NotificationType.INFORMATION).notify(myProject); return new NotificationInfo("VCS Update", title, log, true); } diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/application/CvsInfo.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/application/CvsInfo.java index 1683c8e28596..0d88ce856658 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/application/CvsInfo.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/application/CvsInfo.java @@ -26,7 +26,6 @@ import com.intellij.cvsSupport2.cvsIgnore.IgnoredFilesInfo; import com.intellij.cvsSupport2.cvsIgnore.IgnoredFilesInfoImpl; import com.intellij.cvsSupport2.errorHandling.ErrorRegistry; import com.intellij.cvsSupport2.javacvsImpl.io.ReadWriteStatistics; -import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; @@ -293,12 +292,8 @@ public class CvsInfo { } public ThreeState silentLogin(boolean forceCheck) { - ApplicationManager.getApplication().invokeLater(new Runnable() { - public void run() { - new VcsBalloonProblemNotifier(project, CvsBundle.message("message.error.invalid.cvs.root", getCvsRootAsString()), - MessageType.ERROR).run(); - } - }); + VcsBalloonProblemNotifier.showOverChangesView( + project, CvsBundle.message("message.error.invalid.cvs.root", getCvsRootAsString()), MessageType.ERROR); return ThreeState.NO; }