// @formatter:off
/*
* Unlicensed, generated by javafx.ftl
*/
package org.controlsfx.validation;
/**
* {@link ValidationSupport}建構器。
*
* @author JarReflectionDataLoader-1.0.0
* @version controlsfx-8.40.12.jar
* @param <Z> 要建構的物件型態(需繼承{@link ValidationSupport})
* @param <B> 建構器本身的型態(需繼承{@link ValidationSupportMaker})
*/
@javax.annotation.Generated("Generated by javafx.ftl")
@SuppressWarnings("all")
public class ValidationSupportMaker<Z extends ValidationSupport, B extends ValidationSupportMaker<Z, B>>
extends jxtn.jfx.makers.AbstractMaker<Z, B>
implements ValidationSupportMakerExt<Z, B>
{
private boolean hasErrorDecorationEnabled;
private boolean valErrorDecorationEnabled;
private boolean hasValidationDecorator;
private org.controlsfx.validation.decoration.ValidationDecoration valValidationDecorator;
private boolean bound1ErrorDecorationEnabled;
private boolean bound2ErrorDecorationEnabled;
private javafx.beans.value.ObservableValue<? extends Boolean> obsrv1ErrorDecorationEnabled;
private javafx.beans.property.Property<Boolean> obsrv2ErrorDecorationEnabled;
private boolean bound1ValidationDecorator;
private boolean bound2ValidationDecorator;
private javafx.beans.value.ObservableValue<? extends org.controlsfx.validation.decoration.ValidationDecoration> obsrv1ValidationDecorator;
private javafx.beans.property.Property<org.controlsfx.validation.decoration.ValidationDecoration> obsrv2ValidationDecorator;
@Override
public void applyTo(Z instance)
{
super.applyTo(instance);
if (this.hasErrorDecorationEnabled)
instance.setErrorDecorationEnabled(this.valErrorDecorationEnabled);
if (this.hasValidationDecorator)
instance.setValidationDecorator(this.valValidationDecorator);
if (this.bound1ErrorDecorationEnabled)
instance.errorDecorationEnabledProperty().bind(this.obsrv1ErrorDecorationEnabled);
if (this.bound2ErrorDecorationEnabled)
instance.errorDecorationEnabledProperty().bindBidirectional(this.obsrv2ErrorDecorationEnabled);
if (this.bound1ValidationDecorator)
instance.validationDecoratorProperty().bind(this.obsrv1ValidationDecorator);
if (this.bound2ValidationDecorator)
instance.validationDecoratorProperty().bindBidirectional(this.obsrv2ValidationDecorator);
}
/**
* 設定屬性{@link ValidationSupport#setErrorDecorationEnabled(boolean)}。
*
* @param value 新的屬性值
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public B errorDecorationEnabled(boolean value)
{
this.hasErrorDecorationEnabled = true;
this.valErrorDecorationEnabled = value;
return (B) this;
}
/**
* 設定屬性{@link ValidationSupport#setValidationDecorator(org.controlsfx.validation.decoration.ValidationDecoration)}。
*
* @param value 新的屬性值
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public B validationDecorator(org.controlsfx.validation.decoration.ValidationDecoration value)
{
this.hasValidationDecorator = true;
this.valValidationDecorator = value;
return (B) this;
}
/**
* 設定屬性{@link ValidationSupport#errorDecorationEnabledProperty}的連結。
*
* @param value 新的屬性連結(單向)
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public final B bindErrorDecorationEnabled(javafx.beans.value.ObservableValue<? extends Boolean> source)
{
java.util.Objects.requireNonNull(source);
this.bound1ErrorDecorationEnabled = true;
this.obsrv1ErrorDecorationEnabled = source;
this.bound2ErrorDecorationEnabled = false;
this.obsrv2ErrorDecorationEnabled = null;
return (B) this;
}
/**
* 設定屬性{@link ValidationSupport#errorDecorationEnabledProperty}的雙向連結。
*
* @param value 新的屬性連結(單向)
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public final B bindBidirectionalErrorDecorationEnabled(javafx.beans.property.Property<Boolean> source)
{
java.util.Objects.requireNonNull(source);
this.bound1ErrorDecorationEnabled = false;
this.obsrv1ErrorDecorationEnabled = null;
this.bound2ErrorDecorationEnabled = true;
this.obsrv2ErrorDecorationEnabled = source;
return (B) this;
}
/**
* 設定屬性{@link ValidationSupport#validationDecoratorProperty}的連結。
*
* @param value 新的屬性連結(單向)
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public final B bindValidationDecorator(javafx.beans.value.ObservableValue<? extends org.controlsfx.validation.decoration.ValidationDecoration> source)
{
java.util.Objects.requireNonNull(source);
this.bound1ValidationDecorator = true;
this.obsrv1ValidationDecorator = source;
this.bound2ValidationDecorator = false;
this.obsrv2ValidationDecorator = null;
return (B) this;
}
/**
* 設定屬性{@link ValidationSupport#validationDecoratorProperty}的雙向連結。
*
* @param value 新的屬性連結(單向)
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public final B bindBidirectionalValidationDecorator(javafx.beans.property.Property<org.controlsfx.validation.decoration.ValidationDecoration> source)
{
java.util.Objects.requireNonNull(source);
this.bound1ValidationDecorator = false;
this.obsrv1ValidationDecorator = null;
this.bound2ValidationDecorator = true;
this.obsrv2ValidationDecorator = source;
return (B) this;
}
/**
* 建構{@link ValidationSupport}物件。
*
* @return 新的{@link ValidationSupport}物件實體
*/
@Override
@SuppressWarnings("unchecked")
public ValidationSupport build()
{
ValidationSupport instance = new ValidationSupport();
this.applyTo((Z) instance);
this.doAfterBuild((Z) instance);
return instance;
}
}