package _VisualDVM.Passes.Server;
import Common.Database.Database;
import Common.Database.Objects.DBObject;
import _VisualDVM.Global;
import _VisualDVM.Repository.Server.RepositoryServer;
public abstract class ServerObjectPass<S extends RepositoryServer, D extends DBObject> extends RepositoryPass<S, D> {
    protected Class<D> d; //класс объектов.
    //---
    public ServerObjectPass(S server_in, Class<D> d_in) {
        super(server_in);
        d = d_in;
    }
    public String getDescription_() {
        return "?";
    }
    @Override
    public String getDescription() {
        return getDb().getTable(d).getSingleDescription() + ": " + getDescription_();
    }
    //--
    @Override
    public String getButtonText() {
        return "";
    }
    //--
    protected Database getDb() {
        return server.db;
    }
    protected String getDBName() {
        return "";
    }
    @Override
    protected void performFinish() throws Exception {
        super.performFinish();
        Global.mainModule.getPass(getDb().getSynchronizePassCode()).Do();
    }
    //-
    public boolean fillObjectFields() throws Exception {
        return getDb().getTable(d).getUI().ShowAddObjectDialog(target);
    }
}
