summaryrefslogtreecommitdiffstats
path: root/client/src/com
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-12-13 13:24:01 +0200
committerLeif Åstrand <leif@vaadin.com>2012-12-13 13:24:01 +0200
commit9d6d48a002125bd82ef85cf979b4194e9a5e6225 (patch)
tree13ebfcc3cdccee85d92b11588b93791af1cad5eb /client/src/com
parentac1b5cb7a1216ef7299e970bd014487e43755fd6 (diff)
downloadvaadin-framework-9d6d48a002125bd82ef85cf979b4194e9a5e6225.tar.gz
vaadin-framework-9d6d48a002125bd82ef85cf979b4194e9a5e6225.zip
Restore compatibility with selectors without slots (#9893)
Change-Id: Iea7661ff39d9903f78e290086c1c51f270c8c60d
Diffstat (limited to 'client/src/com')
-rw-r--r--client/src/com/vaadin/client/ComponentLocator.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java
index 16e8859d01..10eae54e62 100644
--- a/client/src/com/vaadin/client/ComponentLocator.java
+++ b/client/src/com/vaadin/client/ComponentLocator.java
@@ -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;