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 |
|
|
|
|
| 0% |
Uncovered Elements: 53 (53) |
Complexity: 16 |
Complexity Density: 0.59 |
|
12 |
|
public class TableCellWidget extends Composite implements HasClickHandlers, HasChangeHandlers { |
13 |
|
Widget defaultTableEditor; |
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
14 |
0
|
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 |
|
} |
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
23 |
0
|
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 |
|
} |
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 5 |
Complexity Density: 0.62 |
|
31 |
0
|
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 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
49 |
0
|
@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 |
|
} |
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
58 |
0
|
@Override... |
59 |
|
public HandlerRegistration addChangeHandler(ChangeHandler handler) { |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
0
|
if(defaultTableEditor instanceof EditableLabel) { |
64 |
0
|
return ((EditableLabel)defaultTableEditor).addChangeHandler(handler) ; |
65 |
|
} |
66 |
0
|
return null; |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
0
|
public Widget getDefaultTableEditor() {... |
70 |
0
|
return defaultTableEditor; |
71 |
|
} |
72 |
|
} |