Configuration: Ensure facet UI is initialized in apply() call

#KT-27187 Fixed
This commit is contained in:
Alexey Sedunov
2018-10-02 15:20:41 +03:00
parent 3fcf6e7719
commit 84d9f8250c
2 changed files with 4 additions and 3 deletions
@@ -241,7 +241,7 @@ class KotlinFacetEditorGeneralTab(
}
}
fun initialize() {
fun initializeIfNeeded() {
if (isInitialized) return
editor.initialize()
@@ -277,7 +277,7 @@ class KotlinFacetEditorGeneralTab(
}
override fun onTabEntering() {
initialize()
initializeIfNeeded()
}
override fun isModified(): Boolean {
@@ -298,6 +298,7 @@ class KotlinFacetEditorGeneralTab(
}
override fun apply() {
initializeIfNeeded()
validateOnce {
editor.compilerConfigurable.apply()
with(configuration.settings) {
@@ -39,7 +39,7 @@ class MultipleKotlinFacetEditor(
override fun createComponent(): JComponent? {
return KotlinFacetEditorGeneralTab.EditorComponent(project, null).apply {
initialize()
editors.flatMap { it.editorTabs.filterIsInstance<KotlinFacetEditorGeneralTab>() }.forEach { it.initialize() }
editors.flatMap { it.editorTabs.filterIsInstance<KotlinFacetEditorGeneralTab>() }.forEach { it.initializeIfNeeded() }
helper.bind(useProjectSettingsCheckBox, editors) { it.tabEditor.useProjectSettingsCheckBox }
helper.bind(targetPlatformComboBox, editors) { it.tabEditor.targetPlatformComboBox }
with(compilerConfigurable) {