summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java
index 50ea60a3c6..4d63703151 100644
--- a/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java
+++ b/client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java
@@ -8,6 +8,7 @@ import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.JMethod;
import com.google.gwt.core.ext.typeinfo.JType;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
public class WidgetInitVisitor extends TypeVisitor {
@@ -15,6 +16,16 @@ public class WidgetInitVisitor extends TypeVisitor {
public void visitConnector(TreeLogger logger, JClassType type,
ConnectorBundle bundle) {
if (ConnectorBundle.isConnectedComponentConnector(type)) {
+ JClassType createWidgetClass = findInheritedMethod(type,
+ "createWidget").getEnclosingType();
+ boolean createWidgetOverridden = !createWidgetClass
+ .getQualifiedSourceName()
+ .equals(AbstractComponentConnector.class.getCanonicalName());
+ if (createWidgetOverridden) {
+ // Don't generate if createWidget is already overridden
+ return;
+ }
+
JMethod getWidget = findInheritedMethod(type, "getWidget");
bundle.setNeedsReturnType(type, getWidget);