mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2025-12-05 06:11:52 +00:00
Fix subclassing of DynamicBundle in ComposeTemplateBundle
It is not recommended
This commit is contained in:
parent
b32e3fee01
commit
5d5ef16235
@ -1,20 +1,22 @@
|
||||
package org.jetbrains.plugins.template
|
||||
|
||||
import com.intellij.DynamicBundle
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
import java.util.function.Supplier
|
||||
|
||||
@NonNls
|
||||
private const val BUNDLE = "messages.ComposeTemplate"
|
||||
|
||||
object ComposeTemplateBundle : DynamicBundle(BUNDLE) {
|
||||
object ComposeTemplateBundle {
|
||||
private val instance = DynamicBundle(ComposeTemplateBundle::class.java, BUNDLE)
|
||||
|
||||
@JvmStatic
|
||||
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
|
||||
getMessage(key, *params)
|
||||
fun message(key: @PropertyKey(resourceBundle = BUNDLE) String, vararg params: Any?): @Nls String {
|
||||
return instance.getMessage(key, *params)
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@JvmStatic
|
||||
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
|
||||
getLazyMessage(key, *params)
|
||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): Supplier<@Nls String> {
|
||||
return instance.getLazyMessage(key, *params)
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ private fun MyLocationList(
|
||||
}
|
||||
) {
|
||||
ContextPopupMenuItem(
|
||||
ComposeTemplateBundle.getMessage("weather.app.context.menu.delete.option"),
|
||||
ComposeTemplateBundle.message("weather.app.context.menu.delete.option"),
|
||||
AllIconsKeys.General.Delete
|
||||
) {
|
||||
showPopup.value = false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user