diff -r ef075cd7ce55 -r f47e82cd6077 src/main/java/de/uapcore/lightpit/viewmodel/ProjectView.java --- a/src/main/java/de/uapcore/lightpit/viewmodel/ProjectView.java Sat Oct 17 15:21:56 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/viewmodel/ProjectView.java Sat Oct 17 19:56:50 2020 +0200 @@ -8,11 +8,29 @@ public class ProjectView { + public static final int SELECTED_PAGE_ISSUES = 0; + public static final int SELECTED_PAGE_VERSIONS = 1; + public static final int SELECTED_PAGE_COMPONENTS = 2; + + public static final Version ALL_VERSIONS = new Version(0); + public static final Version NO_VERSION = new Version(-1); + public static final Component ALL_COMPONENTS = new Component(0); + public static final Component NO_COMPONENT = new Component(-1); + + static { + ALL_VERSIONS.setNode("all-versions"); + NO_VERSION.setNode("no-version"); + ALL_COMPONENTS.setNode("all-components"); + NO_COMPONENT.setNode("no-component"); + } + private final List projectList = new ArrayList<>(); private ProjectInfo projectInfo; private Version versionFilter; private Component componentFilter; + private int selectedPage = SELECTED_PAGE_ISSUES; + public List getProjectList() { return projectList; } @@ -25,6 +43,14 @@ this.projectInfo = projectInfo; } + public int getSelectedPage() { + return selectedPage; + } + + public void setSelectedPage(int selectedPage) { + this.selectedPage = selectedPage; + } + public Version getVersionFilter() { return versionFilter; } @@ -40,4 +66,20 @@ public void setComponentFilter(Component componentFilter) { this.componentFilter = componentFilter; } + + public boolean isProjectInfoPresent() { + return projectInfo != null; + } + + public boolean isVersionFilterValid() { + return projectInfo != null && versionFilter != null; + } + + public boolean isComponentFilterValid() { + return projectInfo != null && componentFilter != null; + } + + public boolean isEveryFilterValid() { + return projectInfo != null && versionFilter != null && componentFilter != null; + } }