package _VisualDVM.TestingSystem.SAPFOR.SapforSettings;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Database.Tables.iDBTable;
import Common.Visual.DataSetControlForm;
import _VisualDVM.TestingSystem.SAPFOR.SapforConfigurationSettings.SapforConfigurationSettings;
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsForm;
import _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;

import javax.swing.*;
import java.util.LinkedHashMap;
public class SapforSettingsDBTable extends iDBTable<SapforSettings> {
    public SapforSettingsDBTable() {
        super(SapforSettings.class);
    }
    @Override
    public String getSingleDescription() {
        return "параметры тестирования";
    }
    @Override
    public String getPluralDescription() {
        return "параметры тестирования";
    }
    @Override
    protected DataSetControlForm createUI(JPanel mountPanel) {
        return new SapforSettingsForm(this, mountPanel);
    }
    //-
    @Override
    public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
        LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
        res.put(SapforSettingsCommand.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
        res.put(SapforConfigurationSettings.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.PASSIVE));
        return res;
    }
}
