From 9140e5378f211b078ea2bc507bcf358b2f2ee3e1 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 9 Mar 2012 16:20:52 +0200 Subject: [PATCH] Added license and javadoc. Removed extra methods from AbstractConnector. --- .../vaadin/terminal/gwt/client/Connector.java | 2 +- .../gwt/client/MouseEventDetailsBuilder.java | 32 +++++++++++++-- .../gwt/client/ui/AbstractConnector.java | 41 ++++++++++--------- 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. - * + *

* 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. + *

+ * Note that the shared state is not yet available when this method is + * called. + *

+ * 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 + * The type of the RPC interface that is being registered */ protected void registerRpc(Class rpcInterface, T implementation) { -- 2.39.5