package _VisualDVM.ComponentsServer.BugReportFile.UI;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReportFile.BugReportFile;
import _VisualDVM.Global;

import javax.swing.*;
public class BugReportFilesForm extends DataSetControlForm<BugReportFile> {
    public BugReportFilesForm(DataSet<?, BugReportFile> dataSource_in, JPanel mountPanel_in) {
        super(dataSource_in, mountPanel_in);
    }
    @Override
    protected void createColumns() {
        AddColumns(
                new ColumnInfo<BugReportFile>("имя") {
                    @Override
                    public Object getFieldAt(BugReportFile object) {
                        return object.name;
                    }
                }
        );
    }
    @Override
    public boolean isObjectVisible(BugReportFile object) {
        return super.isObjectVisible(object)&&Global.componentsServer.db.getTable(BugReport.class).getUI().matchCurrentID(object.bugreport_id);
    }
}
