package Visual_DVM_2021.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ServerObjectsCache.SapforConfigurationCache;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
import Visual_DVM_2021.Passes.ShowCurrentConfigurationTests;

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