summaryrefslogtreecommitdiffstats
path: root/client-compiler
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-02-22 16:23:49 +0200
committerArtur Signell <artur@vaadin.com>2013-02-22 16:24:06 +0200
commitfbdc52551e258d938db2e230366ca0e21d35c5bc (patch)
tree640740bcb63c2757facc9f19748a65eb46b50174 /client-compiler
parentd9a8a21a62b977e32b65bcf436bbd229c9b798f4 (diff)
parent7af5b3fceb75b6f505a9a6d0a843b788bb06d9a7 (diff)
downloadvaadin-framework-fbdc52551e258d938db2e230366ca0e21d35c5bc.tar.gz
vaadin-framework-fbdc52551e258d938db2e230366ca0e21d35c5bc.zip
Merge remote-tracking branch 'origin/7.0'
Change-Id: Id48ccb3c400a78cddb8bb5c7bbcf2d65174e59d0
Diffstat (limited to 'client-compiler')
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java16
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java35
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java19
3 files changed, 70 insertions, 0 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
index f8aa586064..2be3bf5a16 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java
@@ -334,6 +334,22 @@ public class ConnectorBundleLoaderFactory extends Generator {
writeGetters(logger, w, bundle);
writeSerializers(logger, w, bundle);
writeDelegateToWidget(logger, w, bundle);
+ writeHasGetTooltip(logger, w, bundle);
+ }
+
+ /**
+ * @deprecated As of 7.0.1. This is just a hack to avoid breaking backwards
+ * compatibility and will be removed in Vaadin 7.1
+ */
+ @Deprecated
+ private void writeHasGetTooltip(TreeLogger logger, SplittingSourceWriter w,
+ ConnectorBundle bundle) {
+ Set<JClassType> types = bundle.getHasGetTooltip();
+ for (JClassType type : types) {
+ w.println("store.setHasGetTooltipInfo(%s);",
+ getClassLiteralString(type));
+ w.splitIfNeeded();
+ }
}
private void writeDelegateToWidget(TreeLogger logger,
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 ff91e249b7..f6dc982f15 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
@@ -63,6 +63,7 @@ public class ConnectorBundle {
private final Set<JClassType> needsGwtConstructor = new HashSet<JClassType>();
private final Set<JClassType> visitedTypes = new HashSet<JClassType>();
private final Set<JClassType> needsProxySupport = new HashSet<JClassType>();
+ private final Set<JClassType> hasGetTooltip = new HashSet<JClassType>();
private final Map<JClassType, Set<String>> identifiers = new HashMap<JClassType, Set<String>>();
private final Map<JClassType, Set<JMethod>> needsReturnType = new HashMap<JClassType, Set<JMethod>>();
@@ -618,4 +619,38 @@ public class ConnectorBundle {
public Set<Property> getNeedsDelegateToWidget() {
return Collections.unmodifiableSet(needsDelegateToWidget);
}
+
+ /**
+ * @deprecated As of 7.0.1. This is just a hack to avoid breaking backwards
+ * compatibility and will be removed in Vaadin 7.1
+ */
+ @Deprecated
+ public Set<JClassType> getHasGetTooltip() {
+ return Collections.unmodifiableSet(hasGetTooltip);
+ }
+
+ /**
+ * @deprecated As of 7.0.1. This is just a hack to avoid breaking backwards
+ * compatibility and will be removed in Vaadin 7.1
+ */
+ @Deprecated
+ public void setHasGetTooltip(JClassType type) {
+ if (!isHasGetTooltip(type)) {
+ hasGetTooltip.add(type);
+ }
+ }
+
+ /**
+ * @deprecated As of 7.0.1. This is just a hack to avoid breaking backwards
+ * compatibility and will be removed in Vaadin 7.1
+ */
+ @Deprecated
+ private boolean isHasGetTooltip(JClassType type) {
+ if (hasGetTooltip.contains(type)) {
+ return true;
+ } else {
+ return previousBundle != null
+ && previousBundle.isHasGetTooltip(type);
+ }
+ }
} \ No newline at end of file
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 4de9d2ae99..662ecf872b 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java
@@ -47,6 +47,25 @@ public class WidgetInitVisitor extends TypeVisitor {
bundle.setNeedsReturnType(type, getWidget);
}
+ // Hack to detect when getTooltipInfo has a custom implementation
+ // #11051
+ JClassType getTooltipParamType = type.getOracle().findType(
+ "com.google.gwt.dom.client.Element");
+ JMethod getTooltipInfoMethod = findInheritedMethod(type,
+ "getTooltipInfo", getTooltipParamType);
+ if (getTooltipInfoMethod == null) {
+ logger.log(Type.ERROR, "Could not find getTooltipInfo in "
+ + type.getQualifiedSourceName());
+ throw new UnableToCompleteException();
+ }
+ JClassType enclosingType = getTooltipInfoMethod.getEnclosingType();
+ if (!enclosingType.getQualifiedSourceName().equals(
+ AbstractComponentConnector.class.getCanonicalName())) {
+ logger.log(Type.WARN, type.getQualifiedSourceName()
+ + " has overridden getTooltipInfo");
+ bundle.setHasGetTooltip(type);
+ }
+
// Check state properties for @DelegateToWidget
JMethod getState = findInheritedMethod(type, "getState");
JClassType stateType = getState.getReturnType().isClass();