1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.ui.client.widgets; |
17 |
|
|
18 |
|
import org.kuali.student.common.ui.client.mvc.Callback; |
19 |
|
import org.kuali.student.common.ui.client.mvc.Controller; |
20 |
|
|
21 |
|
import com.google.gwt.event.dom.client.ClickEvent; |
22 |
|
import com.google.gwt.event.dom.client.ClickHandler; |
23 |
|
import com.google.gwt.event.dom.client.KeyDownEvent; |
24 |
|
import com.google.gwt.event.dom.client.KeyDownHandler; |
25 |
|
import com.google.gwt.user.client.Window; |
26 |
|
|
|
|
| 0% |
Uncovered Elements: 37 (37) |
Complexity: 13 |
Complexity Density: 0.59 |
|
27 |
|
public abstract class NavigationHandler implements ClickHandler, KeyDownHandler { |
28 |
|
private final String url; |
29 |
|
private final Controller controller; |
30 |
|
private final String navigationKey; |
31 |
|
private final Enum<?> navEnum; |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
33 |
0
|
public NavigationHandler(String url) {... |
34 |
0
|
this.url = url; |
35 |
0
|
this.controller = null; |
36 |
0
|
this.navigationKey = null; |
37 |
0
|
this.navEnum = null; |
38 |
|
} |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
40 |
0
|
public NavigationHandler(Controller controller, String navigationKey) {... |
41 |
0
|
this.url = null; |
42 |
0
|
this.controller = controller; |
43 |
0
|
this.navigationKey = navigationKey; |
44 |
0
|
this.navEnum = null; |
45 |
|
} |
46 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
47 |
0
|
public NavigationHandler(Controller controller, Enum<?> navigationEnum) {... |
48 |
0
|
this.url = null; |
49 |
0
|
this.controller = controller; |
50 |
0
|
this.navigationKey = null; |
51 |
0
|
this.navEnum = navigationEnum; |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0
|
public void onClick(ClickEvent event) {... |
55 |
0
|
doNavigate(); |
56 |
|
} |
57 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
0
|
public void onKeyDown(KeyDownEvent event) {... |
59 |
0
|
doNavigate(); |
60 |
|
} |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0
|
protected void doNavigate() {... |
63 |
0
|
beforeNavigate(new Callback<Boolean>() { |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 1 |
|
65 |
0
|
@Override... |
66 |
|
public void exec(Boolean result) { |
67 |
0
|
if (result) { |
68 |
0
|
if (url != null) { |
69 |
0
|
Window.Location.assign(url); |
70 |
|
} |
71 |
|
} |
72 |
|
} |
73 |
|
|
74 |
|
}); |
75 |
|
} |
76 |
|
|
77 |
|
|
78 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
79 |
0
|
public String getUrl() {... |
80 |
0
|
return url; |
81 |
|
} |
82 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
0
|
public Controller getController() {... |
84 |
0
|
return controller; |
85 |
|
} |
86 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
87 |
0
|
public String getNavigationKey() {... |
88 |
0
|
return navigationKey; |
89 |
|
} |
90 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
91 |
0
|
public Enum<?> getNavEnum() {... |
92 |
0
|
return navEnum; |
93 |
|
} |
94 |
|
|
95 |
|
public abstract void beforeNavigate(Callback<Boolean> callback); |
96 |
|
} |