Skip to content

Commit 8839827

Browse files
authored
feat: Remove old ie8 support (#6)
IE8 isn't supported by gwt 2.12.x
1 parent bbac35c commit 8839827

14 files changed

+19
-549
lines changed

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/CheckBox.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
import org.gwtbootstrap3.client.ui.gwt.ButtonBase;
2626
import org.gwtbootstrap3.client.ui.gwt.FormPanel;
2727
import org.gwtbootstrap3.client.ui.gwt.Widget;
28-
import org.gwtbootstrap3.client.ui.impl.CheckBoxImpl;
2928

30-
import com.google.gwt.core.shared.GWT;
3129
import com.google.gwt.dom.client.Document;
3230
import com.google.gwt.dom.client.Element;
3331
import com.google.gwt.dom.client.InputElement;
@@ -72,8 +70,6 @@
7270
public class CheckBox extends ButtonBase implements HasName, HasValue<Boolean>, HasWordWrap, HasDirectionalSafeHtml,
7371
HasDirectionEstimator, IsEditor<LeafValueEditor<Boolean>>, HasFormValue, HasChangeHandlers {
7472

75-
private static final CheckBoxImpl impl = GWT.create(CheckBoxImpl.class);
76-
7773
protected final SpanElement labelElem = Document.get().createSpanElement();
7874
protected final InputElement inputElem;
7975

@@ -115,8 +111,7 @@ public CheckBox(SafeHtml label, Direction dir) {
115111
* the check box's label
116112
* @param directionEstimator
117113
* A DirectionEstimator object used for automatic direction
118-
* adjustment. For convenience,
119-
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
114+
* adjustment
120115
*/
121116
public CheckBox(SafeHtml label, DirectionEstimator directionEstimator) {
122117
this();
@@ -158,8 +153,7 @@ public CheckBox(String label, Direction dir) {
158153
* the check box's label
159154
* @param directionEstimator
160155
* A DirectionEstimator object used for automatic direction
161-
* adjustment. For convenience,
162-
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
156+
* adjustment.
163157
*/
164158
public CheckBox(String label, DirectionEstimator directionEstimator) {
165159
this();
@@ -467,7 +461,7 @@ public void sinkEvents(int eventBitsToAdd) {
467461
}
468462

469463
protected void ensureDomEventHandlers() {
470-
impl.ensureDomEventHandlers(this);
464+
addChangeHandler(event -> ValueChangeEvent.fire(CheckBox.this, getValue()));
471465
}
472466

473467
/**

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Radio.java

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
* #L%
2121
*/
2222

23+
import com.google.gwt.user.client.Event;
2324
import org.gwtbootstrap3.client.ui.constants.Styles;
24-
import org.gwtbootstrap3.client.ui.impl.RadioImpl;
2525

26-
import com.google.gwt.core.shared.GWT;
2726
import com.google.gwt.dom.client.Document;
2827
import com.google.gwt.dom.client.Element;
2928
import com.google.gwt.dom.client.InputElement;
@@ -55,8 +54,6 @@
5554
*/
5655
public class Radio extends CheckBox {
5756

58-
private static final RadioImpl impl = GWT.create(RadioImpl.class);
59-
6057
/**
6158
* Creates a new radio associated with a particular group, and initialized
6259
* with the given HTML label. All radio buttons associated with the same
@@ -75,7 +72,7 @@ public Radio(String name, SafeHtml label) {
7572
}
7673

7774
/**
78-
* @see #RadioButton(String, SafeHtml)
75+
* @see RadioButton(String, SafeHtml)
7976
*
8077
* @param name
8178
* the group name with which to associate the radio button
@@ -92,16 +89,15 @@ public Radio(String name, SafeHtml label, Direction dir) {
9289
}
9390

9491
/**
95-
* @see #RadioButton(String, SafeHtml)
92+
* @see RadioButton(String, SafeHtml)
9693
*
9794
* @param name
9895
* the group name with which to associate the radio button
9996
* @param label
10097
* this radio button's html label
10198
* @param directionEstimator
10299
* A DirectionEstimator object used for automatic direction
103-
* adjustment. For convenience,
104-
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
100+
* adjustment.
105101
*/
106102
public Radio(String name, SafeHtml label, DirectionEstimator directionEstimator) {
107103
this(name);
@@ -128,7 +124,7 @@ public Radio(String name, String label) {
128124
}
129125

130126
/**
131-
* @see #RadioButton(String, SafeHtml)
127+
* @see RadioButton(String, SafeHtml)
132128
*
133129
* @param name
134130
* the group name with which to associate the radio button
@@ -145,16 +141,15 @@ public Radio(String name, String label, Direction dir) {
145141
}
146142

147143
/**
148-
* @see #RadioButton(String, SafeHtml)
144+
* @see RadioButton(String, SafeHtml)
149145
*
150146
* @param name
151147
* the group name with which to associate the radio button
152148
* @param label
153149
* this radio button's label
154150
* @param directionEstimator
155151
* A DirectionEstimator object used for automatic direction
156-
* adjustment. For convenience,
157-
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
152+
* adjustment.
158153
*/
159154
public Radio(String name, String label, DirectionEstimator directionEstimator) {
160155
this(name);
@@ -232,15 +227,11 @@ public void setName(String name) {
232227
super.setName(name);
233228
}
234229

235-
@Override
236-
protected void ensureDomEventHandlers() {
237-
impl.ensureDomEventHandlers(this);
238-
}
239-
240230
@Override
241231
public void sinkEvents(int eventBitsToAdd) {
242232
if (isOrWasAttached()) {
243-
impl.sinkEvents(eventBitsToAdd, inputElem, labelElem);
233+
Event.sinkEvents(inputElem,
234+
eventBitsToAdd | Event.getEventsSunk(inputElem));
244235
} else {
245236
super.sinkEvents(eventBitsToAdd);
246237
}

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/SimpleCheckBox.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* #L%
2121
*/
2222

23+
import com.google.gwt.event.logical.shared.ValueChangeEvent;
24+
import com.google.gwt.user.client.ui.Widget;
2325
import org.gwtbootstrap3.client.ui.base.HasFormValue;
2426
import org.gwtbootstrap3.client.ui.base.HasId;
2527
import org.gwtbootstrap3.client.ui.base.HasPull;
@@ -30,10 +32,7 @@
3032
import org.gwtbootstrap3.client.ui.base.mixin.PullMixin;
3133
import org.gwtbootstrap3.client.ui.constants.DeviceSize;
3234
import org.gwtbootstrap3.client.ui.constants.Pull;
33-
import org.gwtbootstrap3.client.ui.gwt.Widget;
34-
import org.gwtbootstrap3.client.ui.impl.SimpleCheckBoxImpl;
3535

36-
import com.google.gwt.core.client.GWT;
3736
import com.google.gwt.dom.client.Document;
3837
import com.google.gwt.dom.client.Element;
3938
import com.google.gwt.dom.client.InputElement;
@@ -49,8 +48,6 @@
4948
public class SimpleCheckBox extends com.google.gwt.user.client.ui.SimpleCheckBox implements HasResponsiveness, HasId,
5049
HasPull, HasFormValue, HasChangeHandlers {
5150

52-
private static final SimpleCheckBoxImpl impl = GWT.create(SimpleCheckBoxImpl.class);
53-
5451
/**
5552
* Creates a SimpleCheckBox widget that wraps an existing &lt;input
5653
* type='checkbox'&gt; element.
@@ -163,7 +160,7 @@ public Pull getPull() {
163160

164161
@Override
165162
protected void ensureDomEventHandlers() {
166-
impl.ensureDomEventHandlers(this);
163+
addChangeHandler(event -> ValueChangeEvent.fire(SimpleCheckBox.this, getValue()));
167164
}
168165

169166
}

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/SimpleRadioButton.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* #L%
2121
*/
2222

23+
import com.google.gwt.event.logical.shared.ValueChangeEvent;
24+
import com.google.gwt.user.client.ui.Widget;
2325
import org.gwtbootstrap3.client.ui.base.HasFormValue;
2426
import org.gwtbootstrap3.client.ui.base.HasId;
2527
import org.gwtbootstrap3.client.ui.base.HasPull;
@@ -30,10 +32,7 @@
3032
import org.gwtbootstrap3.client.ui.base.mixin.PullMixin;
3133
import org.gwtbootstrap3.client.ui.constants.DeviceSize;
3234
import org.gwtbootstrap3.client.ui.constants.Pull;
33-
import org.gwtbootstrap3.client.ui.gwt.Widget;
34-
import org.gwtbootstrap3.client.ui.impl.SimpleRadioButtonImpl;
3535

36-
import com.google.gwt.core.client.GWT;
3736
import com.google.gwt.dom.client.Document;
3837
import com.google.gwt.dom.client.Element;
3938
import com.google.gwt.dom.client.InputElement;
@@ -50,8 +49,6 @@
5049
public class SimpleRadioButton extends com.google.gwt.user.client.ui.SimpleRadioButton implements HasResponsiveness,
5150
HasId, HasPull, HasFormValue, HasChangeHandlers {
5251

53-
private static final SimpleRadioButtonImpl impl = GWT.create(SimpleRadioButtonImpl.class);
54-
5552
/**
5653
* Creates a SimpleRadioButton widget that wraps an existing &lt;input
5754
* type='radio'&gt; element.
@@ -173,7 +170,8 @@ public Pull getPull() {
173170

174171
@Override
175172
protected void ensureDomEventHandlers() {
176-
impl.ensureDomEventHandlers(this);
173+
addChangeHandler(event -> ValueChangeEvent.fire(SimpleRadioButton.this,
174+
getValue()));
177175
}
178176

179177
}

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/impl/CheckBoxImpl.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/impl/CheckBoxImplIE8.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/impl/RadioImpl.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)