package TestingSystem.SAPFOR.ServerSapfor;
import Common.Current;
import Common.Database.iDBTable;
import Common.UI.DataSetControlForm;
import Common.UI.Tables.TableRenderers;
import Common.UI.UI;
public class ServerSapforsDBTable extends iDBTable<ServerSapfor> {
    public ServerSapforsDBTable() {
        super(ServerSapfor.class);
    }
    @Override
    public String getSingleDescription() {
        return "SAPFOR";
    }
    @Override
    public String getPluralDescription() {
        return "SAPFOR";
    }
    @Override
    public Current CurrentName() {
        return Current.ServerSapfor;
    }
    @Override
    public String[] getUIColumnNames() {
        return new String[]{"версия", "дата сборки"};
    }
    @Override
    public Object getFieldAt(ServerSapfor object, int columnIndex) {
        switch (columnIndex) {
            case 1:
                return object.version;
            case 2:
                return object.getBuildDate();
        }
        return null;
    }
    @Override
    protected DataSetControlForm createUI() {
        return new DataSetControlForm(this) {
            @Override
            protected void AdditionalInitColumns() {
               // columns.get(0).setVisible(false);
                columns.get(2).setRenderer(TableRenderers.RendererDate);
            }
            @Override
            public void ShowCurrentObject() throws Exception {
                super.ShowCurrentObject();
                UI.getMainWindow().getTestingWindow().ShowCurrentServerSapfor();
            }
            @Override
            public void ShowNoCurrentObject() throws Exception {
                super.ShowNoCurrentObject();
                UI.getMainWindow().getTestingWindow().ShowNoServerSapfor();
            }
        };
    }
}
