All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.form._Form.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.form

import net.nemerosa.ontrack.model.structure.NameDescription

/**
 * Creates a [Selection] field from a list of enums.
 *
 * @param E Type of enum
 * @param name Name for this field
 * @return Field
 */
inline fun > selection(name: String, displayName: (E) -> String): Selection =
        Selection.of(name)
                .items(
                        enumValues().map {
                            NameDescription.nd(
                                    it.name,
                                    displayName(it)
                            )
                        }
                )
                .itemId("name")
                .itemName("description")




© 2015 - 2025 Weber Informatics LLC | Privacy Policy