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

import com.ecep.contract.controller.tab.TabSkin;

import javafx.scene.control.Tab;

public class VendorGroupBaseTabSkin extends AbstVendorGroupBasedTabSkin implements TabSkin {

    public VendorGroupBaseTabSkin(VendorGroupWindowController controller) {
        super(controller);
    }

    @Override
    public Tab getTab() {
        return controller.baseInfoTab;
    }

    @Override
    public void initializeTab() {
        controller.nameField.textProperty().bindBidirectional(viewModel.getName());
        controller.codeField.textProperty().bindBidirectional(viewModel.getCode());
        controller.activeField.selectedProperty().bindBidirectional(viewModel.getActive());
        controller.priceComparisonField.selectedProperty().bindBidirectional(viewModel.getPriceComparison());
        controller.requireQuotationSheetForBidField.disableProperty().bind(controller.priceComparisonField.selectedProperty().not());
        controller.requireQuotationSheetForBidField.selectedProperty().bindBidirectional(viewModel.getRequireQuotationSheetForBid());
        controller.descriptionField.textProperty().bindBidirectional(viewModel.getDescription());
    }
}
