@@ -6,6 +6,7 @@ import javax.swing.JComponent
66
77class AppSettingsConfigurable : Configurable {
88 private var mySettingsComponent: AppSettingsComponent ? = null
9+ private val settings = AppSettingsState .instance
910
1011 override fun getDisplayName (): @Nls (capitalization = Nls .Capitalization .Title ) String =
1112 " AVA Test Runner Run Configuration Generator"
@@ -18,30 +19,31 @@ class AppSettingsConfigurable : Configurable {
1819 }
1920
2021 override fun isModified (): Boolean {
21- var modifiedInputPath = mySettingsComponent!! .inputPathText != AppSettingsState .inputPath
22- modifiedInputPath = modifiedInputPath or (mySettingsComponent!! .inputPathText != AppSettingsState .inputPath)
22+ var modifiedInputPath = mySettingsComponent!! .inputPathText != settings.inputPath
23+ modifiedInputPath =
24+ modifiedInputPath or (mySettingsComponent!! .inputPathText != settings.inputPath)
2325
24- var modifiedSelectedModel = mySettingsComponent!! .selectedCommand != AppSettingsState .selectedCommand
26+ var modifiedSelectedModel = mySettingsComponent!! .selectedCommand != settings .selectedCommand
2527 modifiedSelectedModel =
26- modifiedSelectedModel or (mySettingsComponent!! .selectedCommand != AppSettingsState .selectedCommand)
28+ modifiedSelectedModel or (mySettingsComponent!! .selectedCommand != settings .selectedCommand)
2729
28- var modifiedNPMScriptsText = mySettingsComponent!! .npmScriptsText != AppSettingsState .npmScriptsText
30+ var modifiedNPMScriptsText = mySettingsComponent!! .npmScriptsText != settings .npmScriptsText
2931 modifiedNPMScriptsText =
30- modifiedNPMScriptsText or (mySettingsComponent!! .npmScriptsText != AppSettingsState .npmScriptsText)
32+ modifiedNPMScriptsText or (mySettingsComponent!! .npmScriptsText != settings .npmScriptsText)
3133
3234 return modifiedInputPath || modifiedSelectedModel || modifiedNPMScriptsText
3335 }
3436
3537 override fun apply () {
36- AppSettingsState .inputPath = mySettingsComponent!! .inputPathText
37- AppSettingsState .selectedCommand = mySettingsComponent!! .selectedCommand
38- AppSettingsState .npmScriptsText = mySettingsComponent!! .npmScriptsText
38+ settings .inputPath = mySettingsComponent!! .inputPathText
39+ settings .selectedCommand = mySettingsComponent!! .selectedCommand
40+ settings .npmScriptsText = mySettingsComponent!! .npmScriptsText
3941 }
4042
4143 override fun reset () {
42- mySettingsComponent!! .inputPathText = AppSettingsState .inputPath
43- mySettingsComponent!! .selectedCommand = AppSettingsState .selectedCommand
44- mySettingsComponent!! .npmScriptsText = AppSettingsState .npmScriptsText
44+ mySettingsComponent!! .inputPathText = settings .inputPath
45+ mySettingsComponent!! .selectedCommand = settings .selectedCommand
46+ mySettingsComponent!! .npmScriptsText = settings .npmScriptsText ? : " "
4547 }
4648
4749 override fun disposeUIResources () {
0 commit comments