From: Matti Tahvonen Date: Wed, 19 Dec 2007 11:54:57 +0000 (+0000) Subject: fixes #1238 X-Git-Tag: 6.7.0.beta1~5215 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=edbbd753f79d2fda15fef5c72ab31388676d9a1e;p=vaadin-framework.git fixes #1238 svn changeset:3268/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index bfc55cc196..67f80dae77 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -654,4 +654,8 @@ public class ApplicationConnection { } return toolkitUri; } + + public String getTheme() { + return view.getTheme(); + } } diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java index c3aa2d45b9..b96c99dfad 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java @@ -181,24 +181,14 @@ public class ICustomLayout extends ComplexPanel implements Paintable, locationToElement.clear(); scanForLocations(getElement()); - // Remap image srcs in layout - Widget parent = getParent(); - while (parent != null && !(parent instanceof IView)) { - parent = parent.getParent(); - } - if (parent != null && ((IView) parent).getTheme() != null) { - String prefix; - if (uriEndsWithSlash()) { - prefix = "../ITMILL/themes/"; - } else { - prefix = "ITMILL/themes/"; - } - prefixImgSrcs(getElement(), prefix + ((IView) parent).getTheme() - + "/layouts/"); + String themeName = client.getTheme(); + String prefix; + if (uriEndsWithSlash()) { + prefix = "../ITMILL/themes/"; } else { - throw (new IllegalStateException( - "Could not find IView; maybe updateFromUIDL() was called before attaching the widget?")); + prefix = "ITMILL/themes/"; } + prefixImgSrcs(getElement(), prefix + themeName + "/layouts/"); publishResizedFunction(DOM.getFirstChild(getElement()));