X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fxwt%2FTemplate.java;h=324fea1b37057d8233a5a9207a9add789f58b9fc;hp=f345718c1cafea86cfc0037c4594fc0242ae8f6c;hb=66fa691f3f037006be09e5abfe747bcbbe4fe2c1;hpb=0474dacf886aee03e0081e9ae64e4e4c6721f2a5 diff --git a/src/org/xwt/Template.java b/src/org/xwt/Template.java index f345718..324fea1 100644 --- a/src/org/xwt/Template.java +++ b/src/org/xwt/Template.java @@ -273,11 +273,8 @@ public class Template { } /** adds a theme mapping, retemplatizing as needed */ - public static void retheme(String from, String to) { - if (Log.on) Log.log(Template.class, "retheming from " + from + " to " + to); + public static void retheme(Function callback) { XWF.flushXWFs(); - Resources.mapFrom.addElement(from); - Resources.mapTo.addElement(to); // clear changed marker and relink Template[] t = new Template[cache.size()]; @@ -293,6 +290,17 @@ public class Template { Box b = ((Surface)Surface.allSurfaces.elementAt(i)).root; if (b != null) reapply(b); } + + if (callback != null) + try { + callback.call(Context.enter(), null, null, new Object[] { new Double(1.0), new Double(1.0) }); + } catch (EcmaError ex) { + if (Log.on) Log.log(Template.class, "WARNING: uncaught interpreter exception: " + ex.getMessage()); + if (Log.on) Log.log(Template.class, " thrown from within progress callback at " + ex.getSourceName() + ":" + ex.getLineNumber()); + } catch (JavaScriptException ex) { + if (Log.on) Log.log(Template.class, "WARNING: uncaught ecmascript exception: " + ex.getMessage()); + if (Log.on) Log.log(Template.class, " thrown from within progress callback at " + ex.sourceFile + ":" + ex.line); + } } /** template reapplication procedure */