Clover Coverage Report - Kuali Student 1.2.1-SNAPSHOT (Aggregated)
Coverage timestamp: Wed Nov 2 2011 04:03:58 EST
../../../../../../../../../img/srcFileCovDistChart0.png 42% of files have more coverage
27   72   16   4.5
20   63   0.59   6
6     2.67  
1    
 
  TableCellWidget       Line # 12 27 0% 16 53 0% 0.0
 
No Tests
 
1    package org.kuali.student.common.ui.client.widgets.table.scroll;
2   
3    import com.google.gwt.event.dom.client.ChangeHandler;
4    import com.google.gwt.event.dom.client.ClickHandler;
5    import com.google.gwt.event.dom.client.HasChangeHandlers;
6    import com.google.gwt.event.dom.client.HasClickHandlers;
7    import com.google.gwt.event.shared.HandlerRegistration;
8    import com.google.gwt.user.client.ui.CheckBox;
9    import com.google.gwt.user.client.ui.Composite;
10    import com.google.gwt.user.client.ui.Widget;
11   
 
12    public class TableCellWidget extends Composite implements HasClickHandlers, HasChangeHandlers {
13    Widget defaultTableEditor;
 
14  0 toggle public TableCellWidget(Object value){
15  0 if(value instanceof Boolean){
16  0 defaultTableEditor = new CheckBox();
17  0 ((CheckBox)defaultTableEditor).setTabIndex(-1);
18    }else {
19  0 defaultTableEditor = new EditableLabel();
20    }
21  0 super.initWidget(defaultTableEditor);
22    }
 
23  0 toggle public Object getCellEditorValue() {
24  0 if (defaultTableEditor instanceof EditableLabel) {
25  0 return ((EditableLabel)defaultTableEditor).getText();
26  0 }else if(defaultTableEditor instanceof CheckBox){
27  0 return ((CheckBox)defaultTableEditor).getValue();
28    }
29  0 return "";
30    }
 
31  0 toggle public void setCellEditorValue(Object value) {
32  0 if (defaultTableEditor instanceof EditableLabel) {
33  0 if(value == null){
34  0 ((EditableLabel)defaultTableEditor).setText("");
35    }else{
36  0 ((EditableLabel)defaultTableEditor).setText(value.toString());
37    }
38  0 }else if(defaultTableEditor instanceof CheckBox){
39  0 if(value == null){
40  0 ((CheckBox)defaultTableEditor).setValue(false);
41    }else{
42  0 ((CheckBox)defaultTableEditor).setValue((Boolean)value);
43    }
44   
45    }
46   
47    }
48   
 
49  0 toggle @Override
50    public HandlerRegistration addClickHandler(ClickHandler handler) {
51  0 if(defaultTableEditor instanceof CheckBox){
52  0 return ((CheckBox)defaultTableEditor).addClickHandler(handler) ;
53  0 }else if(defaultTableEditor instanceof EditableLabel) {
54  0 return ((EditableLabel)defaultTableEditor).addClickHandler(handler) ;
55    }
56  0 return null;
57    }
 
58  0 toggle @Override
59    public HandlerRegistration addChangeHandler(ChangeHandler handler) {
60    //if(defaultTableEditor instanceof CheckBox){
61    // return ((CheckBox)defaultTableEditor).addChangeHandler(handler) ;
62    //}else
63  0 if(defaultTableEditor instanceof EditableLabel) {
64  0 return ((EditableLabel)defaultTableEditor).addChangeHandler(handler) ;
65    }
66  0 return null;
67    }
68   
 
69  0 toggle public Widget getDefaultTableEditor() {
70  0 return defaultTableEditor;
71    }
72    }