1 |
|
package org.kuali.student.common.ui.client.util; |
2 |
|
|
3 |
|
import com.google.gwt.user.client.Window; |
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
@author |
9 |
|
|
10 |
|
|
|
|
| 0% |
Uncovered Elements: 45 (45) |
Complexity: 15 |
Complexity Density: 0.6 |
|
11 |
|
public class WindowTitleUtils { |
12 |
|
|
13 |
|
private static String contextTitle = ""; |
14 |
|
private static String appTitle = ""; |
15 |
|
private static String subTitle = ""; |
16 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
17 |
0
|
public static void setApplicationTitle(String title){... |
18 |
0
|
appTitle = title; |
19 |
0
|
contextTitle = ""; |
20 |
0
|
subTitle = ""; |
21 |
0
|
Window.setTitle(generateWindowTitle()); |
22 |
|
} |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
28 |
0
|
public static void setContextTitle(String title){... |
29 |
0
|
contextTitle = title; |
30 |
0
|
subTitle = ""; |
31 |
0
|
Window.setTitle(generateWindowTitle()); |
32 |
|
} |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
37 |
0
|
public static void setSubtitle(String title){... |
38 |
0
|
subTitle = title; |
39 |
0
|
Window.setTitle(generateWindowTitle()); |
40 |
|
} |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 32 (32) |
Complexity: 12 |
Complexity Density: 0.75 |
|
42 |
0
|
private static String generateWindowTitle(){... |
43 |
0
|
String title = null; |
44 |
0
|
if(appTitle != null && !appTitle.equals("")){ |
45 |
0
|
title = appTitle; |
46 |
|
} |
47 |
|
|
48 |
0
|
if(contextTitle != null && !contextTitle.equals("")){ |
49 |
0
|
if(title != null){ |
50 |
0
|
if(!contextTitle.equals(appTitle)){ |
51 |
0
|
title = title + ": " + contextTitle; |
52 |
|
} |
53 |
|
} |
54 |
|
else{ |
55 |
0
|
title = contextTitle; |
56 |
|
} |
57 |
|
} |
58 |
|
|
59 |
0
|
if(subTitle != null && !subTitle.equals("")){ |
60 |
0
|
if(title != null){ |
61 |
0
|
if(!subTitle.equals(contextTitle)){ |
62 |
0
|
title = title + " - " + subTitle; |
63 |
|
} |
64 |
|
} |
65 |
|
else{ |
66 |
0
|
title = subTitle; |
67 |
|
} |
68 |
|
} |
69 |
|
|
70 |
0
|
if(title == null){ |
71 |
0
|
title = "KS"; |
72 |
|
} |
73 |
|
|
74 |
0
|
return title; |
75 |
|
} |
76 |
|
} |