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
19   70   9   2.11
0   54   0.47   9
9     1  
1    
 
  ButtonMessageDialog       Line # 14 19 0% 9 28 0% 0.0
 
No Tests
 
1    package org.kuali.student.common.ui.client.widgets.dialog;
2   
3    import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle;
4    import org.kuali.student.common.ui.client.widgets.KSLabel;
5    import org.kuali.student.common.ui.client.widgets.KSLightBox;
6    import org.kuali.student.common.ui.client.widgets.buttongroups.ButtonEnumerations.ButtonEnum;
7    import org.kuali.student.common.ui.client.widgets.field.layout.button.ButtonGroup;
8   
9    import com.google.gwt.event.dom.client.ClickHandler;
10    import com.google.gwt.event.logical.shared.CloseHandler;
11    import com.google.gwt.event.shared.HandlerRegistration;
12    import com.google.gwt.user.client.ui.FlowPanel;
13   
 
14    public class ButtonMessageDialog<T extends ButtonEnum> {
15   
16    private KSLabel messageLabel = new KSLabel();
17    private SectionTitle title = SectionTitle.generateH3Title("");
18   
19    private FlowPanel layout = new FlowPanel();
20   
21    private KSLightBox dialog;
22    private ButtonGroup<T> buttons;
23   
 
24  0 toggle public ButtonMessageDialog(String titleText, String message, ButtonGroup<T> buttons){
25  0 this.buttons = buttons;
26  0 setupLayout(titleText, message);
27    }
28   
 
29  0 toggle private void setupLayout(String titleText, String message){
30    //title.setText();
31  0 dialog = new KSLightBox();
32  0 SectionTitle sectionTitle = SectionTitle.generateH2Title(titleText);
33  0 layout.add(sectionTitle);
34  0 messageLabel.setText(message);
35  0 layout.add(messageLabel);
36  0 dialog.addButtonGroup(buttons);
37  0 layout.addStyleName("ks-confirmation-message-layout");
38  0 messageLabel.setStyleName("ks-confirmation-message-label");
39  0 dialog.setWidget(layout);
40  0 dialog.setSize(600, 120);
41    }
42   
 
43  0 toggle public void show(){
44  0 dialog.show();
45    }
46   
 
47  0 toggle public void hide(){
48  0 dialog.hide();
49    }
50   
 
51  0 toggle public void removeCloseLink(){
52  0 dialog.removeCloseLink();
53    }
54   
 
55  0 toggle public HandlerRegistration addCloseLinkClickHandler(ClickHandler clickHandler) {
56  0 return dialog.addCloseLinkClickHandler(clickHandler);
57    }
58   
 
59  0 toggle public HandlerRegistration addCloseHandler(CloseHandler handler){
60  0 return dialog.addCloseHandler(handler);
61    }
62   
 
63  0 toggle public void setMessageText(String text){
64  0 messageLabel.setText(text);
65    }
66   
 
67  0 toggle public ButtonGroup<T> getButtonGroup(){
68  0 return buttons;
69    }
70    }