package _VisualDVM.GlobalData.FileObject;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;

import static Common.Visual.Tables.TableRenderers.RendererDate;
public class DirInfosDataSet extends DataSet<String, DirInfo> {
    public DirInfosDataSet() {
        super(String.class, DirInfo.class);
    }
    @Override
    protected DataSetControlForm createUI() {
        return new DataSetControlForm(this) {
            @Override
            protected void AdditionalInitColumns() {
                columns.get(1).setRenderer(RendererDate);
            }
        };
    }
    @Override
    public String[] getUIColumnNames() {
        return new String[]{
                "дата изменения"};
    }
    @Override
    public Object getFieldAt(DirInfo object, int columnIndex) {
        switch (columnIndex) {
            case 1:
                return object.getDate();
            default:
                return null;
        }
    }
}
