package SapforTestingSystem.SapforTasksPackage.UI;
import Common.Utils.Utils;
import SapforTestingSystem.SapforTask.SapforTask;
import Visual_DVM_2021.Passes.PassCode_2021;

import java.util.Arrays;
import java.util.Vector;
public class ConfigurationSummary extends TreeSummary {
    public String configuration_id = "";
    public String flags = "";
    public Vector<String> codes_descriptions = new Vector<>();
    public ConfigurationSummary() {
    }
    public void init(String configuration_id_in, SapforTask task) {
        configuration_id = configuration_id_in;
        flags = task.flags;
        Vector<String> codes_s = new Vector<>(Arrays.asList(task.codes.split(" ")));
        for (int i = 1; i < codes_s.size(); ++i) {
            codes_descriptions.add(Utils.Brackets(PassCode_2021.valueOf(codes_s.get(i)).getDescription()));
        }
        refreshText();
    }
    @Override
    public void refreshText() {
        text = flags + " " + String.join("→", codes_descriptions);
    }
    @Override
    public String getImageKey() {
        return "Configuration";
    }
}
