package Visual_DVM_2021.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ServerObjectsCache.DVMConfigurationCache;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
import _VisualDVM.TestingSystem.DVM.DVMSettings.DVMSettings;
import Visual_DVM_2021.Passes.ShowCurrentConfigurationTests;

import java.util.Vector;
public class ShowCurrentDVMConfigurationTests extends ShowCurrentConfigurationTests<DVMConfiguration> {
    @Override
    public Current currentName() {
        return Current.DVMConfiguration;
    }
    @Override
    protected void showDone() throws Exception {
        super.showDone();
        DVMConfigurationCache cache = (DVMConfigurationCache) VisualCaches.GetCache(target);
        Vector<DVMSettings> settings =  cache.getSettings();
        for (DVMSettings s: settings)
            s.Select(true);
        //--
        if (!settings.isEmpty()){
            Global.testingServer.db.sapforSettings.ShowUI(settings.lastElement().id);
        }
    }
}
