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

import com.imyeyu.fx.icon.TimiFXIcon;
import com.imyeyu.fx.icon.TimiIcon;
import com.imyeyu.fx.ui.TimiFXUI;
import javafx.beans.binding.Bindings;
import javafx.scene.control.SelectionMode;

/**
 * 混合文件选择，可以选择文件也可以选择目录
 *
 * @author 夜雨
 * @since 2023-01-24 19:07
 */
public class AlertFileBlendSelector extends AbstractAlertFile {

	/**
	 * 构造器
	 *
	 * @param mode 选择模式
	 */
	public AlertFileBlendSelector(SelectionMode mode) {
		super(mode);

		// 确认
		confirm.disableProperty().bind(Bindings.isEmpty(tree.getSelectionModel().getSelectedItems()));

		getIcons().setAll(TimiFXIcon.rerender(TimiIcon.FOLDER));
		setTitle(TimiFXUI.MULTILINGUAL.text("file.tips.select_directory"));
	}
}
