diff options
author | Artur Signell <artur@vaadin.com> | 2012-03-09 16:20:52 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-03-14 16:00:14 +0200 |
commit | 9140e5378f211b078ea2bc507bcf358b2f2ee3e1 (patch) | |
tree | de328efdf51976122896be0c96aa31b2aedb393e /src/com/vaadin | |
parent | 2bd148914d7c2296727dd5259f480c48c7bc43d5 (diff) | |
download | vaadin-framework-9140e5378f211b078ea2bc507bcf358b2f2ee3e1.tar.gz vaadin-framework-9140e5378f211b078ea2bc507bcf358b2f2ee3e1.zip |
Added license and javadoc. Removed extra methods from AbstractConnector.
Diffstat (limited to 'src/com/vaadin')
3 files changed, 51 insertions, 24 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/Connector.java b/src/com/vaadin/terminal/gwt/client/Connector.java index 77c29a24fd..7e5635861a 100644 --- a/src/com/vaadin/terminal/gwt/client/Connector.java +++ b/src/com/vaadin/terminal/gwt/client/Connector.java @@ -74,7 +74,7 @@ public interface Connector { /** * * Called once by the framework to initialize the connector. - * + * <p> * Note that the shared state is not yet available at this point nor any * hierarchy information. */ diff --git a/src/com/vaadin/terminal/gwt/client/MouseEventDetailsBuilder.java b/src/com/vaadin/terminal/gwt/client/MouseEventDetailsBuilder.java index 68dc39b692..58dd488351 100644 --- a/src/com/vaadin/terminal/gwt/client/MouseEventDetailsBuilder.java +++ b/src/com/vaadin/terminal/gwt/client/MouseEventDetailsBuilder.java @@ -1,19 +1,45 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ package com.vaadin.terminal.gwt.client; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.user.client.Event; -/* - @VaadinApache2LicenseForJavaFiles@ +/** + * Helper class for constructing a MouseEventDetails object from a + * {@link NativeEvent}. + * + * @author Vaadin Ltd + * @version @VERSION@ + * @since 7.0.0 + * */ - public class MouseEventDetailsBuilder { + /** + * Construct a {@link MouseEventDetails} object from the given event + * + * @param evt + * The event to use as a source for the details + * @return a MouseEventDetails containing information from the event + */ public static MouseEventDetails buildMouseEventDetails(NativeEvent evt) { return buildMouseEventDetails(evt, null); } + /** + * Construct a {@link MouseEventDetails} object from the given event + * + * @param evt + * The event to use as a source for the details + * @param relativeToElement + * The element whose position + * {@link MouseEventDetails#getRelativeX()} and + * {@link MouseEventDetails#getRelativeY()} are relative to. + * @return a MouseEventDetails containing information from the event + */ public static MouseEventDetails buildMouseEventDetails(NativeEvent evt, Element relativeToElement) { MouseEventDetails mouseEventDetails = new MouseEventDetails(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java index 2b71fdf5fe..174b242492 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java @@ -1,3 +1,6 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ package com.vaadin.terminal.gwt.client.ui; import java.util.ArrayList; @@ -10,10 +13,14 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.Connector; import com.vaadin.terminal.gwt.client.communication.ClientRpc; -/* - @VaadinApache2LicenseForJavaFiles@ +/** + * An abstract implementation of Connector. + * + * @author Vaadin Ltd + * @version @VERSION@ + * @since 7.0.0 + * */ - public abstract class AbstractConnector implements Connector { private ApplicationConnection connection; @@ -30,10 +37,6 @@ public abstract class AbstractConnector implements Connector { return connection; } - private final void setConnection(ApplicationConnection connection) { - this.connection = connection; - } - /* * (non-Javadoc) * @@ -43,22 +46,18 @@ public abstract class AbstractConnector implements Connector { return id; } - private void setId(String id) { - this.id = id; - } - /** - * * Called once by the framework to initialize the connector. - * - * Custom widgets should not override this method, override init instead; - * - * Note that the shared state is not yet available at this point. + * <p> + * Note that the shared state is not yet available when this method is + * called. + * <p> + * Connector classes should override {@link #init()} instead of this method. */ public final void doInit(String connectorId, ApplicationConnection connection) { - setConnection(connection); - setId(connectorId); + this.connection = connection; + id = connectorId; init(); } @@ -67,8 +66,8 @@ public abstract class AbstractConnector implements Connector { * Called when the connector has been initialized. Override this method to * perform initialization of the connector. */ - // FIXME: It might make sense to make this abstract to force users to use - // init instead of constructor, where connection and id has not yet been + // FIXME: It might make sense to make this abstract to force users to + // use init instead of constructor, where connection and id has not yet been // set. protected void init() { @@ -84,6 +83,8 @@ public abstract class AbstractConnector implements Connector { * RPC interface * @param implementation * implementation that should receive RPC calls + * @param <T> + * The type of the RPC interface that is being registered */ protected <T extends ClientRpc> void registerRpc(Class<T> rpcInterface, T implementation) { |