Clover Coverage Report - KS Common 1.2-M6-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Sep 12 2011 05:50:56 EDT
../../../../../../../img/srcFileCovDistChart0.png 30% of files have more coverage
25   76   15   6.25
16   52   0.6   4
4     3.75  
1    
 
  WindowTitleUtils       Line # 11 25 0% 15 45 0% 0.0
 
No Tests
 
1    package org.kuali.student.common.ui.client.util;
2   
3    import com.google.gwt.user.client.Window;
4   
5    /**
6    * Provides a variety of helper methods to manipulate page title based on location
7    *
8    * @author Kuali Student Team
9    *
10    */
 
11    public class WindowTitleUtils {
12   
13    private static String contextTitle = "";
14    private static String appTitle = "";
15    private static String subTitle = "";
16   
 
17  0 toggle 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    * Call this when scope of the application changes to make this be the new
26    * preceding title for the window, followed by last breadcrumb name
27    */
 
28  0 toggle public static void setContextTitle(String title){
29  0 contextTitle = title;
30  0 subTitle = "";
31  0 Window.setTitle(generateWindowTitle());
32    }
33   
34    /**
35    * Call this to change the subtitle
36    */
 
37  0 toggle public static void setSubtitle(String title){
38  0 subTitle = title;
39  0 Window.setTitle(generateWindowTitle());
40    }
41   
 
42  0 toggle 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    }