Bladeren bron

Change widget -> connector in some places

tags/7.0.0.alpha3
Leif Åstrand 12 jaren geleden
bovenliggende
commit
9ae1a99ca3

+ 1
- 1
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java Bestand weergeven

@@ -2133,7 +2133,7 @@ public class ApplicationConnection {
int connectorType) {
// Create and register a new connector with the given type
ServerConnector p = widgetSet
.createWidget(connectorType, configuration);
.createConnector(connectorType, configuration);
connectorMap.registerConnector(connectorId, p);
p.doInit(connectorId, this);


+ 14
- 14
src/com/vaadin/terminal/gwt/client/WidgetSet.java Bestand weergeven

@@ -5,7 +5,6 @@
package com.vaadin.terminal.gwt.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector;

public class WidgetSet {
@@ -19,27 +18,28 @@ public class WidgetSet {

/**
* Create an uninitialized connector that best matches given UIDL. The
* connector must be a {@link Widget} that implements
* {@link ServerConnector}.
* connector must implement {@link ServerConnector}.
*
* @param tag
* connector type tag for the connector to create
* @param client
* the application connection that whishes to instantiate widget
* @param conf
* the application configuration to use when creating the
* connector
*
* @return New uninitialized and unregistered connector that can paint given
* UIDL.
*/
public ServerConnector createWidget(int tag, ApplicationConfiguration conf) {
public ServerConnector createConnector(int tag,
ApplicationConfiguration conf) {
/*
* Yes, this (including the generated code in WidgetMap) may look very
* odd code, but due the nature of GWT, we cannot do this any cleaner.
* Luckily this is mostly written by WidgetSetGenerator, here are just
* some hacks. Extra instantiation code is needed if client side widget
* has no "native" counterpart on client side.
* some hacks. Extra instantiation code is needed if client side
* connector has no "native" counterpart on client side.
*/

Class<? extends ServerConnector> classType = resolveInheritedWidgetType(
Class<? extends ServerConnector> classType = resolveInheritedConnectorType(
conf, tag);

if (classType == null || classType == UnknownComponentConnector.class) {
@@ -56,23 +56,23 @@ public class WidgetSet {
}
}

private Class<? extends ServerConnector> resolveInheritedWidgetType(
private Class<? extends ServerConnector> resolveInheritedConnectorType(
ApplicationConfiguration conf, int tag) {
Class<? extends ServerConnector> classType = null;
Integer t = tag;
do {
classType = resolveWidgetType(t, conf);
classType = resolveConnectorType(t, conf);
t = conf.getParentTag(t);
} while (classType == null && t != null);
return classType;
}

protected Class<? extends ServerConnector> resolveWidgetType(int tag,
protected Class<? extends ServerConnector> resolveConnectorType(int tag,
ApplicationConfiguration conf) {
Class<? extends ServerConnector> widgetClass = conf
Class<? extends ServerConnector> connectorClass = conf
.getConnectorClassByEncodedTag(tag);

return widgetClass;
return connectorClass;
}

/**

Laden…
Annuleren
Opslaan