User: kyle wood Date: 18 Jan 26 22:36 Revision: ca8e1bd4a9e7e3e4cf27d54ea5d3e4642d24217e Summary: Handle default values in GradlePluginSelectorCreatorProperty TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=10397&personal=false Index: src/main/kotlin/creator/custom/types/GradlePluginSelectorCreatorProperty.kt =================================================================== --- src/main/kotlin/creator/custom/types/GradlePluginSelectorCreatorProperty.kt (revision d68645f00c4fd2d1693085cc94158ae4f9547894) +++ src/main/kotlin/creator/custom/types/GradlePluginSelectorCreatorProperty.kt (revision ca8e1bd4a9e7e3e4cf27d54ea5d3e4642d24217e) @@ -57,7 +57,9 @@ private val loadingVersionsProperty = graph.property(true) private val loadingVersionsStatusProperty = graph.property("") - override val graphProperty: GraphProperty = graph.property(Holder(SemanticVersion(emptyList()), false)) + private val defaultValue = createDefaultValue(descriptor.default) + + override val graphProperty: GraphProperty = graph.property(defaultValue) var property: Holder by graphProperty private val versionsModel = graph.property>(emptySet()) @@ -66,6 +68,9 @@ private val enabledProperty = graphProperty.transform({ it.enabled }, { property.copy(enabled = it) }) override fun createDefaultValue(raw: Any?): Holder { + if (raw is Boolean) { + return Holder(SemanticVersion(emptyList()), raw) + } if (raw is String) { return deserialize(raw) } @@ -108,8 +113,6 @@ combobox.component.addItem(version) } } - - }.propertyVisibility() }