6 import java.util.ArrayList; |
6 import java.util.ArrayList; |
7 import java.util.List; |
7 import java.util.List; |
8 |
8 |
9 public class ProjectView { |
9 public class ProjectView { |
10 |
10 |
|
11 public static final int SELECTED_PAGE_ISSUES = 0; |
|
12 public static final int SELECTED_PAGE_VERSIONS = 1; |
|
13 public static final int SELECTED_PAGE_COMPONENTS = 2; |
|
14 |
|
15 public static final Version ALL_VERSIONS = new Version(0); |
|
16 public static final Version NO_VERSION = new Version(-1); |
|
17 public static final Component ALL_COMPONENTS = new Component(0); |
|
18 public static final Component NO_COMPONENT = new Component(-1); |
|
19 |
|
20 static { |
|
21 ALL_VERSIONS.setNode("all-versions"); |
|
22 NO_VERSION.setNode("no-version"); |
|
23 ALL_COMPONENTS.setNode("all-components"); |
|
24 NO_COMPONENT.setNode("no-component"); |
|
25 } |
|
26 |
11 private final List<ProjectInfo> projectList = new ArrayList<>(); |
27 private final List<ProjectInfo> projectList = new ArrayList<>(); |
12 private ProjectInfo projectInfo; |
28 private ProjectInfo projectInfo; |
13 private Version versionFilter; |
29 private Version versionFilter; |
14 private Component componentFilter; |
30 private Component componentFilter; |
|
31 |
|
32 private int selectedPage = SELECTED_PAGE_ISSUES; |
15 |
33 |
16 public List<ProjectInfo> getProjectList() { |
34 public List<ProjectInfo> getProjectList() { |
17 return projectList; |
35 return projectList; |
18 } |
36 } |
19 |
37 |
38 } |
64 } |
39 |
65 |
40 public void setComponentFilter(Component componentFilter) { |
66 public void setComponentFilter(Component componentFilter) { |
41 this.componentFilter = componentFilter; |
67 this.componentFilter = componentFilter; |
42 } |
68 } |
|
69 |
|
70 public boolean isProjectInfoPresent() { |
|
71 return projectInfo != null; |
|
72 } |
|
73 |
|
74 public boolean isVersionFilterValid() { |
|
75 return projectInfo != null && versionFilter != null; |
|
76 } |
|
77 |
|
78 public boolean isComponentFilterValid() { |
|
79 return projectInfo != null && componentFilter != null; |
|
80 } |
|
81 |
|
82 public boolean isEveryFilterValid() { |
|
83 return projectInfo != null && versionFilter != null && componentFilter != null; |
|
84 } |
43 } |
85 } |