Do not use hard coded string literals in UI

This commit is contained in:
Natalia Selezneva
2020-03-24 12:57:41 +03:00
parent 1b7f72020e
commit e300b30de1
4 changed files with 12 additions and 6 deletions
@@ -6,7 +6,10 @@ surround.with.error.cannot.perform.action=Cannot perform Surround With action to
surround.with.title=Surround with
notification.action.text.apply.context=Apply context
notification.action.text.enable.auto.reload=Enable auto-reload
notification.action.text.load.script.configuration=Load configuration
notification.text.there.is.a.new.script.context.available=There is a new script context available.
notification.text.script.configuration.has.been.changed=Script Configuration has been changed.
notification.description.text.script.configuration.has.been.changed=Load changes to get script code insight without loading the external Gradle project.
text.kotlin.loading.script.dependencies=Kotlin: Loading script dependencies...
text.loading.kotlin.script.definitions=Loading kotlin script definitions
text.loading.kotlin.script.dependencies=Loading kotlin script dependencies
@@ -17,6 +17,7 @@ import com.intellij.ui.EditorNotificationPanel
import com.intellij.ui.HyperlinkLabel
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.idea.core.script.settings.KotlinScriptingSettings
import org.jetbrains.kotlin.idea.core.util.KotlinIdeaCoreBundle
import org.jetbrains.kotlin.psi.UserDataProperty
interface ScriptConfigurationNotificationFactory {
@@ -88,13 +89,12 @@ class DefaultScriptConfigurationNotificationFactory : ScriptConfigurationNotific
) : EditorNotificationPanel() {
init {
setText("Script Configuration might be changed")
createComponentActionLabel("Load configuration") {
setText(KotlinIdeaCoreBundle.message("notification.text.script.configuration.has.been.changed"))
createComponentActionLabel(KotlinIdeaCoreBundle.message("notification.action.text.load.script.configuration")) {
onClick()
}
createComponentActionLabel("Enable auto-reload") {
createComponentActionLabel(KotlinIdeaCoreBundle.message("notification.action.text.enable.auto.reload")) {
onClick()
KotlinScriptingSettings.getInstance(project).isAutoReloadEnabled = true
}
@@ -48,4 +48,8 @@ display.name.kotlin.jvm=Kotlin/JVM
display.name.kotlin.js.for.node.js=Kotlin/JS for Node.js
display.name.kotlin.js.for.browser=Kotlin/JS for browser
comman.name.configure.kotlin=Configure Kotlin
command.name.configure.0=Configure {0}
command.name.configure.0=Configure {0}
notification.title.script.configuration.has.been.changed=Script configurations has been changed.
notification.text.script.configuration.has.been.changed=Gradle Project needs to be imported to load changes.
action.label.import.project=Import Project
action.label.enable.auto.import=Enable Auto-Import
@@ -15,7 +15,6 @@ import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.util.GradleConstants
fun runPartialGradleImport(project: Project) {
// TODO: partial import
val gradleSettings = ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID)
val projectSettings = gradleSettings.getLinkedProjectsSettings()
.filterIsInstance<GradleProjectSettings>()