// @formatter:off
/*
* Unlicensed, generated by javafx.ftl
*/
package javafx.scene.control;
/**
* {@link ColorPicker}建構器。
*
* @author JarReflectionDataLoader-1.0.0
* @version jfxrt.jar
* @param <Z> 要建構的物件型態(需繼承{@link ColorPicker})
* @param <B> 建構器本身的型態(需繼承{@link ColorPickerMaker})
*/
@javax.annotation.Generated("Generated by javafx.ftl")
@SuppressWarnings("all")
public class ColorPickerMaker<Z extends ColorPicker, B extends ColorPickerMaker<Z, B>>
extends javafx.scene.control.ComboBoxBaseMaker<javafx.scene.paint.Color, Z, B>
implements ColorPickerMakerExt<Z, B>
{
private boolean hasCustomColors;
private java.util.Collection<javafx.scene.paint.Color> valCustomColors;
@Override
public void applyTo(Z instance)
{
super.applyTo(instance);
if (this.hasCustomColors)
instance.getCustomColors().addAll(this.valCustomColors);
}
/**
* 設定集合屬性{@link ColorPicker#getCustomColors}的內容。
*
* @param value 新的集合內容
* @return 目前的建構器(this)
* @deprecated 屬性值並非{@link javafx.collections.ObservableList}
*/
@Deprecated
@SuppressWarnings("unchecked")
public final B customColors(java.util.Collection<? extends javafx.scene.paint.Color> value)
{
this.hasCustomColors = true;
this.valCustomColors = (java.util.Collection<javafx.scene.paint.Color>) value;
return (B) this;
}
/**
* 設定集合屬性{@link ColorPicker#getCustomColors}的內容。
*
* @param value 新的集合內容
* @return 目前的建構器(this)
*/
@SafeVarargs
@SuppressWarnings("unchecked")
public final B customColors(javafx.scene.paint.Color... value)
{
this.hasCustomColors = true;
this.valCustomColors = java.util.Arrays.asList(value);
return (B) this;
}
/**
* 增加集合屬性{@link ColorPicker#getCustomColors}的內容。
*
* @param value 新的集合內容
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public final B customColorsAdd(java.util.Collection<? extends javafx.scene.paint.Color> value)
{
java.util.Objects.requireNonNull(value);
this.hasCustomColors = true;
if (this.valCustomColors == null)
this.valCustomColors = new java.util.ArrayList<>(value.size());
this.valCustomColors.addAll(value);
return (B) this;
}
/**
* 增加集合屬性{@link ColorPicker#getCustomColors}的內容。
*
* @param value 新的集合內容
* @return 目前的建構器(this)
*/
@SafeVarargs
@SuppressWarnings("unchecked")
public final B customColorsAdd(javafx.scene.paint.Color... value)
{
java.util.Objects.requireNonNull(value);
this.hasCustomColors = true;
if (this.valCustomColors == null)
this.valCustomColors = new java.util.ArrayList<>(value.length);
this.valCustomColors.addAll(java.util.Arrays.asList(value));
return (B) this;
}
/**
* 增加集合屬性{@link ColorPicker#getCustomColors}的內容,排除null項目。
*
* @param value 新的集合內容
* @return 目前的建構器(this)
*/
@SuppressWarnings("unchecked")
public final B customColorsAddNonNull(java.util.Collection<? extends javafx.scene.paint.Color> value)
{
java.util.Objects.requireNonNull(value);
this.hasCustomColors = true;
if (this.valCustomColors == null)
this.valCustomColors = new java.util.ArrayList<>(value.size());
for (javafx.scene.paint.Color i : value)
if (i != null)
this.valCustomColors.add(i);
return (B) this;
}
/**
* 增加集合屬性{@link ColorPicker#getCustomColors}的內容,排除null項目。
*
* @param value 新的集合內容
* @return 目前的建構器(this)
*/
@SafeVarargs
@SuppressWarnings("unchecked")
public final B customColorsAddNonNull(javafx.scene.paint.Color... value)
{
java.util.Objects.requireNonNull(value);
this.hasCustomColors = true;
if (this.valCustomColors == null)
this.valCustomColors = new java.util.ArrayList<>(value.length);
for (javafx.scene.paint.Color i : value)
if (i != null)
this.valCustomColors.add(i);
return (B) this;
}
/**
* 建構{@link ColorPicker}物件。
*
* @return 新的{@link ColorPicker}物件實體
*/
@Override
@SuppressWarnings("unchecked")
public ColorPicker build()
{
ColorPicker instance = new ColorPicker();
this.applyTo((Z) instance);
this.doAfterBuild((Z) instance);
return instance;
}
/**
* 建構{@link ColorPicker}物件。
*
* @return 新的{@link ColorPicker}物件實體
*/
@SuppressWarnings("unchecked")
public ColorPicker build(javafx.scene.paint.Color arg0)
{
ColorPicker instance = new ColorPicker(arg0);
this.applyTo((Z) instance);
this.doAfterBuild((Z) instance);
return instance;
}
}