com.netgrif.application.engine.petrinet.domain.dataset.ChoiceField.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
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