diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-02-17 12:52:50 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-02-17 12:52:50 +0200 |
commit | 0edb315f69b50a789be3bf6737bbe73ed0feefee (patch) | |
tree | 71f1e9de2686ead69efbd94b9e135aab04a2c001 | |
parent | f82f4d59015209feae98743bc27744a81ded89b8 (diff) | |
download | vaadin-framework-0edb315f69b50a789be3bf6737bbe73ed0feefee.tar.gz vaadin-framework-0edb315f69b50a789be3bf6737bbe73ed0feefee.zip |
Update to simulate captions in ChildComponentContainer (#8313)
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ComponentLocator.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ComponentLocator.java b/src/com/vaadin/terminal/gwt/client/ComponentLocator.java index 0a35c2d32c..51e600abaf 100644 --- a/src/com/vaadin/terminal/gwt/client/ComponentLocator.java +++ b/src/com/vaadin/terminal/gwt/client/ComponentLocator.java @@ -480,27 +480,25 @@ public class ComponentLocator { // the same type before it int nextIndex = 0; for (Widget child : layout) { - // Don't count captions - if (child instanceof VCaption) { - continue; - } - boolean matchingType = nextWidgetClassName.equals(Util .getSimpleName(child)); - if (widgetPosition == 0) { - // This is the n:th child - - // Error if not the expected type - if (!matchingType) { - return null; - } + if (matchingType && widgetPosition == 0) { + // This is the n:th child that we looked for break; + } else if (widgetPosition < 0) { + // Error if we're past the desired position without + // a match + return null; } else if (matchingType) { // If this was another child of the expected type, // increase the count for the next step nextIndex++; } - widgetPosition--; + + // Don't count captions + if (!(child instanceof VCaption)) { + widgetPosition--; + } } // Advance to the next step, this time checking for the |