package com.imyeyu.fx.ui.examples.component.sidebar;

import com.imyeyu.fx.ui.TimiFXUI;
import com.imyeyu.fx.ui.examples.TimiFXExamples;
import com.imyeyu.fx.ui.examples.component.AbstractPane;
import com.imyeyu.fx.ui.examples.view.pages.AlertDemo;
import com.imyeyu.fx.ui.examples.view.pages.BindingsConfigDemo;
import com.imyeyu.fx.ui.examples.view.pages.ButtonDemo;
import com.imyeyu.fx.ui.examples.view.pages.ExtendDemo;
import com.imyeyu.fx.ui.examples.view.pages.PopupTipsDemo;
import com.imyeyu.fx.ui.examples.view.pages.RunAsyncDemo;
import com.imyeyu.fx.ui.examples.view.pages.Style;
import com.imyeyu.fx.ui.examples.view.pages.Welcome;
import com.imyeyu.fx.ui.examples.view.pages.animation.InterpolatorDemo;
import com.imyeyu.fx.ui.examples.view.pages.animation.SmoothScrollDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.DateTimePickerDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.EditableTableCellDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.FileTreeViewDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.IconButtonDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.IconPickerDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.LabelProgressBarDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.NavigationDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.NumberFieldDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.FilledSliderDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.SelectableLabelDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.TextAreaEditorDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.TitleLabelDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.ToggleIconDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.XPaginationDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.XTabPaneDemo;
import com.imyeyu.fx.ui.examples.view.pages.component.XTreeViewDemo;
import com.imyeyu.fx.ui.examples.view.pages.other.DraggableNodeDemo;
import com.imyeyu.fx.ui.examples.view.pages.other.DraggableWindowDemo;
import com.imyeyu.fx.ui.examples.view.pages.other.ScreenFXDemo;
import com.imyeyu.fx.ui.examples.view.pages.other.TrayFXDemo;
import javafx.scene.Node;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 导航项
 *
 * @author 夜雨
 * @since 2022-08-26 14:56
 */
@Getter
@AllArgsConstructor
public enum SidebarItem {

	/** 欢迎页 */
	WELCOME(Welcome.class, TimiFXUI.MULTILINGUAL.text("fx.example.welcome")),

	/** 样式 */
	STYLE(Style.class, TimiFXUI.MULTILINGUAL.text("style")),

	/** 扩展工具 */
	EXTEND_TOOLS(ExtendDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.extend_tools")),

	/** 配置绑定 */
	BINDING_CONFIG(BindingsConfigDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.binding_config")),

	/** 弹窗 */
	ALERT(AlertDemo.class, TimiFXUI.MULTILINGUAL.text("alert")),

	/** 弹出提示 */
	POPUP_TIPS(PopupTipsDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.popup_tips")),

	/** 异步任务 */
	RUN_ASYNC(RunAsyncDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.run_async")),

	// ---------- 动画 ----------

	/** 动画插值器 */
	INTERPOLATOR(InterpolatorDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.interpolator")),

	/** 平滑滚动 */
	SMOOTH_SCROLL(SmoothScrollDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.smooth_scroll")),

	// ---------- 组件 ----------

	/** 按钮组 */
	BUTTON(ButtonDemo.class, "切换按钮组"),

	/** 详细时间选择器 */
	DATE_TIME_PICKER(DateTimePickerDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.date_time_picker")),

	/** 表格可编辑单元格 */
	EDITABLE_TABLE_CELL(EditableTableCellDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.editable_table_cell")),

	/** 文件树视图 */
	FILE_TREE_VIEW(FileTreeViewDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.file_tree_view")),

	/** 图标按钮 */
	ICON_BUTTON(IconButtonDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.icon_button")),

	/** 图标选择器 */
	ICON_PICKER(IconPickerDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.icon_picker")),

	/** 标签进度 */
	LABEL_PROGRESS_BAR(LabelProgressBarDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.label_progress_bar")),

	/** 导航 */
	NAVIGATION(NavigationDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.navigation")),

	/** 数字输入 */
	NUMBER_FIELD(NumberFieldDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.number_field")),

	/** 进度调整 */
	FILLED_SLIDER(FilledSliderDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.progress_slider")),

	/** 可选标签 */
	SELECTABLE_LABEL(SelectableLabelDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.selectable_label")),

	/** 文本域编辑器 */
	TEXT_AREA_EDITOR(TextAreaEditorDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.text_area_editor")),

	/** 标题标签 */
	TITLE_LABEL(TitleLabelDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.title_label")),

	/** 切换图标 */
	TOGGLE_ICON(ToggleIconDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.toggle_icon")),

	/** 分页 */
	X_PAGINATION(XPaginationDemo.class, TimiFXUI.MULTILINGUAL.text("pagination")),

	/** 标签面板 */
	X_TAB_PANE(XTabPaneDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.x_tab_pane")),

	/** 树形视图 */
	X_TREE_VIEW(XTreeViewDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.x_tree_view")),

	// ---------- 其他 ----------

	/** 可拖动组件 */
	DRAGGABLE_NODE(DraggableNodeDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.draggable_node")),

	/** 可拖动窗体 */
	DRAGGABLE_WINDOW(DraggableWindowDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.draggable_window")),

	/** 多屏操作 */
	SCREEN(ScreenFXDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.screen")),

	/** 托盘操作 */
	TRAY(TrayFXDemo.class, TimiFXUI.MULTILINGUAL.text("fx.example.tray"));

	/** 页面控制反转类 */
	final Class<? extends AbstractPane> page;

	/** 文本 */
	final String text;

	/** @return 从 TimiInject 控制反转对象获取该页面 */
	public Node getIOCPage() {
		return TimiFXExamples.getInject().getBean(page);
	}
}
