Clover Coverage Report - Kuali Student 1.2-M6-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Sep 12 2011 05:03:53 EDT
../../../../../../../../../img/srcFileCovDistChart0.png 42% of files have more coverage
26   87   8   3.71
2   55   0.31   7
7     1.14  
1    
 
  InfoMessage       Line # 32 26 0% 8 35 0% 0.0
 
No Tests
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.ui.client.configurable.mvc.sections;
17   
18    import org.kuali.student.common.ui.client.theme.Theme;
19    import org.kuali.student.common.ui.client.widgets.layout.HorizontalBlockFlowPanel;
20   
21    import com.google.gwt.user.client.ui.Composite;
22    import com.google.gwt.user.client.ui.HTMLPanel;
23    import com.google.gwt.user.client.ui.Image;
24    import com.google.gwt.user.client.ui.Widget;
25   
26    /**
27    * A widget used to show important information to the user often used at the top of sections.
28    *
29    * @author Kuali Student Team
30    *
31    */
 
32    public class InfoMessage extends Composite{
33    private HorizontalBlockFlowPanel layout = new HorizontalBlockFlowPanel();
34    private Image icon = Theme.INSTANCE.getCommonImages().getWarningDiamondIcon();
35    private HTMLPanel message = new HTMLPanel("");
36   
 
37  0 toggle public InfoMessage(String text, boolean visible){
38  0 layout.add(icon);
39  0 message.getElement().setInnerHTML(text);
40  0 layout.add(message);
41  0 icon.addStyleName("ks-message-static-image");
42  0 layout.addStyleName("ks-message-static");
43  0 this.initWidget(layout);
44  0 this.setVisible(visible);
45    }
46   
47   
 
48  0 toggle public InfoMessage(){
49  0 icon.addStyleName("ks-message-static-image");
50  0 layout.add(icon);
51  0 layout.add(message);
52  0 this.initWidget(layout);
53  0 this.setVisible(false);
54    }
55   
 
56  0 toggle public InfoMessage(boolean visible, boolean showStyling){
57  0 icon.addStyleName("ks-message-static-image");
58  0 layout.add(icon);
59  0 layout.add(message);
60  0 this.initWidget(layout);
61  0 this.showWarnStyling(showStyling);
62  0 this.setVisible(visible);
63    }
64   
 
65  0 toggle public void setMessage(String text, boolean messageVisible){
66  0 message.getElement().setInnerHTML(text);
67  0 this.setVisible(messageVisible);
68    }
69   
 
70  0 toggle public void insert(Widget w, int beforeIndex){
71  0 layout.insert(w, beforeIndex);
72    }
73   
 
74  0 toggle public void add(Widget w){
75  0 layout.add(w);
76    }
77   
 
78  0 toggle public void showWarnStyling(boolean showStyling){
79  0 icon.setVisible(showStyling);
80  0 if(showStyling){
81  0 layout.addStyleName("ks-message-static");
82    }
83    else{
84  0 layout.removeStyleName("ks-message-static");
85    }
86    }
87    }