Browse Source

Connector -> ServerConnector

tags/7.0.0.alpha2
Artur Signell 12 years ago
parent
commit
0158bd1291

+ 6
- 6
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java View File

@@ -1109,7 +1109,7 @@ public class ApplicationConnection {
try {
String connectorId = keyArray.get(i);
String connectorType = types.getString(connectorId);
Connector connector = connectorMap
ServerConnector connector = connectorMap
.getConnector(connectorId);
if (connector != null) {
continue;
@@ -1185,7 +1185,7 @@ public class ApplicationConnection {
for (int i = 0; i < keyArray.length(); i++) {
try {
String connectorId = keyArray.get(i);
Connector paintable = connectorMap
ServerConnector paintable = connectorMap
.getConnector(connectorId);
if (null != paintable) {

@@ -1224,7 +1224,7 @@ public class ApplicationConnection {
for (int i = 0; i < hierarchyKeys.length(); i++) {
try {
String connectorId = hierarchyKeys.get(i);
Connector connector = connectorMap
ServerConnector connector = connectorMap
.getConnector(connectorId);
if (!(connector instanceof ComponentContainerConnector)) {
VConsole.error("Retrieved a hierarchy update for a connector ("
@@ -1238,7 +1238,7 @@ public class ApplicationConnection {
.getJSStringArray(connectorId);
int childConnectorSize = childConnectorIds.length();

List<Connector> newChildren = new ArrayList<Connector>();
List<ServerConnector> newChildren = new ArrayList<ServerConnector>();
for (int connectorIndex = 0; connectorIndex < childConnectorSize; connectorIndex++) {
String childConnectorId = childConnectorIds
.get(connectorIndex);
@@ -1489,7 +1489,7 @@ public class ApplicationConnection {
* true if the update is to be sent as soon as possible
*/
public void updateVariable(String paintableId, String variableName,
Connector newValue, boolean immediate) {
ServerConnector newValue, boolean immediate) {
addVariableToQueue(paintableId, variableName, newValue, immediate);
}

@@ -2155,7 +2155,7 @@ public class ApplicationConnection {
}

@Deprecated
public void unregisterPaintable(Connector p) {
public void unregisterPaintable(ServerConnector p) {
connectorMap.unregisterConnector(p);
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ComponentConnector.java View File

@@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.Widget;
* Updates can be sent back to the server using the
* {@link ApplicationConnection#updateVariable()} methods.
*/
public interface ComponentConnector extends Connector {
public interface ComponentConnector extends ServerConnector {

/*
* (non-Javadoc)

+ 1
- 1
src/com/vaadin/terminal/gwt/client/ConnectorHierarchyChangedEvent.java View File

@@ -3,7 +3,7 @@ package com.vaadin.terminal.gwt.client;
import java.util.List;

/**
* Event for containing data related to a change in the {@link Connector}
* Event for containing data related to a change in the {@link ServerConnector}
* hierarchy. A {@link ConnectorHierarchyChangedEvent} is fired when an update
* from the server has been fully processed and all hierarchy updates have been
* completed.

+ 13
- 13
src/com/vaadin/terminal/gwt/client/ConnectorMap.java View File

@@ -21,7 +21,7 @@ import com.vaadin.terminal.gwt.client.RenderInformation.Size;

public class ConnectorMap {

private Map<String, Connector> idToConnector = new HashMap<String, Connector>();
private Map<String, ServerConnector> idToConnector = new HashMap<String, ServerConnector>();

public static ConnectorMap get(ApplicationConnection applicationConnection) {
return applicationConnection.getConnectorMap();
@@ -34,14 +34,14 @@ public class ConnectorMap {
private Set<String> unregistryBag = new HashSet<String>();

/**
* Returns a {@link Connector} by its id
* Returns a {@link ServerConnector} by its id
*
* @param id
* The connector id
* @return A connector or null if a connector with the given id has not been
* registered
*/
public Connector getConnector(String connectorId) {
public ServerConnector getConnector(String connectorId) {
return idToConnector.get(connectorId);
}

@@ -91,7 +91,7 @@ public class ConnectorMap {
return getConnector(widget.getElement());
}

public void registerConnector(String id, Connector connector) {
public void registerConnector(String id, ServerConnector connector) {
ComponentDetail componentDetail = GWT.create(ComponentDetail.class);
idToComponentDetail.put(id, componentDetail);
idToConnector.put(id, connector);
@@ -117,10 +117,10 @@ public class ConnectorMap {
* the connector whose id is needed
* @return the id for the given connector or null if the connector could not
* be found
* @deprecated use {@link Connector#getId()} instead
* @deprecated use {@link ServerConnector#getId()} instead
*/
@Deprecated
public String getConnectorId(Connector connector) {
public String getConnectorId(ServerConnector connector) {
if (connector == null) {
return null;
}
@@ -135,7 +135,7 @@ public class ConnectorMap {
/**
* Gets the connector id using a DOM element - the element should be the
* root element for a connector, otherwise no id will be found. Use
* {@link #getConnectorId(Connector)} instead whenever possible.
* {@link #getConnectorId(ServerConnector)} instead whenever possible.
*
* @see #getConnectorId(Paintable)
* @param el
@@ -156,7 +156,7 @@ public class ConnectorMap {
* @return the element for the connector corresponding to the id
*/
public Element getElement(String connectorId) {
Connector p = getConnector(connectorId);
ServerConnector p = getConnector(connectorId);
if (p instanceof ComponentConnector) {
return ((ComponentConnector) p).getWidget().getElement();
}
@@ -173,7 +173,7 @@ public class ConnectorMap {
* @param connector
* the connector to remove
*/
public void unregisterConnector(Connector connector) {
public void unregisterConnector(ServerConnector connector) {

// add to unregistry queue

@@ -203,7 +203,7 @@ public class ConnectorMap {
public ComponentConnector[] getRegisteredComponentConnectors() {
ArrayList<ComponentConnector> result = new ArrayList<ComponentConnector>();

for (Connector connector : getConnectors()) {
for (ServerConnector connector : getConnectors()) {
if (connector instanceof ComponentConnector) {
ComponentConnector componentConnector = (ComponentConnector) connector;
if (!unregistryBag.contains(connector.getId())) {
@@ -219,7 +219,7 @@ public class ConnectorMap {
if (unregisterConnectors) {
for (String connectorId : unregistryBag) {
// TODO purge shared state for pid
Connector connector = getConnector(connectorId);
ServerConnector connector = getConnector(connectorId);
if (connector == null) {
/*
* this should never happen, but it does :-( See e.g.
@@ -261,7 +261,7 @@ public class ConnectorMap {
* not unregister the given container itself. Does not actually remove the
* widgets from the DOM.
*
* @see #unregisterConnector(Connector)
* @see #unregisterConnector(ServerConnector)
* @param container
* The container that contains the connectors that should be
* unregistered
@@ -347,7 +347,7 @@ public class ConnectorMap {
return getTooltipInfo(getConnector(widget), key);
}

public Collection<? extends Connector> getConnectors() {
public Collection<? extends ServerConnector> getConnectors() {
return Collections.unmodifiableCollection(idToConnector.values());
}


+ 1
- 1
src/com/vaadin/terminal/gwt/client/LayoutManager.java View File

@@ -166,7 +166,7 @@ public class LayoutManager {
for (int i = 0; i < needsWidthUpdateArray.length(); i++) {
String pid = needsWidthUpdateArray.get(i);

Connector paintable = paintableMap.getConnector(pid);
ServerConnector paintable = paintableMap.getConnector(pid);
if (paintable instanceof DirectionalManagedLayout) {
DirectionalManagedLayout cl = (DirectionalManagedLayout) paintable;
cl.layoutHorizontally();

src/com/vaadin/terminal/gwt/client/Connector.java → src/com/vaadin/terminal/gwt/client/ServerConnector.java View File

@@ -17,7 +17,7 @@ import com.vaadin.terminal.gwt.client.communication.SharedState;
* @version @VERSION@
* @since 7.0.0
*/
public interface Connector {
public interface ServerConnector {
/**
* TODO
*

+ 2
- 2
src/com/vaadin/terminal/gwt/client/UIDL.java View File

@@ -516,7 +516,7 @@ public final class UIDL extends JavaScriptObject {
* the name of the attribute
* @return the Paintable referenced by the attribute, if it exists
*/
public Connector getPaintableAttribute(String name,
public ServerConnector getPaintableAttribute(String name,
ApplicationConnection connection) {
return ConnectorMap.get(connection).getConnector(
getStringAttribute(name));
@@ -529,7 +529,7 @@ public final class UIDL extends JavaScriptObject {
* the name of the variable
* @return the Paintable referenced by the variable, if it exists
*/
public Connector getPaintableVariable(String name,
public ServerConnector getPaintableVariable(String name,
ApplicationConnection connection) {
return ConnectorMap.get(connection).getConnector(
getStringVariable(name));

+ 3
- 3
src/com/vaadin/terminal/gwt/client/Util.java View File

@@ -106,7 +106,7 @@ public class Util {
}
String pid = paintableMap.getConnectorId(paintable);
if (pid != null) {
Connector otherPaintable = paintableMap.getConnector(pid);
ServerConnector otherPaintable = paintableMap.getConnector(pid);
if (otherPaintable == paintable) {
return applicationConnection;
}
@@ -834,9 +834,9 @@ public class Util {
Object value = parameters[1];
// TODO paintables inside lists/maps get rendered as
// components in the debug console
String formattedValue = value instanceof Connector ? c
String formattedValue = value instanceof ServerConnector ? c
.getConnectorMap()
.getConnectorId((Connector) value) : String
.getConnectorId((ServerConnector) value) : String
.valueOf(value);
formattedParams = parameters[0] + " : " + formattedValue;
}

+ 2
- 2
src/com/vaadin/terminal/gwt/client/communication/JsonDecoder.java View File

@@ -15,7 +15,7 @@ import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.ServerConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;

/**
@@ -39,7 +39,7 @@ public class JsonDecoder {
* @param jsonArray
* JSON array with two elements
* @param idMapper
* mapper between connector ID and {@link Connector} objects
* mapper between connector ID and {@link ServerConnector} objects
* @param connection
* reference to the current ApplicationConnection
* @return decoded value (does not contain JSON types)

+ 4
- 4
src/com/vaadin/terminal/gwt/client/communication/JsonEncoder.java View File

@@ -14,7 +14,7 @@ import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.ServerConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;

/**
@@ -91,8 +91,8 @@ public class JsonEncoder {
jsonMap.put(mapKey, encode(mapValue, connectorMap, connection));
}
return combineTypeAndValue(VTYPE_MAP, jsonMap);
} else if (value instanceof Connector) {
Connector paintable = (Connector) value;
} else if (value instanceof ServerConnector) {
ServerConnector paintable = (ServerConnector) value;
return combineTypeAndValue(VTYPE_PAINTABLE, new JSONString(
connectorMap.getConnectorId(paintable)));
} else {
@@ -123,7 +123,7 @@ public class JsonEncoder {
private static String getTransportType(Object value) {
if (value instanceof String) {
return VTYPE_STRING;
} else if (value instanceof Connector) {
} else if (value instanceof ServerConnector) {
return VTYPE_PAINTABLE;
} else if (value instanceof Boolean) {
return VTYPE_BOOLEAN;

+ 2
- 2
src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java View File

@@ -10,7 +10,7 @@ import java.util.HashMap;
import java.util.Map;

import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.ServerConnector;
import com.vaadin.terminal.gwt.client.communication.ClientRpc;

/**
@@ -21,7 +21,7 @@ import com.vaadin.terminal.gwt.client.communication.ClientRpc;
* @since 7.0.0
*
*/
public abstract class AbstractConnector implements Connector {
public abstract class AbstractConnector implements ServerConnector {

private ApplicationConnection connection;
private String id;

+ 2
- 2
src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java View File

@@ -24,7 +24,7 @@ import com.google.gwt.xhr.client.ReadyStateChangeHandler;
import com.google.gwt.xhr.client.XMLHttpRequest;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.ServerConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder;
import com.vaadin.terminal.gwt.client.RenderInformation;
@@ -420,7 +420,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements
}

private String getPid() {
return ConnectorMap.get(client).getConnectorId((Connector) this);
return ConnectorMap.get(client).getConnectorId((ServerConnector) this);
}

public VDropHandler getDropHandler() {

+ 2
- 2
src/com/vaadin/terminal/gwt/widgetsetutils/RpcManagerGenerator.java View File

@@ -20,7 +20,7 @@ import com.google.gwt.core.ext.typeinfo.JType;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
import com.google.gwt.user.rebind.SourceWriter;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.ServerConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.communication.ClientRpc;
import com.vaadin.terminal.gwt.client.communication.MethodInvocation;
@@ -130,7 +130,7 @@ public class RpcManagerGenerator extends Generator {
}
}
sourceWriter
.println(Connector.class.getName()
.println(ServerConnector.class.getName()
+ " connector = connectorMap.getConnector(invocation.getConnectorId());");
sourceWriter
.println("for ("

Loading…
Cancel
Save