package com.ecep.contract.controller;

import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.vm.IdentityViewModel;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.stage.WindowEvent;

public abstract class AbstManagerWindowController<T extends IdentityEntity, TV extends IdentityViewModel<T>, Skin extends ManagerSkin>
        extends AbstEntityBasedController<T, TV, Skin> {

    // searcher
    @FXML
    public TextField searchKeyField;
    @FXML
    public Button searchBtn;

    @FXML
    public HBox footer;
    // paging
    @FXML
    public Button previousPageBtn;
    @FXML
    public Button nextPageBtn;
    @FXML
    public TextField currentPageNumberField;

    @Override
    public void onShown(WindowEvent windowEvent) {
        // fixed fx:include uninitialized issue
        previousPageBtn = (Button) footer.lookup("#previousPageBtn");
        nextPageBtn = (Button) footer.lookup("#nextPageBtn");
        currentPageNumberField = (TextField) footer.lookup("#currentPageNumberField");
        leftStatusLabel = (Label) footer.lookup("#leftStatusLabel");

        //
        super.onShown(windowEvent);
    }


}
