From 3eac423c18f3e883c32895866f48d30e337e4e3d Mon Sep 17 00:00:00 2001 From: "Dmitry.Krasilschikov" Date: Fri, 20 Mar 2020 12:43:30 +0200 Subject: [PATCH] IDEA-CR-60330 IDEA-235533 proper @Nls context annotations in Kotlin GitOrigin-RevId: 585047e1a814e0efda75d0ca3758f40949dde792 --- .../com/intellij/notification/NotificationGroup.kt | 14 +++++++------- .../src/com/intellij/util/nls/NlsContexts.java | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/platform-api/src/com/intellij/notification/NotificationGroup.kt b/platform/platform-api/src/com/intellij/notification/NotificationGroup.kt index 9802a769669e..81ef68f04538 100644 --- a/platform/platform-api/src/com/intellij/notification/NotificationGroup.kt +++ b/platform/platform-api/src/com/intellij/notification/NotificationGroup.kt @@ -133,17 +133,17 @@ class NotificationGroup(@param:NonNls val displayId: String, get() = registeredGroups.values } - fun createNotification(@Nls @NotificationContent content: String, type: MessageType): Notification { + fun createNotification(content: @Nls @NotificationContent String, type: MessageType): Notification { return createNotification(content, type.toNotificationType()) } - fun createNotification(@Nls @NotificationContent content: String, type: NotificationType): Notification { + fun createNotification(content: @Nls @NotificationContent String, type: NotificationType): Notification { return createNotification("", content, type) } fun createNotification( - @Nls @NotificationTitle title: String, - @Nls @NotificationContent content: String, + title: @Nls @NotificationTitle String, + content: @Nls @NotificationContent String, type: NotificationType = NotificationType.INFORMATION, listener: NotificationListener? = null ): Notification { @@ -157,9 +157,9 @@ class NotificationGroup(@param:NonNls val displayId: String, @JvmOverloads fun createNotification( - @Nls @NotificationTitle title: String?, - @Nls @NotificationSubtitle subtitle: String?, - @Nls @NotificationContent content: String?, + title: @Nls @NotificationTitle String?, + subtitle: @Nls @NotificationSubtitle String?, + content: @Nls @NotificationContent String?, type: NotificationType = NotificationType.INFORMATION, listener: NotificationListener? = null ): Notification { diff --git a/platform/platform-api/src/com/intellij/util/nls/NlsContexts.java b/platform/platform-api/src/com/intellij/util/nls/NlsContexts.java index 78608f46dc41..93f81c3a6837 100644 --- a/platform/platform-api/src/com/intellij/util/nls/NlsContexts.java +++ b/platform/platform-api/src/com/intellij/util/nls/NlsContexts.java @@ -90,19 +90,19 @@ public class NlsContexts { */ @NlsContext(prefix = "notification.title") @Nls(capitalization = Nls.Capitalization.Sentence) - @Target({ElementType.PARAMETER, ElementType.TYPE_USE}) + @Target(ElementType.TYPE_USE) public @interface NotificationTitle { } @NlsContext(prefix = "notification.subtitle") @Nls(capitalization = Nls.Capitalization.Sentence) - @Target({ElementType.PARAMETER, ElementType.TYPE_USE}) + @Target(ElementType.TYPE_USE) public @interface NotificationSubtitle { } @NlsContext(prefix = "notification.content") @Nls(capitalization = Nls.Capitalization.Sentence) - @Target({ElementType.PARAMETER, ElementType.TYPE_USE}) + @Target(ElementType.TYPE_USE) public @interface NotificationContent { }