]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #1238
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 19 Dec 2007 11:54:57 +0000 (11:54 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 19 Dec 2007 11:54:57 +0000 (11:54 +0000)
svn changeset:3268/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java

index bfc55cc196e19af45471d2704f75d82f5a880213..67f80dae776f1b7166636f8f6b74cbd4feb3d6a2 100755 (executable)
@@ -654,4 +654,8 @@ public class ApplicationConnection {
         }
         return toolkitUri;
     }
+
+    public String getTheme() {
+        return view.getTheme();
+    }
 }
index c3aa2d45b97ce3444f90da5d5a6066098c608a4e..b96c99dfadea94f603a1edef6c916aa50a3ee2a4 100644 (file)
@@ -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()));