package _VisualDVM.GlobalData.CompilerEnvironment.UI;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Tables.RendererMultiline;
import _VisualDVM.GlobalData.CompilerEnvironment.CompilerEnvironment;

import javax.swing.*;
public class CompilerEnvironmentsForm extends DataSetControlForm<CompilerEnvironment> {
    public CompilerEnvironmentsForm(DataSet<?, CompilerEnvironment> dataSource_in, JPanel mountPanel_in) {
        super(dataSource_in, mountPanel_in);
    }
    @Override
    protected void createColumns() {
        AddColumns(
                new ColumnInfo<CompilerEnvironment>("Значение") {
                    @Override
                    public Object getFieldAt(CompilerEnvironment object) {
                        return object.value;
                    }
                    @Override
                    public Class getRendererClass() {
                        return CompilerEnvironmentValueRenderer.class;
                    }
                    @Override
                    public Class getEditorClass() {
                        return CompilerEnvironmentValueEditor.class;
                    }
                },
                new ColumnInfo<CompilerEnvironment>("Описание") {
                    @Override
                    public Object getFieldAt(CompilerEnvironment object) {
                        return object.description;
                    }
                    @Override
                    public Class getRendererClass() {
                        return RendererMultiline.class;
                    }
                }
        );
    }
}
