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

org.grails.scaffolding.registry.input.BooleanInputRenderer.groovy Maven / Gradle / Ivy

The newest version!
package org.grails.scaffolding.registry.input

import org.grails.scaffolding.model.property.DomainProperty
import org.grails.scaffolding.registry.DomainInputRenderer

/**
 * The default renderer for rendering boolean properties
 *
 * @author James Kleeh
 */
class BooleanInputRenderer implements DomainInputRenderer {

    @Override
    boolean supports(DomainProperty domainProperty) {
        domainProperty.type in [boolean, Boolean]
    }

    @Override
    Closure renderInput(Map standardAttributes, DomainProperty domainProperty) {
        standardAttributes.type = "checkbox"
        return { ->
            input(standardAttributes)
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy