package _VisualDVM.GlobalData.Tasks.CompilationTask;
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.GlobalData.Tasks.CompilationTask.UI.CompilationTasksForm;
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;

import javax.swing.*;
import java.util.LinkedHashMap;
public class CompilationTasksDBTable extends iDBTable<CompilationTask> {
    public CompilationTasksDBTable() {
        super(CompilationTask.class);
    }
    @Override
    public String getSingleDescription() {
        return "задача на компиляцию";
    }
    @Override
    public String getPluralDescription() {
        return "задачи на компиляцию";
    }
    @Override
    public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
        LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
        res.put(RunTask.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
        return res;
    }
    @Override
    protected DataSetControlForm createUI(JPanel mountPanel) {
        return new CompilationTasksForm(this, mountPanel);
    }
}
