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
|
package org.jetbrains.plugins.template
|
||||||
|
|
||||||
import com.intellij.DynamicBundle
|
import com.intellij.DynamicBundle
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.Nls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
|
import java.util.function.Supplier
|
||||||
|
|
||||||
@NonNls
|
|
||||||
private const val BUNDLE = "messages.ComposeTemplate"
|
private const val BUNDLE = "messages.ComposeTemplate"
|
||||||
|
|
||||||
object ComposeTemplateBundle : DynamicBundle(BUNDLE) {
|
object ComposeTemplateBundle {
|
||||||
|
private val instance = DynamicBundle(ComposeTemplateBundle::class.java, BUNDLE)
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
|
fun message(key: @PropertyKey(resourceBundle = BUNDLE) String, vararg params: Any?): @Nls String {
|
||||||
getMessage(key, *params)
|
return instance.getMessage(key, *params)
|
||||||
|
}
|
||||||
@Suppress("unused")
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
|
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): Supplier<@Nls String> {
|
||||||
getLazyMessage(key, *params)
|
return instance.getLazyMessage(key, *params)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -217,7 +217,7 @@ private fun MyLocationList(
|
|||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
ContextPopupMenuItem(
|
ContextPopupMenuItem(
|
||||||
ComposeTemplateBundle.getMessage("weather.app.context.menu.delete.option"),
|
ComposeTemplateBundle.message("weather.app.context.menu.delete.option"),
|
||||||
AllIconsKeys.General.Delete
|
AllIconsKeys.General.Delete
|
||||||
) {
|
) {
|
||||||
showPopup.value = false
|
showPopup.value = false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user