package com.zhangmeng.online.exam.ui.components;

import javafx.beans.property.SimpleStringProperty;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;

/**
 * @author zm
 * @date 2025/3/19 17:03
 * @version: 1.0
 */
public class PaperSearchComponent extends HBox {

    private Button searchButton;

    private SimpleStringProperty questionName = new SimpleStringProperty();

    public PaperSearchComponent(double spacing) {
        super();

        this.setSpacing(spacing);
        Label label = new Label("问题名称：");
        label.setPadding(new Insets(5, 0, 0, 0));
        TextField questionName = new TextField();

        questionName.textProperty().bindBidirectional(this.questionName);

        searchButton = new Button("搜索");
        this.getChildren().add(label);
        this.getChildren().add(questionName);
        this.getChildren().add(searchButton);

    }

    public Button getSearchButton() {
        return searchButton;
    }

    public void setSearchButton(Button searchButton) {
        this.searchButton = searchButton;
    }

    public SimpleStringProperty getQuestionName() {
        return questionName;
    }

    public void setQuestionName(SimpleStringProperty questionName) {
        this.questionName = questionName;
    }
}
