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

import javax.swing.*;
public class CompilerOptionsForm extends DataSetControlForm<CompilerOption> {
    public CompilerOptionsForm(DataSet<?, CompilerOption> dataSource_in, JPanel mountPanel_in) {
        super(dataSource_in, mountPanel_in);
    }
    @Override
    protected void createColumns() {
        AddColumns(
                new ColumnInfo<CompilerOption>("Параметр") {
                    @Override
                    public Object getFieldAt(CompilerOption object) {
                        return object.parameterName;
                    }
                    @Override
                    public Class getRendererClass() {
                        return CompilerOptionParameterNameRenderer.class;
                    }
                },
                new ColumnInfo<CompilerOption>("Значение") {
                    @Override
                    public Object getFieldAt(CompilerOption object) {
                        return object.parameterValue;
                    }
                    @Override
                    public Class getRendererClass() {
                        return CompilerOptionParameterValueRenderer.class;
                    }
                    @Override
                    public Class getEditorClass() {
                        return CompilerOptionParameterValueEditor.class;
                    }
                },
                new ColumnInfo<CompilerOption>("Описание") {
                    @Override
                    public Object getFieldAt(CompilerOption object) {
                        return object.description;
                    }
                    @Override
                    public Class getRendererClass() {
                        return RendererMultiline.class;
                    }
                }
        );
    }
}
