From 1d9bd6b5fa3625566876f06ba08d87d20205b8fa Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 27 Aug 2014 15:05:47 +0200 Subject: [PATCH] =?UTF-8?q?simplify=20toolWindowGroup=20constructor=20?= =?UTF-8?q?=E2=80=94=20the=20same=20as=20in=20case=20of=20balloonGroup,=20?= =?UTF-8?q?don't=20require=20to=20pass=20logByDefault?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/intellij/debugger/ui/HotSwapProgressImpl.java | 2 +- .../task/ui/AbstractExternalSystemToolWindowFactory.java | 7 ++++--- .../codeInspection/ex/GlobalInspectionContextImpl.java | 2 +- .../AnalyzeDependenciesOnSpecifiedTargetHandler.java | 2 +- .../src/com/intellij/notification/NotificationGroup.java | 4 ++++ .../intellij/structuralsearch/plugin/ui/SearchCommand.java | 2 +- .../vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java | 2 +- .../intellij/openapi/vcs/ui/VcsBalloonProblemNotifier.java | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java index b2b0091fc949..601ec7957849 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java @@ -38,7 +38,7 @@ import java.util.Collections; import java.util.List; public class HotSwapProgressImpl extends HotSwapProgress{ - static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("HotSwap", ToolWindowId.DEBUG, true); + static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("HotSwap", ToolWindowId.DEBUG); TIntObjectHashMap> myMessages = new TIntObjectHashMap>(); private final ProgressWindow myProgressWindow; diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java index 1e08045faeea..a5bf2827ef26 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/AbstractExternalSystemToolWindowFactory.java @@ -28,6 +28,8 @@ import com.intellij.ui.content.ContentManager; import com.intellij.ui.content.impl.ContentImpl; import org.jetbrains.annotations.NotNull; +import java.util.Locale; + /** * @author Denis Zhdanov * @since 5/13/13 4:15 PM @@ -39,9 +41,8 @@ public abstract class AbstractExternalSystemToolWindowFactory implements ToolWin protected AbstractExternalSystemToolWindowFactory(@NotNull ProjectSystemId id) { myExternalSystemId = id; - myNotificationGroup = NotificationGroup.toolWindowGroup("notification.group.id." + id.toString().toLowerCase(), - myExternalSystemId.getReadableName(), - true); + myNotificationGroup = NotificationGroup.toolWindowGroup("notification.group.id." + id.toString().toLowerCase(Locale.ENGLISH), + myExternalSystemId.getReadableName()); } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java index 5ef41fb00c45..695c2a72d200 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java @@ -80,7 +80,7 @@ import java.util.*; public class GlobalInspectionContextImpl extends GlobalInspectionContextBase implements GlobalInspectionContext { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.ex.GlobalInspectionContextImpl"); - private static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Inspection Results", ToolWindowId.INSPECTION, true); + private static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Inspection Results", ToolWindowId.INSPECTION); private final NotNullLazyValue myContentManager; private InspectionResultsView myView = null; private Content myContent = null; diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java b/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java index ffc682269563..7aebba7dfe41 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/actions/AnalyzeDependenciesOnSpecifiedTargetHandler.java @@ -36,7 +36,7 @@ import java.util.*; */ public class AnalyzeDependenciesOnSpecifiedTargetHandler extends DependenciesHandlerBase { private static final NotificationGroup NOTIFICATION_GROUP = - NotificationGroup.toolWindowGroup("Dependencies", ToolWindowId.DEPENDENCIES, true); + NotificationGroup.toolWindowGroup("Dependencies", ToolWindowId.DEPENDENCIES); private final GlobalSearchScope myTargetScope; public AnalyzeDependenciesOnSpecifiedTargetHandler(@NotNull Project project, @NotNull AnalysisScope scope, @NotNull GlobalSearchScope targetScope) { diff --git a/platform/platform-api/src/com/intellij/notification/NotificationGroup.java b/platform/platform-api/src/com/intellij/notification/NotificationGroup.java index 7285a8e1ffd6..df68daff1584 100644 --- a/platform/platform-api/src/com/intellij/notification/NotificationGroup.java +++ b/platform/platform-api/src/com/intellij/notification/NotificationGroup.java @@ -66,6 +66,10 @@ public final class NotificationGroup { return new NotificationGroup(displayId, NotificationDisplayType.TOOL_WINDOW, logByDefault, toolWindowId); } + public static NotificationGroup toolWindowGroup(@NotNull String displayId, @NotNull String toolWindowId) { + return toolWindowGroup(displayId, toolWindowId, true); + } + public String getDisplayId() { return myDisplayId; } diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java index 8cb7e55ea290..9394eabc2a57 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchCommand.java @@ -114,7 +114,7 @@ public class SearchCommand { new Runnable() { @Override public void run() { - NotificationGroup.toolWindowGroup("Structural Search", ToolWindowId.FIND, true) + NotificationGroup.toolWindowGroup("Structural Search", ToolWindowId.FIND) .createNotification(SSRBundle.message("problem", e.getMessage()), MessageType.ERROR).notify(project); } }, diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java index 4b7f6baf2616..985f383ecbc6 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotifier.java @@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable; public class VcsNotifier { private static final NotificationGroup NOTIFICATION_GROUP_ID = NotificationGroup.toolWindowGroup( - "Vcs Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); + "Vcs Messages", ChangesViewContentManager.TOOLWINDOW_ID); private static final NotificationGroup IMPORTANT_ERROR_NOTIFICATION = new NotificationGroup( "Vcs Important Messages", NotificationDisplayType.STICKY_BALLOON, true); private static final NotificationGroup MINOR_NOTIFICATION = new NotificationGroup( 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 908a3d9f8433..82ff0bcc6e5a 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 @@ -37,7 +37,7 @@ import javax.swing.event.HyperlinkEvent; */ public class VcsBalloonProblemNotifier implements Runnable { public static final NotificationGroup - NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID, true); + NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("Common Version Control Messages", ChangesViewContentManager.TOOLWINDOW_ID); private final Project myProject; private final String myMessage; private final MessageType myMessageType;