i18n: add bundle for idea/filters
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
text.inline.function.body=inline function body
|
||||||
|
text.inline.function.call.site=inline function call site
|
||||||
|
title.navigate.to=Navigate to
|
||||||
@@ -32,7 +32,7 @@ class InlineFunctionHyperLinkInfo(
|
|||||||
val list = JBList(inlineInfo)
|
val list = JBList(inlineInfo)
|
||||||
list.cellRenderer = InlineInfoCellRenderer()
|
list.cellRenderer = InlineInfoCellRenderer()
|
||||||
val popup = JBPopupFactory.getInstance().createListPopupBuilder(list)
|
val popup = JBPopupFactory.getInstance().createListPopupBuilder(list)
|
||||||
.setTitle("Navigate to")
|
.setTitle(KotlinFiltersBundle.message("title.navigate.to"))
|
||||||
.setItemChoosenCallback {
|
.setItemChoosenCallback {
|
||||||
val fileInfo = list.selectedValue as InlineInfo
|
val fileInfo = list.selectedValue as InlineInfo
|
||||||
OpenFileHyperlinkInfo(project, fileInfo.file, fileInfo.line).navigate(project)
|
OpenFileHyperlinkInfo(project, fileInfo.file, fileInfo.line).navigate(project)
|
||||||
@@ -53,8 +53,11 @@ class InlineFunctionHyperLinkInfo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
sealed class InlineInfo(val prefix: String, val file: VirtualFile, val line: Int) {
|
sealed class InlineInfo(val prefix: String, val file: VirtualFile, val line: Int) {
|
||||||
class CallSiteInfo(file: VirtualFile, line: Int) : InlineInfo("inline function call site", file, line)
|
class CallSiteInfo(file: VirtualFile, line: Int) :
|
||||||
class InlineFunctionBodyInfo(file: VirtualFile, line: Int) : InlineInfo("inline function body", file, line)
|
InlineInfo(KotlinFiltersBundle.message("text.inline.function.call.site"), file, line)
|
||||||
|
|
||||||
|
class InlineFunctionBodyInfo(file: VirtualFile, line: Int) :
|
||||||
|
InlineInfo(KotlinFiltersBundle.message("text.inline.function.body"), file, line)
|
||||||
}
|
}
|
||||||
|
|
||||||
private class InlineInfoCellRenderer : SimpleColoredComponent(), ListCellRenderer<InlineInfo> {
|
private class InlineInfoCellRenderer : SimpleColoredComponent(), ListCellRenderer<InlineInfo> {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.filters
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NonNls
|
||||||
|
import org.jetbrains.annotations.PropertyKey
|
||||||
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
|
|
||||||
|
@NonNls
|
||||||
|
private const val BUNDLE = "messages.KotlinFiltersBundle"
|
||||||
|
|
||||||
|
object KotlinFiltersBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
|
@JvmStatic
|
||||||
|
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user