From 5ad1d040ec7dd9c78759e4cbed7c169ffc23071a Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 2 Nov 2018 18:11:29 +0100 Subject: [PATCH] update selected value on set --- .../src/com/intellij/ui/layout/ChoicePropertyUiManager.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/layout/ChoicePropertyUiManager.kt b/platform/platform-impl/src/com/intellij/ui/layout/ChoicePropertyUiManager.kt index bb477bd51da0..73facf967efd 100644 --- a/platform/platform-impl/src/com/intellij/ui/layout/ChoicePropertyUiManager.kt +++ b/platform/platform-impl/src/com/intellij/ui/layout/ChoicePropertyUiManager.kt @@ -14,10 +14,11 @@ class ChoicePropertyUiManager(defaultChoice: T) { var selected: T get() = _selected set(value) { - updateSelection(components.firstOrNull { it.id == value }) + _selected = value + updateSelectedInfo(components.firstOrNull { it.id == value }) } - private fun updateSelection(newSelection: ChoiceInfo?) { + private fun updateSelectedInfo(newSelection: ChoiceInfo?) { currentSelection?.select(false) currentSelection = newSelection ?: return @@ -38,7 +39,8 @@ class ChoicePropertyUiManager(defaultChoice: T) { component.addActionListener(ActionListener { if (component.isSelected) { - updateSelection(info) + _selected = id + updateSelectedInfo(info) } }) }