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

com.netgrif.application.engine.petrinet.domain.dataset.ChoiceField.groovy Maven / Gradle / Ivy

Go to download

System provides workflow management functions including user, role and data management.

There is a newer version: 6.4.0
Show newest version
package com.netgrif.application.engine.petrinet.domain.dataset

import com.netgrif.application.engine.petrinet.domain.I18nString
import com.netgrif.application.engine.petrinet.domain.dataset.logic.action.runner.Expression

abstract class ChoiceField extends Field {

    protected Set choices
    protected Expression choicesExpression

    ChoiceField() {
        super()
        choices = new LinkedHashSet()
    }

    ChoiceField(List values) {
        this()
        if (values != null)
            this.choices.addAll(values)
    }

    ChoiceField(Expression expression) {
        this()
        this.choicesExpression = expression
    }

    Set getChoices() {
        return choices
    }

    void setChoices(Set choices) {
        this.choices = choices
    }

    Expression getExpression() {
        return choicesExpression
    }

    void setExpression(Expression expression) {
        this.choicesExpression = expression
    }

    void setChoicesFromStrings(Collection choices) {
        this.choices = new LinkedHashSet<>()
        choices.each {
            this.choices.add(new I18nString(it))
        }
    }

    boolean isDynamic() {
        return this.choicesExpression != null
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy