diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-17 09:44:03 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-17 09:44:03 +0300 |
commit | 800efdee9d891fb07343b18bca7cd543ffebb615 (patch) | |
tree | c4a097ec5d8e6a5a8bc726f1e69f11fc533c8660 /client-compiler | |
parent | 7353c3698181bd4ccd0d5d890745ad13ff544ee6 (diff) | |
download | vaadin-framework-800efdee9d891fb07343b18bca7cd543ffebb615.tar.gz vaadin-framework-800efdee9d891fb07343b18bca7cd543ffebb615.zip |
Include getWidget return type even if createWidget is defined (#9561)
Diffstat (limited to 'client-compiler')
-rw-r--r-- | client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java index fbbabe084d..fe0c579d73 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java @@ -22,24 +22,18 @@ public class WidgetInitVisitor extends TypeVisitor { if (ConnectorBundle.isConnectedComponentConnector(type)) { JClassType createWidgetClass = findInheritedMethod(type, "createWidget").getEnclosingType(); - boolean createWidgetOverridden = !createWidgetClass + boolean needsCreateWidgetSupport = 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); - JClassType widgetType = getWidget.getReturnType().isClass(); - bundle.setNeedsGwtConstructor(widgetType); JMethod getState = findInheritedMethod(type, "getState"); JClassType stateType = getState.getReturnType().isClass(); Collection<Property> properties = bundle.getProperties(stateType); + boolean hasDelegateToWidget = false; for (Property property : properties) { DelegateToWidget delegateToWidget = property .getAnnotation(DelegateToWidget.class); @@ -66,8 +60,15 @@ public class WidgetInitVisitor extends TypeVisitor { throw new UnableToCompleteException(); } bundle.setNeedsInvoker(widgetType, delegatedSetter); + hasDelegateToWidget = true; } } + + if (hasDelegateToWidget || needsCreateWidgetSupport) { + bundle.setNeedsReturnType(type, getWidget); + bundle.setNeedsGwtConstructor(widgetType); + } + } } } |