1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.jadira.dependencynavigator.controller;
19
20 public class Controller {
21
22
23
24
25
26
27 private BooleanController checkShowCompile = new BooleanController(true);
28 private BooleanController checkShowTest = new BooleanController(false);
29 private BooleanController checkShowRuntime = new BooleanController(true);
30 private BooleanController checkShowProvided = new BooleanController(true);
31 private BooleanController resolveExclusions = new BooleanController(true);
32
33 boolean includeScope(String scope) {
34 if ("compile".equalsIgnoreCase(scope) && !checkShowCompile.value) {
35 return false;
36 }
37 if ("test".equalsIgnoreCase(scope) && !checkShowTest.value) {
38 return false;
39 }
40 if ("runtime".equalsIgnoreCase(scope) && !checkShowRuntime.value) {
41 return false;
42 }
43 if ("provided".equalsIgnoreCase(scope) && !checkShowProvided.value) {
44 return false;
45 }
46 return true;
47 }
48
49
50
51
52 public class BooleanController {
53
54 private boolean value;
55
56 private BooleanController(boolean value) {
57 this.value = value;
58 }
59
60 public boolean getValue() {
61 return value;
62 }
63
64 public void toggle() {
65 value = !value;
66 }
67
68 }
69
70 public BooleanController getCheckShowCompile() {
71 return checkShowCompile;
72 }
73
74 public BooleanController getCheckShowProvided() {
75 return checkShowProvided;
76 }
77
78 public BooleanController getCheckShowRuntime() {
79 return checkShowRuntime;
80 }
81
82 public BooleanController getCheckShowTest() {
83 return checkShowTest;
84 }
85
86 public BooleanController getResolveExclusions() {
87 return resolveExclusions;
88 }
89 }