Quellcode durchsuchen

Added license and javadoc. Removed extra methods from AbstractConnector.

tags/7.0.0.alpha2
Artur Signell vor 12 Jahren
Ursprung
Commit
9140e5378f

+ 1
- 1
src/com/vaadin/terminal/gwt/client/Connector.java Datei anzeigen

@@ -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.
*/

+ 29
- 3
src/com/vaadin/terminal/gwt/client/MouseEventDetailsBuilder.java Datei anzeigen

@@ -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();

+ 21
- 20
src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java Datei anzeigen

@@ -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) {

Laden…
Abbrechen
Speichern