src/main/java/de/uapcore/lightpit/viewmodel/ComponentsView.java

Sat, 31 Oct 2020 09:27:36 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 31 Oct 2020 09:27:36 +0100
changeset 153
e914fbf4decc
parent 134
f47e82cd6077
permissions
-rw-r--r--

wrong sort order for components - fixes #35

package de.uapcore.lightpit.viewmodel;

import de.uapcore.lightpit.entities.Component;
import de.uapcore.lightpit.entities.Issue;

import java.util.ArrayList;
import java.util.List;

public class ComponentsView extends ProjectView {

    private List<ComponentInfo> componentInfos = new ArrayList<>();

    public ComponentsView() {
        setSelectedPage(SELECTED_PAGE_COMPONENTS);
    }

    public void update(List<Component> components, List<Issue> issues) {
        componentInfos.clear();
        for (var component : components) {
            final var info = new ComponentInfo(component);
            info.collectIssues(issues);
            componentInfos.add(info);
        }
    }

    public List<ComponentInfo> getComponentInfos() {
        return componentInfos;
    }
}

mercurial