Wizard: flatten second UI step to fit new UI

This commit is contained in:
Ilya Kirillov
2020-03-16 12:19:57 +03:00
parent 586917ef3d
commit f3ca37fbac
10 changed files with 147 additions and 103 deletions
@@ -59,7 +59,7 @@ fun <T> withSettingsOf(
): T = function(IdBasedTemplateEnvironment(template, identificator))
abstract class Template : SettingsOwner, EntitiesOwnerDescriptor {
abstract class Template : SettingsOwner, EntitiesOwnerDescriptor, DisplayableSettingItem {
final override fun <V : Any, T : SettingType<V>> settingDelegate(
create: (path: String) -> SettingBuilder<V, T>
): ReadOnlyProperty<Any, TemplateSetting<V, T>> = cached { name ->
@@ -70,6 +70,8 @@ abstract class Template : SettingsOwner, EntitiesOwnerDescriptor {
abstract val htmlDescription: String
abstract val moduleTypes: Set<ModuleType>
override val text: String get() = title
open fun isApplicableTo(module: Module): Boolean = true
open val settings: List<TemplateSetting<*, *>> = emptyList()
@@ -133,6 +135,11 @@ abstract class Template : SettingsOwner, EntitiesOwnerDescriptor {
"projectName" to StructurePlugin::name.settingValue.capitalize()
)
override fun equals(other: Any?): Boolean =
other.safeAs<Template>()?.id == id
override fun hashCode(): Int = id.hashCode()
@Suppress("UNCHECKED_CAST")
final override fun <V : DisplayableSettingItem> dropDownSetting(
title: String,