| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.common.ui.client.widgets; |
| 17 |
|
|
| 18 |
|
import com.google.gwt.event.dom.client.BlurEvent; |
| 19 |
|
import com.google.gwt.event.dom.client.BlurHandler; |
| 20 |
|
import com.google.gwt.event.dom.client.FocusEvent; |
| 21 |
|
import com.google.gwt.event.dom.client.FocusHandler; |
| 22 |
|
import com.google.gwt.event.logical.shared.ValueChangeEvent; |
| 23 |
|
import com.google.gwt.event.logical.shared.ValueChangeHandler; |
| 24 |
|
import com.google.gwt.user.client.ui.RadioButton; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
@author |
| 31 |
|
|
| 32 |
|
|
|
|
|
| 0% |
Uncovered Elements: 25 (25) |
Complexity: 8 |
Complexity Density: 0.5 |
|
| 33 |
|
public class KSRadioButton extends RadioButton{ |
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
@param |
| 39 |
|
@param |
| 40 |
|
@param |
| 41 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 42 |
0
|
public KSRadioButton(String group, String label, boolean asHTML) {... |
| 43 |
0
|
super(group, label, asHTML); |
| 44 |
0
|
setupDefaultStyle(); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
@param |
| 51 |
|
@param |
| 52 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 53 |
0
|
public KSRadioButton(String group, String label) {... |
| 54 |
0
|
super(group, label); |
| 55 |
0
|
setupDefaultStyle(); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
@param |
| 62 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 63 |
0
|
public KSRadioButton(String group) {... |
| 64 |
0
|
super(group); |
| 65 |
0
|
setupDefaultStyle(); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 72 |
0
|
private void setupDefaultStyle() {... |
| 73 |
0
|
addStyleName("KS-Radio"); |
| 74 |
|
|
| 75 |
0
|
this.addBlurHandler(new BlurHandler(){ |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 76 |
0
|
public void onBlur(BlurEvent event) {... |
| 77 |
0
|
KSRadioButton.this.removeStyleName("KS-Radio-Focus"); |
| 78 |
|
|
| 79 |
|
} |
| 80 |
|
}); |
| 81 |
|
|
| 82 |
0
|
this.addFocusHandler(new FocusHandler(){ |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
0
|
public void onFocus(FocusEvent event) {... |
| 84 |
0
|
KSRadioButton.this.addStyleName("KS-Radio-Focus"); |
| 85 |
|
|
| 86 |
|
} |
| 87 |
|
}); |
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
0
|
this.addValueChangeHandler(new ValueChangeHandler<Boolean>(){ |
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 107 |
0
|
@Override... |
| 108 |
|
|
| 109 |
|
public void onValueChange(ValueChangeEvent<Boolean> event) { |
| 110 |
0
|
if(KSRadioButton.this.getValue()){ |
| 111 |
0
|
KSRadioButton.this.addStyleName("KS-Radio-Selected"); |
| 112 |
|
} |
| 113 |
|
else{ |
| 114 |
0
|
KSRadioButton.this.removeStyleName("KS-Radio-Selected"); |
| 115 |
0
|
KSRadioButton.this.setFocus(false); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
} |
| 119 |
|
}); |
| 120 |
|
|
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
|
| 124 |
|
} |
| 125 |
|
|
| 126 |
|
|