package _VisualDVM.ProjectData.Messages.Recommendations.UI;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Tables.HeaderTextFilter;
import Common.Visual.Tables.RendererWrapText;
import _VisualDVM.ProjectData.Messages.Recommendations.MessageRecommendation;

import javax.swing.*;
public class RecommendationsForm extends DataSetControlForm<MessageRecommendation> {
    public RecommendationsForm(DataSet<?, MessageRecommendation> dataSource_in, JPanel mountPanel_in) {
        super(dataSource_in, mountPanel_in);
    }
    @Override
    protected boolean isPKVisible() {
        return false;
    }
    @Override
    protected boolean hasCheckBox() {
        return false;
    }
    @Override
    protected void createColumns() {
        AddColumns(
                new ColumnInfo<MessageRecommendation>("текст") {
                    @Override
                    public Object getFieldAt(MessageRecommendation object) {
                        return object.text;
                    }
                    @Override
                    public Class getRendererClass() {
                        return RendererWrapText.class;
                    }
                    @Override
                    public int getMinWidth() {
                        return 700;
                    }
                }
        );
    }
    @Override
    protected void createFilters() {
        AddFilters(new HeaderTextFilter(dataSource, 1, 72));
    }
    @Override
    protected boolean hasMenuBar() {
        return false;
    }
}
