package com.hmsoft.common.cell;


import com.hmsoft.common.util.ShoolDateUtil;
import com.hmsoft.model.School;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TableCell;

public class CombSelectTableCell<S, T> extends TableCell<S, T> {

	private ComboBox<School> comboBox;
	private ObservableValue<T> ov;
	
	public CombSelectTableCell() {
        this.comboBox = new ComboBox<School>();
        this.comboBox.setMinWidth(180);
        this.comboBox.getItems().addAll(ShoolDateUtil.loadSchoolData());
        setGraphic(comboBox);
	}
	
    @Override
    protected void updateItem(T item, boolean empty) {
        //System.out.println("empty---" + empty);
        super.updateItem(item, empty);
        //this.setTextFill(Color.RED);
        if (empty) {
            setText(null);
            setGraphic(null);
        } else {
            setGraphic(comboBox);
        }
    }
}
