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

changeset 134
f47e82cd6077
parent 109
2e0669e814ff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/main/java/de/uapcore/lightpit/viewmodel/ComponentsView.java	Sat Oct 17 19:56:50 2020 +0200
     1.3 @@ -0,0 +1,29 @@
     1.4 +package de.uapcore.lightpit.viewmodel;
     1.5 +
     1.6 +import de.uapcore.lightpit.entities.Component;
     1.7 +import de.uapcore.lightpit.entities.Issue;
     1.8 +
     1.9 +import java.util.ArrayList;
    1.10 +import java.util.List;
    1.11 +
    1.12 +public class ComponentsView extends ProjectView {
    1.13 +
    1.14 +    private List<ComponentInfo> componentInfos = new ArrayList<>();
    1.15 +
    1.16 +    public ComponentsView() {
    1.17 +        setSelectedPage(SELECTED_PAGE_COMPONENTS);
    1.18 +    }
    1.19 +
    1.20 +    public void update(List<Component> components, List<Issue> issues) {
    1.21 +        componentInfos.clear();
    1.22 +        for (var component : components) {
    1.23 +            final var info = new ComponentInfo(component);
    1.24 +            info.collectIssues(issues);
    1.25 +            componentInfos.add(info);
    1.26 +        }
    1.27 +    }
    1.28 +
    1.29 +    public List<ComponentInfo> getComponentInfos() {
    1.30 +        return componentInfos;
    1.31 +    }
    1.32 +}

mercurial