package com.ecep.contract.controller.vendor.group;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.ecep.contract.controller.AbstManagerWindowController;
import com.ecep.contract.model.VendorGroup;
import com.ecep.contract.service.VendorGroupService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vm.VendorGroupViewModel;

import javafx.scene.control.TableColumn;
import javafx.stage.WindowEvent;

/**
 * 供应商类型管理窗口控制器
 */
@Lazy
@Scope("prototype")
@Component
@FxmlPath("/ui/company/vendor/group-manager.fxml")
public class VendorGroupManagerWindowController
        extends AbstManagerWindowController<VendorGroup, VendorGroupViewModel, VendorGroupManagerSkin> {
    public TableColumn<VendorGroupViewModel, Number> idColumn;
    public TableColumn<VendorGroupViewModel, String> codeColumn;
    public TableColumn<VendorGroupViewModel, String> nameColumn;
    public TableColumn<VendorGroupViewModel, String> descriptionColumn;

    @Autowired
    VendorGroupService vendorGroupService;



    @Override
    public void onShown(WindowEvent windowEvent) {
        super.onShown(windowEvent);
        getTitle().set("供应商类型管理");
    }

    @Override
    public VendorGroupService getViewModelService() {
        return vendorGroupService;
    }

    @Override
    protected VendorGroupManagerSkin createDefaultSkin() {
        VendorGroupManagerSkin skin = new VendorGroupManagerSkin(this);
        skin.setVendorGroupService(vendorGroupService);
        return skin;
    }

}
