From d1c55ddd236de43ebe836c01b7d6c8b8943a79a8 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 6 Nov 2012 17:51:39 +0200 Subject: Added AbstractConnector.getRpcProxy helper (#10143) Change-Id: I52ca9908763cc7416a2c50971252429cd8c294e8 --- .../com/vaadin/tests/widgetset/client/SerializerTestConnector.java | 4 +--- .../client/helloworldfeature/HelloWorldExtensionConnector.java | 4 +--- .../widgetset/client/minitutorials/v7a3/RefresherConnector.java | 5 +---- .../client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java | 4 +--- 4 files changed, 4 insertions(+), 13 deletions(-) (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java index 7783178a3b..6822edb34c 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import com.vaadin.client.communication.RpcProxy; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.extensions.AbstractExtensionConnector; import com.vaadin.shared.Connector; @@ -37,8 +36,7 @@ import com.vaadin.tests.widgetset.server.SerializerTestExtension; @Connect(SerializerTestExtension.class) public class SerializerTestConnector extends AbstractExtensionConnector { - private SerializerTestRpc rpc = RpcProxy.create(SerializerTestRpc.class, - this); + private SerializerTestRpc rpc = getRpcProxy(SerializerTestRpc.class); public SerializerTestConnector() { registerRpc(SerializerTestRpc.class, new SerializerTestRpc() { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java index 76dbdd5370..a0a6911eb2 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java @@ -19,14 +19,12 @@ import com.google.gwt.user.client.Window; import com.vaadin.client.ServerConnector; import com.vaadin.client.Util; import com.vaadin.client.VConsole; -import com.vaadin.client.communication.RpcProxy; import com.vaadin.client.extensions.AbstractExtensionConnector; import com.vaadin.shared.ui.Connect; import com.vaadin.tests.extensions.HelloWorldExtension; @Connect(HelloWorldExtension.class) public class HelloWorldExtensionConnector extends AbstractExtensionConnector { - HelloWorldRpc rpc = RpcProxy.create(HelloWorldRpc.class, this); @Override public HelloWorldState getState() { @@ -56,6 +54,6 @@ public class HelloWorldExtensionConnector extends AbstractExtensionConnector { VConsole.log(msg); String response = Window.prompt(msg, ""); - rpc.onMessageSent(response); + getRpcProxy(HelloWorldRpc.class).onMessageSent(response); } } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java index 26fa22a667..2deef7e1ba 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java @@ -1,7 +1,6 @@ package com.vaadin.tests.widgetset.client.minitutorials.v7a3; import com.google.gwt.user.client.Timer; -import com.vaadin.client.communication.RpcProxy; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.extensions.AbstractExtensionConnector; import com.vaadin.shared.ui.Connect; @@ -10,12 +9,10 @@ import com.vaadin.tests.minitutorials.v7a3.Refresher; @Connect(Refresher.class) public class RefresherConnector extends AbstractExtensionConnector { - private RefresherRpc rpc = RpcProxy.create(RefresherRpc.class, this); - private Timer timer = new Timer() { @Override public void run() { - rpc.refresh(); + getRpcProxy(RefresherRpc.class).refresh(); } }; diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java index b7dead9819..c587f53968 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java @@ -6,7 +6,6 @@ import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ServerConnector; -import com.vaadin.client.communication.RpcProxy; import com.vaadin.client.extensions.AbstractExtensionConnector; import com.vaadin.client.ui.VOverlay; import com.vaadin.shared.ui.Connect; @@ -15,8 +14,7 @@ import com.vaadin.tests.minitutorials.v7b1.CapsLockWarningWithRpc; @Connect(CapsLockWarningWithRpc.class) public class CapsLockWarningWithRpcConnector extends AbstractExtensionConnector { - private CapsLockWarningRpc rpc = RpcProxy.create(CapsLockWarningRpc.class, - this); + private CapsLockWarningRpc rpc = getRpcProxy(CapsLockWarningRpc.class); @Override protected void extend(ServerConnector target) { -- cgit v1.2.3