diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-21 12:35:37 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-22 19:25:31 +0300 |
commit | 1e4c5b995f4dc797104b9d92dddd93df75689cb2 (patch) | |
tree | a5fc52d63ecfe9c803454c140cee0a34a2846381 /client-compiler | |
parent | bcef4d5e716a275f3a3588cd9e50885129d38eb7 (diff) | |
download | vaadin-framework-1e4c5b995f4dc797104b9d92dddd93df75689cb2.tar.gz vaadin-framework-1e4c5b995f4dc797104b9d92dddd93df75689cb2.zip |
Don't generate widget creator if there's a createWidget method (#9371)
Diffstat (limited to 'client-compiler')
-rw-r--r-- | client-compiler/src/com/vaadin/terminal/gwt/widgetsetutils/metadata/WidgetInitVisitor.java | 11 |
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); |