From 6c25cc9c1df47eb6c2bf359eab96cf6642a9542d Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 17 Jul 2024 15:23:47 +0200 Subject: [PATCH] [devkit] IJPL-158473 move ApiSourceArchive `displayName` values to properties (cherry picked from commit 634a56a5c583f2cd6f7550399210401f0e45f0d4) IJ-CR-140104 GitOrigin-RevId: 750c8a77562680896153865b92040f461281de78 --- .../messages/DevKitGradleBundle.properties | 9 ++++++++ .../src/DevKitGradleBundle.java | 12 +++++------ .../IntelliJPlatformAttachSourcesProvider.kt | 21 ++++++++++--------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/plugins/devkit/intellij.devkit.gradle/resources/messages/DevKitGradleBundle.properties b/plugins/devkit/intellij.devkit.gradle/resources/messages/DevKitGradleBundle.properties index e52820e750fa..9075b173a972 100644 --- a/plugins/devkit/intellij.devkit.gradle/resources/messages/DevKitGradleBundle.properties +++ b/plugins/devkit/intellij.devkit.gradle/resources/messages/DevKitGradleBundle.properties @@ -4,3 +4,12 @@ attachSources.intellijPlatform.action.name=Download IntelliJ Platform sources attachSources.intellijPlatform.action.busyText=Downloading IntelliJ Platform sources\u2026 attachSources.api.action.name=Attach {0} sources attachSources.api.action.busyText=Attaching {0} sources\u2026 +attachSources.api.action.displayName.css=CSS plugin API +attachSources.api.action.displayName.database=Database plugin API +attachSources.api.action.displayName.jam=JAM plugin API +attachSources.api.action.displayName.javaee=JavaEE plugin API +attachSources.api.action.displayName.persistence=Persistence plugin API +attachSources.api.action.displayName.spring=Spring plugin API +attachSources.api.action.displayName.springBoot=SpringBoot plugin API +attachSources.api.action.displayName.tomcat=Tomcat plugin API +attachSources.api.action.displayName.lsp=IntelliJ Platform LSP-API diff --git a/plugins/devkit/intellij.devkit.gradle/src/DevKitGradleBundle.java b/plugins/devkit/intellij.devkit.gradle/src/DevKitGradleBundle.java index 0f3e739e6e82..2f8683f3aad8 100644 --- a/plugins/devkit/intellij.devkit.gradle/src/DevKitGradleBundle.java +++ b/plugins/devkit/intellij.devkit.gradle/src/DevKitGradleBundle.java @@ -8,23 +8,23 @@ import java.util.function.Supplier; final class DevKitGradleBundle { - private static final @NonNls String BUNDLE_FQN = "messages.DevKitGradleBundle"; - private static final DynamicBundle BUNDLE = new DynamicBundle(DevKitGradleBundle.class, BUNDLE_FQN); + public static final @NonNls String BUNDLE = "messages.DevKitGradleBundle"; + private static final DynamicBundle INSTANCE = new DynamicBundle(DevKitGradleBundle.class, BUNDLE); private DevKitGradleBundle() { } public static @Nls @NotNull String message( - @PropertyKey(resourceBundle = BUNDLE_FQN) @NotNull String key, + @PropertyKey(resourceBundle = BUNDLE) @NotNull String key, @Nullable Object @NotNull ... params ) { - return BUNDLE.getMessage(key, params); + return INSTANCE.getMessage(key, params); } public static @NotNull Supplier<@Nls @NotNull String> messagePointer( - @PropertyKey(resourceBundle = BUNDLE_FQN) @NotNull String key, + @PropertyKey(resourceBundle = BUNDLE) @NotNull String key, @Nullable Object @NotNull ... params ) { - return BUNDLE.getLazyMessage(key, params); + return INSTANCE.getLazyMessage(key, params); } } diff --git a/plugins/devkit/intellij.devkit.gradle/src/IntelliJPlatformAttachSourcesProvider.kt b/plugins/devkit/intellij.devkit.gradle/src/IntelliJPlatformAttachSourcesProvider.kt index 71828b86f164..7e0f1f9bc79d 100644 --- a/plugins/devkit/intellij.devkit.gradle/src/IntelliJPlatformAttachSourcesProvider.kt +++ b/plugins/devkit/intellij.devkit.gradle/src/IntelliJPlatformAttachSourcesProvider.kt @@ -11,6 +11,7 @@ import com.intellij.openapi.roots.LibraryOrderEntry import com.intellij.openapi.util.ActionCallback import com.intellij.openapi.vfs.VfsUtilCore import com.intellij.psi.PsiFile +import org.jetbrains.annotations.PropertyKey import org.jetbrains.idea.devkit.projectRoots.IntelliJPlatformProduct import org.jetbrains.idea.devkit.run.ProductInfo import org.jetbrains.idea.devkit.run.loadProductInfo @@ -24,18 +25,18 @@ import kotlin.io.path.pathString internal enum class ApiSourceArchive( val id: String, - val displayName: String, + @PropertyKey(resourceBundle = DevKitGradleBundle.BUNDLE) val displayName: String, val archiveName: String, ) { - CSS("com.intellij.css", "CSS plugin API", "src_css-api.zip"), - DATABASE("com.intellij.database", "Database plugin API", "src_database-openapi.zip"), - JAM("com.intellij.java", "JAM plugin API", "src_jam-openapi.zip"), - JAVAEE("com.intellij.javaee", "JavaEE plugin API", "src_javaee-openapi.zip"), - PERSISTENCE("com.intellij.persistence", "Persistence plugin API", "src_persistence-openapi.zip"), - SPRING("com.intellij.spring", "Spring plugin API", "src_spring-openapi.zip"), - SPRING_BOOT("com.intellij.spring.boot", "SpringBoot plugin API", "src_spring-boot-openapi.zip"), - TOMCAT("Tomcat", "Tomcat plugin API", "src_tomcat.zip"), - LSP("LSP", "IntelliJ Platform LSP-API", "src_lsp-openapi.zip"), + CSS("com.intellij.css", "attachSources.api.action.displayName.css", "src_css-api.zip"), + DATABASE("com.intellij.database", "attachSources.api.action.displayName.database", "src_database-openapi.zip"), + JAM("com.intellij.java", "attachSources.api.action.displayName.jam", "src_jam-openapi.zip"), + JAVAEE("com.intellij.javaee", "attachSources.api.action.displayName.javaee", "src_javaee-openapi.zip"), + PERSISTENCE("com.intellij.persistence", "attachSources.api.action.displayName.persistence", "src_persistence-openapi.zip"), + SPRING("com.intellij.spring", "attachSources.api.action.displayName.spring", "src_spring-openapi.zip"), + SPRING_BOOT("com.intellij.spring.boot", "attachSources.api.action.displayName.springBoot", "src_spring-boot-openapi.zip"), + TOMCAT("Tomcat", "attachSources.api.action.displayName.tomcat", "src_tomcat.zip"), + LSP("LSP", "attachSources.api.action.displayName.lsp", "src_lsp-openapi.zip"), } /**