diff options
author | John Ahlroos <john@vaadin.com> | 2014-08-07 16:32:23 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2014-08-07 16:35:06 +0300 |
commit | ecff9648d1cb3d5cc4bd54d2b1e1c6357429792f (patch) | |
tree | b21f4b599183c157900b0f24d41c94e6af3b08a7 /client-compiler/src | |
parent | e5230e6a2433f5c8a74c66b73e96d0454866d316 (diff) | |
parent | ff47bdd97b03a42dfc812b4dc9ad71fa45ce3827 (diff) | |
download | vaadin-framework-ecff9648d1cb3d5cc4bd54d2b1e1c6357429792f.tar.gz vaadin-framework-ecff9648d1cb3d5cc4bd54d2b1e1c6357429792f.zip |
Merge remote-tracking branch 'origin/master' into grid
Conflicts:
WebContent/release-notes.html
Change-Id: Ie05bea7142134a7a9d655fcdf6ca232fd13c742b
Diffstat (limited to 'client-compiler/src')
3 files changed, 28 insertions, 20 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java index ab930310aa..7c3bb1eb77 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java @@ -641,13 +641,18 @@ public class ConnectorBundleLoaderFactory extends Generator { private void writeDelegateToWidget(TreeLogger logger, SplittingSourceWriter w, ConnectorBundle bundle) { - Set<Property> needsDelegateToWidget = bundle.getNeedsDelegateToWidget(); - for (Property property : needsDelegateToWidget) { - w.println("store.setDelegateToWidget(%s, \"%s\", \"%s\");", - getClassLiteralString(property.getBeanType()), - property.getName(), - property.getAnnotation(DelegateToWidget.class).value()); - + Map<JClassType, Set<Property>> needsDelegateToWidget = bundle + .getNeedsDelegateToWidget(); + for (Entry<JClassType, Set<Property>> entry : needsDelegateToWidget + .entrySet()) { + JClassType beanType = entry.getKey(); + for (Property property : entry.getValue()) { + w.println( + "store.setDelegateToWidget(%s, \"%s\", \"%s\");", + getClassLiteralString(beanType),// property.getBeanType()), + property.getName(), + property.getAnnotation(DelegateToWidget.class).value()); + } w.splitIfNeeded(); } } diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java index 80456cdf10..4a079c38b0 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2014 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -38,6 +38,7 @@ import com.google.gwt.core.ext.typeinfo.JType; import com.google.gwt.core.ext.typeinfo.NotFoundException; import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.json.client.JSONValue; +import com.google.gwt.thirdparty.guava.common.collect.Sets; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ServerConnector; @@ -74,7 +75,7 @@ public class ConnectorBundle { private final Map<JClassType, Set<JMethod>> needsOnStateChange = new HashMap<JClassType, Set<JMethod>>(); private final Set<Property> needsProperty = new HashSet<Property>(); - private final Set<Property> needsDelegateToWidget = new HashSet<Property>(); + private final Map<JClassType, Set<Property>> needsDelegateToWidget = new HashMap<JClassType, Set<Property>>(); private ConnectorBundle(String name, ConnectorBundle previousBundle, Collection<TypeVisitor> visitors, @@ -593,23 +594,25 @@ public class ConnectorBundle { } } - public void setNeedsDelegateToWidget(Property property) { - if (!isNeedsDelegateToWidget(property)) { - needsDelegateToWidget.add(property); + public void setNeedsDelegateToWidget(Property property, JClassType type) { + if (!isNeedsDelegateToWidget(type)) { + needsDelegateToWidget.put(type, Sets.newHashSet(property)); + } else if (!needsDelegateToWidget.get(type).contains(property)) { + needsDelegateToWidget.get(type).add(property); } } - private boolean isNeedsDelegateToWidget(Property property) { - if (needsDelegateToWidget.contains(property)) { + private boolean isNeedsDelegateToWidget(JClassType type) { + if (needsDelegateToWidget.containsKey(type)) { return true; } else { return previousBundle != null - && previousBundle.isNeedsDelegateToWidget(property); + && previousBundle.isNeedsDelegateToWidget(type); } } - public Set<Property> getNeedsDelegateToWidget() { - return Collections.unmodifiableSet(needsDelegateToWidget); + public Map<JClassType, Set<Property>> getNeedsDelegateToWidget() { + return Collections.unmodifiableMap(needsDelegateToWidget); } public void setNeedsOnStateChangeHandler(JClassType type, JMethod method) { 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 e3fee8d9ee..a77b523d14 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java @@ -59,7 +59,7 @@ public class WidgetInitVisitor extends TypeVisitor { .getAnnotation(DelegateToWidget.class); if (delegateToWidget != null) { // Generate meta data required for @DelegateToWidget - bundle.setNeedsDelegateToWidget(property); + bundle.setNeedsDelegateToWidget(property, stateType); // Find the delegate target method String methodName = DelegateToWidget.Helper |