aboutsummaryrefslogtreecommitdiffstats
path: root/compatibility-server/src
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-10-26 16:22:00 +0300
committerVaadin Code Review <review@vaadin.com>2016-10-31 11:55:10 +0000
commit9c88657db52d73f6dd8b976ce0d4cada643b2a4d (patch)
treefde7408221abc7b25379cba078e2d92d59163526 /compatibility-server/src
parentbcd7259e1092badf9abc6aa2146decdcc4611f14 (diff)
downloadvaadin-framework-9c88657db52d73f6dd8b976ce0d4cada643b2a4d.tar.gz
vaadin-framework-9c88657db52d73f6dd8b976ce0d4cada643b2a4d.zip
Implement focus and blur events for CheckBoxGroup.
Fixes vaadin/framework8-issues#334 Change-Id: I4c7ca424cc4f4a1f0cdecd7671827465ab74ace7
Diffstat (limited to 'compatibility-server/src')
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/CheckBox.java12
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/NativeSelect.java19
2 files changed, 7 insertions, 24 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/CheckBox.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/CheckBox.java
index d3c7b1a50c..a75815d9df 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/CheckBox.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/CheckBox.java
@@ -23,7 +23,7 @@ import org.jsoup.nodes.Element;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
-import com.vaadin.event.FieldEvents.FocusAndBlurServerRpcImpl;
+import com.vaadin.event.FieldEvents.FocusAndBlurServerRpcDecorator;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.shared.MouseEventDetails;
@@ -67,20 +67,12 @@ public class CheckBox extends AbstractField<Boolean> {
}
};
- FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl(
- this) {
- @Override
- protected void fireEvent(Event event) {
- CheckBox.this.fireEvent(event);
- }
- };
-
/**
* Creates a new checkbox.
*/
public CheckBox() {
registerRpc(rpc);
- registerRpc(focusBlurRpc);
+ registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent));
setValue(Boolean.FALSE);
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/NativeSelect.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/NativeSelect.java
index 3d535f2584..a782956867 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/NativeSelect.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/NativeSelect.java
@@ -20,7 +20,7 @@ import java.util.Collection;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
-import com.vaadin.event.FieldEvents.FocusAndBlurServerRpcImpl;
+import com.vaadin.event.FieldEvents.FocusAndBlurServerRpcDecorator;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.v7.data.Container;
@@ -37,33 +37,24 @@ import com.vaadin.v7.event.FieldEvents;
public class NativeSelect extends AbstractSelect
implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
- FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl(
- this) {
-
- @Override
- protected void fireEvent(Event event) {
- NativeSelect.this.fireEvent(event);
- }
- };
-
public NativeSelect() {
super();
- registerRpc(focusBlurRpc);
+ registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent));
}
public NativeSelect(String caption, Collection<?> options) {
super(caption, options);
- registerRpc(focusBlurRpc);
+ registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent));
}
public NativeSelect(String caption, Container dataSource) {
super(caption, dataSource);
- registerRpc(focusBlurRpc);
+ registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent));
}
public NativeSelect(String caption) {
super(caption);
- registerRpc(focusBlurRpc);
+ registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent));
}
@Override