diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-13 15:45:14 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-13 15:45:14 +0300 |
commit | b998fd14b6453bf0a0da9a870d36ab2f0a7f9726 (patch) | |
tree | f9169afc54c0074ce9125584d66a4563fe3f29bc /tests | |
parent | 2e6313e12b7c11706d154befd0cdf3a665f46365 (diff) | |
download | vaadin-framework-b998fd14b6453bf0a0da9a870d36ab2f0a7f9726.tar.gz vaadin-framework-b998fd14b6453bf0a0da9a870d36ab2f0a7f9726.zip |
Rename JavaScriptCallback -> JavaScriptFunction (#9293)
Diffstat (limited to 'tests')
5 files changed, 14 insertions, 14 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index 9ea61b92bb..5f0b551e78 100644 --- a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -21,7 +21,7 @@ import com.vaadin.tests.components.AbstractTestRoot; import com.vaadin.tests.util.Log; import com.vaadin.ui.AbstractJavaScriptComponent; import com.vaadin.ui.HasComponents; -import com.vaadin.ui.JavaScriptCallback; +import com.vaadin.ui.JavaScriptFunction; public class BasicJavaScriptComponent extends AbstractTestRoot { @@ -59,14 +59,14 @@ public class BasicJavaScriptComponent extends AbstractTestRoot { log.log("Got RPC message: " + message); } }); - registerCallback("messageToServer", new JavaScriptCallback() { + addFunction("messageToServer", new JavaScriptFunction() { @Override public void call(JSONArray arguments) throws JSONException { log.log("Got callback message: " + arguments.getString(0)); } }); - registerCallback("reportParentIds", new JavaScriptCallback() { + addFunction("reportParentIds", new JavaScriptFunction() { @Override public void call(JSONArray arguments) throws JSONException { JSONArray parentIds = arguments.getJSONArray(0); @@ -89,7 +89,7 @@ public class BasicJavaScriptComponent extends AbstractTestRoot { }); getRpcProxy(TestRpc.class).sendRpc("RPC message"); - invokeCallback("messageToClient", "Callback message"); + callFunction("messageToClient", "Callback message"); getState() .setMessages( diff --git a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java index a16f131475..c373d9d9dd 100644 --- a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java @@ -11,7 +11,7 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestRoot; import com.vaadin.tests.util.Log; import com.vaadin.ui.JavaScript; -import com.vaadin.ui.JavaScriptCallback; +import com.vaadin.ui.JavaScriptFunction; public class JavascriptManagerTest extends AbstractTestRoot { @@ -21,7 +21,7 @@ public class JavascriptManagerTest extends AbstractTestRoot { protected void setup(WrappedRequest request) { addComponent(log); final JavaScript js = JavaScript.getCurrent(); - js.addCallback("testing.doTest", new JavaScriptCallback() { + js.addFunction("testing.doTest", new JavaScriptFunction() { @Override public void call(JSONArray arguments) throws JSONException { log.log("Got " + arguments.length() + " arguments"); @@ -31,7 +31,7 @@ public class JavascriptManagerTest extends AbstractTestRoot { + arguments.getJSONObject(2).getBoolean("p")); log.log("Argument 4 is JSONObject.NULL: " + (arguments.get(3) == JSONObject.NULL)); - js.removeCallback("testing.doTest"); + js.removeFunction("testing.doTest"); } }); js.execute("window.testing.doTest(42, 'text', {p: true}, null)"); diff --git a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index cb05bde493..64c7f6a5a8 100644 --- a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -16,7 +16,7 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestRoot; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.JavaScriptCallback; +import com.vaadin.ui.JavaScriptFunction; import com.vaadin.ui.Notification; public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { @@ -56,7 +56,7 @@ public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { Notification.show(getState().getPrefix() + message); } }); - registerCallback("greetToServer", new JavaScriptCallback() { + addFunction("greetToServer", new JavaScriptFunction() { @Override public void call(JSONArray arguments) throws JSONException { Notification.show(getState().getPrefix() @@ -81,7 +81,7 @@ public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { } public void greetCallback(String message) { - invokeCallback("greetToClient", message); + callFunction("greetToClient", message); } } diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java index bd4cfd5839..d545831794 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java @@ -23,7 +23,7 @@ public class Analytics extends AbstractJavaScriptExtension { private void pushCommand(Object... commandAndArguments) { // Cast to Object to use Object[] commandAndArguments as the first // varargs argument instead of as the full varargs argument array. - invokeCallback("pushCommand", (Object) commandAndArguments); + callFunction("pushCommand", (Object) commandAndArguments); } protected void extend(Root root) { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java index 946a67d7fd..2e60c1ba37 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java @@ -12,7 +12,7 @@ import com.vaadin.annotations.JavaScript; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.ui.AbstractJavaScriptComponent; -import com.vaadin.ui.JavaScriptCallback; +import com.vaadin.ui.JavaScriptFunction; import com.vaadin.ui.Notification; @JavaScript({ @@ -27,7 +27,7 @@ public class Flot extends AbstractJavaScriptComponent { + dataIndex + "]"); } }); - registerCallback("onPlotClick", new JavaScriptCallback() { + addFunction("onPlotClick", new JavaScriptFunction() { @Override public void call(JSONArray arguments) throws JSONException { int seriesIndex = arguments.getInt(0); @@ -52,7 +52,7 @@ public class Flot extends AbstractJavaScriptComponent { public void highlight(int seriesIndex, int dataIndex) { getRpcProxy(FlotHighlightRpc.class).highlight(seriesIndex, dataIndex); - invokeCallback("highlight", seriesIndex, dataIndex); + callFunction("highlight", seriesIndex, dataIndex); } @Override |