From e85d933b25cc3c5cc85eb7eb4b13b950fd8e1569 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 13 Aug 2012 18:34:33 +0300 Subject: Moved server files to a server src folder (#9299) --- src/com/vaadin/ui/AbstractJavaScriptComponent.java | 165 --------------------- 1 file changed, 165 deletions(-) delete mode 100644 src/com/vaadin/ui/AbstractJavaScriptComponent.java (limited to 'src/com/vaadin/ui/AbstractJavaScriptComponent.java') diff --git a/src/com/vaadin/ui/AbstractJavaScriptComponent.java b/src/com/vaadin/ui/AbstractJavaScriptComponent.java deleted file mode 100644 index 5ec80573ab..0000000000 --- a/src/com/vaadin/ui/AbstractJavaScriptComponent.java +++ /dev/null @@ -1,165 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.ui; - -import com.vaadin.shared.ui.JavaScriptComponentState; -import com.vaadin.terminal.JavaScriptCallbackHelper; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.ui.JavaScriptWidget; - -/** - * Base class for Components with all client-side logic implemented using - * JavaScript. - *

- * When a new JavaScript component is initialized in the browser, the framework - * will look for a globally defined JavaScript function that will initialize the - * component. The name of the initialization function is formed by replacing . - * with _ in the name of the server-side class. If no such function is defined, - * each super class is used in turn until a match is found. The framework will - * thus first attempt with com_example_MyComponent for the - * server-side - * com.example.MyComponent extends AbstractJavaScriptComponent - * class. If MyComponent instead extends com.example.SuperComponent - * , then com_example_SuperComponent will also be attempted if - * com_example_MyComponent has not been defined. - *

- * JavaScript components have a very simple GWT widget ({@link JavaScriptWidget} - * ) just consisting of a div element to which the JavaScript code - * should initialize its own user interface. - *

- * The initialization function will be called with this pointing to - * a connector wrapper object providing integration to Vaadin with the following - * functions: - *

- * The connector wrapper also supports these special functions: - * - *

- * - * Values in the Shared State and in RPC calls are converted between Java and - * JavaScript using the following conventions: - *

- * - * @author Vaadin Ltd - * @version @VERSION@ - * @since 7.0.0 - */ -public abstract class AbstractJavaScriptComponent extends AbstractComponent { - private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper( - this); - - @Override - protected void registerRpc(T implementation, Class rpcInterfaceType) { - super.registerRpc(implementation, rpcInterfaceType); - callbackHelper.registerRpc(rpcInterfaceType); - } - - /** - * Register a {@link JavaScriptFunction} that can be called from the - * JavaScript using the provided name. A JavaScript function with the - * provided name will be added to the connector wrapper object (initially - * available as this). Calling that JavaScript function will - * cause the call method in the registered {@link JavaScriptFunction} to be - * invoked with the same arguments. - * - * @param functionName - * the name that should be used for client-side function - * @param function - * the {@link JavaScriptFunction} object that will be invoked - * when the JavaScript function is called - */ - protected void addFunction(String functionName, JavaScriptFunction function) { - callbackHelper.registerCallback(functionName, function); - } - - /** - * Invoke a named function that the connector JavaScript has added to the - * JavaScript connector wrapper object. The arguments should only contain - * data types that can be represented in JavaScript including primitives, - * their boxed types, arrays, String, List, Set, Map, Connector and - * JavaBeans. - * - * @param name - * the name of the function - * @param arguments - * function arguments - */ - protected void callFunction(String name, Object... arguments) { - callbackHelper.invokeCallback(name, arguments); - } - - @Override - public JavaScriptComponentState getState() { - return (JavaScriptComponentState) super.getState(); - } -} -- cgit v1.2.3