]> source.dussan.org Git - vaadin-framework.git/commitdiff
Restore compatibility with selectors without slots (#9893) 92/492/1
authorLeif Åstrand <leif@vaadin.com>
Thu, 13 Dec 2012 11:24:01 +0000 (13:24 +0200)
committerLeif Åstrand <leif@vaadin.com>
Thu, 13 Dec 2012 11:24:01 +0000 (13:24 +0200)
Change-Id: Iea7661ff39d9903f78e290086c1c51f270c8c60d

client/src/com/vaadin/client/ComponentLocator.java

index 16e8859d017c4da9999af0784046ba41966b7bb9..10eae54e621876bcdedc8aeb649a59bb4ced3333 100644 (file)
@@ -31,6 +31,7 @@ import com.vaadin.client.ui.VGridLayout;
 import com.vaadin.client.ui.VTabsheetPanel;
 import com.vaadin.client.ui.VUI;
 import com.vaadin.client.ui.VWindow;
+import com.vaadin.client.ui.orderedlayout.Slot;
 import com.vaadin.client.ui.orderedlayout.VAbstractOrderedLayout;
 import com.vaadin.client.ui.window.WindowConnector;
 import com.vaadin.shared.AbstractComponentState;
@@ -654,6 +655,17 @@ public class ComponentLocator {
                     Widget child = iterator.next();
                     String simpleName2 = Util.getSimpleName(child);
 
+                    if (!widgetClassName.equals(simpleName2)
+                            && child instanceof Slot) {
+                        /*
+                         * Support legacy tests without any selector for the
+                         * Slot widget (i.e. /VVerticalLayout[0]/VButton[0]) by
+                         * directly checking the stuff inside the slot
+                         */
+                        child = ((Slot) child).getWidget();
+                        simpleName2 = Util.getSimpleName(child);
+                    }
+
                     if (widgetClassName.equals(simpleName2)) {
                         if (widgetPosition == 0) {
                             w = child;