com.innovenso.townplan.dsl.views.FlowViewConfigurer.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of innovenso-townplanner-dsl Show documentation
Show all versions of innovenso-townplanner-dsl Show documentation
Domain Specific Language for the Innovenso Townplanner
package com.innovenso.townplan.dsl.views
import com.innovenso.townplan.api.command.AddFlowViewCommand
import com.innovenso.townplan.api.command.AddFlowViewStepCommand
import com.innovenso.townplan.api.value.RelationshipType
import com.innovenso.townplan.domain.TownPlanImpl
import com.innovenso.townplan.dsl.TownPlanConfigurer
import groovy.transform.NamedDelegate
import groovy.transform.NamedVariant
import lombok.NonNull
import static groovy.lang.Closure.DELEGATE_ONLY
class FlowViewConfigurer extends AbstractViewConfigurer {
boolean showStepCounter
FlowViewConfigurer(@NonNull TownPlanConfigurer townPlanConfigurer) {
super(townPlanConfigurer)
}
def showStepCounter(boolean show) {
this.showStepCounter = show
}
@Override
String viewType() {
return "Flow"
}
FlowViewStepConfigurer request(@DelegatesTo(value = FlowViewStepConfigurer, strategy = DELEGATE_ONLY) Closure configurer) {
townPlanConfigurer.flowViewStep configureConfigurer(new FlowViewStepConfigurer(townPlanConfigurer, this.getKey(), false), configurer)
}
FlowViewStepConfigurer message(@DelegatesTo(value = FlowViewStepConfigurer, strategy = DELEGATE_ONLY) Closure configurer) {
townPlanConfigurer.flowViewStep configureConfigurer(new FlowViewStepConfigurer(townPlanConfigurer, this.getKey(), false), configurer)
}
FlowViewStepConfigurer response(@DelegatesTo(value = FlowViewStepConfigurer, strategy = DELEGATE_ONLY) Closure configurer) {
townPlanConfigurer.flowViewStep configureConfigurer(new FlowViewStepConfigurer(townPlanConfigurer, this.getKey(), true), configurer)
}
@Override
def apply(@NonNull TownPlanImpl townPlan) {
townPlan.execute(AddFlowViewCommand.builder()
.key(this.getKey())
.title(this.getTitle())
.description(this.getDescription())
.showStepCounter(this.getShowStepCounter())
.build())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy