Configuration: Ensure facet UI is initialized in apply() call
#KT-27187 Fixed
This commit is contained in:
@@ -241,7 +241,7 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun initialize() {
|
fun initializeIfNeeded() {
|
||||||
if (isInitialized) return
|
if (isInitialized) return
|
||||||
|
|
||||||
editor.initialize()
|
editor.initialize()
|
||||||
@@ -277,7 +277,7 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onTabEntering() {
|
override fun onTabEntering() {
|
||||||
initialize()
|
initializeIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isModified(): Boolean {
|
override fun isModified(): Boolean {
|
||||||
@@ -298,6 +298,7 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun apply() {
|
override fun apply() {
|
||||||
|
initializeIfNeeded()
|
||||||
validateOnce {
|
validateOnce {
|
||||||
editor.compilerConfigurable.apply()
|
editor.compilerConfigurable.apply()
|
||||||
with(configuration.settings) {
|
with(configuration.settings) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class MultipleKotlinFacetEditor(
|
|||||||
override fun createComponent(): JComponent? {
|
override fun createComponent(): JComponent? {
|
||||||
return KotlinFacetEditorGeneralTab.EditorComponent(project, null).apply {
|
return KotlinFacetEditorGeneralTab.EditorComponent(project, null).apply {
|
||||||
initialize()
|
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(useProjectSettingsCheckBox, editors) { it.tabEditor.useProjectSettingsCheckBox }
|
||||||
helper.bind(targetPlatformComboBox, editors) { it.tabEditor.targetPlatformComboBox }
|
helper.bind(targetPlatformComboBox, editors) { it.tabEditor.targetPlatformComboBox }
|
||||||
with(compilerConfigurable) {
|
with(compilerConfigurable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user