+/*
+@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();
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
package com.vaadin.terminal.gwt.client.ui;
import java.util.ArrayList;
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;
return connection;
}
- private final void setConnection(ApplicationConnection connection) {
- this.connection = connection;
- }
-
/*
* (non-Javadoc)
*
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();
}
* 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() {
* 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) {