i18n: add bundle for idea/filters

This commit is contained in:
Dmitry Gridin
2020-02-20 20:08:44 +07:00
parent d26a75055d
commit dab6a12121
3 changed files with 27 additions and 3 deletions
@@ -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)
list.cellRenderer = InlineInfoCellRenderer()
val popup = JBPopupFactory.getInstance().createListPopupBuilder(list)
.setTitle("Navigate to")
.setTitle(KotlinFiltersBundle.message("title.navigate.to"))
.setItemChoosenCallback {
val fileInfo = list.selectedValue as InlineInfo
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) {
class CallSiteInfo(file: VirtualFile, line: Int) : InlineInfo("inline function call site", file, line)
class InlineFunctionBodyInfo(file: VirtualFile, line: Int) : InlineInfo("inline function body", file, line)
class CallSiteInfo(file: VirtualFile, line: Int) :
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> {
@@ -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)
}