mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-241445 SingletonNotificationManager should be created only once
GitOrigin-RevId: 5afac5de82dffad30b7552ab945169b42bbf5f32
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d8be2e428e
commit
889e23cc6a
+13
-11
@@ -42,6 +42,10 @@ public class TerminalShellCommandHandlerHelper {
|
||||
private volatile Boolean myHasRunningCommands;
|
||||
private PropertiesComponent myPropertiesComponent;
|
||||
|
||||
private final SingletonNotificationManager myNotificationManager =
|
||||
new SingletonNotificationManager(NotificationGroup.toolWindowGroup("Terminal", TerminalToolWindowFactory.TOOL_WINDOW_ID),
|
||||
NotificationType.INFORMATION, null);
|
||||
|
||||
TerminalShellCommandHandlerHelper(@NotNull ShellTerminalWidget widget) {
|
||||
myWidget = widget;
|
||||
myAlarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, widget);
|
||||
@@ -88,17 +92,15 @@ public class TerminalShellCommandHandlerHelper {
|
||||
if (result != null) {
|
||||
String title = TerminalBundle.message("smart_command_execution.notification.title");
|
||||
String content = TerminalBundle.message("smart_command_execution.notification.text", GOT_IT);
|
||||
new SingletonNotificationManager(
|
||||
NotificationGroup.toolWindowGroup("Terminal", TerminalToolWindowFactory.TOOL_WINDOW_ID), NotificationType.INFORMATION, null)
|
||||
.notify(title, content, project,
|
||||
new NotificationListener.Adapter() {
|
||||
@Override
|
||||
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
|
||||
if (GOT_IT.equals(e.getDescription())) {
|
||||
getPropertiesComponent().setValue(TERMINAL_CUSTOM_COMMANDS_GOT_IT, true, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
myNotificationManager.notify(title, content, project,
|
||||
new NotificationListener.Adapter() {
|
||||
@Override
|
||||
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
|
||||
if (GOT_IT.equals(e.getDescription())) {
|
||||
getPropertiesComponent().setValue(TERMINAL_CUSTOM_COMMANDS_GOT_IT, true, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user