package com.imyeyu.fx.ui.components.table;

import javafx.beans.property.BooleanProperty;
import javafx.geometry.Pos;
import javafx.scene.control.CheckBox;

/**
 * 复选框单元格
 *
 * @author 夜雨
 * @since 2023-03-14 14:56
 */
public abstract class CheckBoxTableCell<S> extends BindingTableCell<S, Boolean, BooleanProperty, CheckBox> {

	/** 默认构造器 */
	public CheckBoxTableCell() {
		setAlignment(Pos.CENTER);
	}

	@Override
	protected final CheckBox component() {
		return new CheckBox();
	}

	@Override
	protected final BooleanProperty componentValue(CheckBox node) {
		return node.selectedProperty();
	}
}
