From cf3587e2fd5966b7ebfd721d9413674224d1ad2a Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:35:52 +0000 Subject: [PATCH] 2003/09/19 05:26:46 darcs-hash:20040130073552-2ba56-dcb1fb26e09d187cc8db0c8527247a2adbcc8600.gz --- src/org/xwt/Box.java.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/org/xwt/Box.java.pp b/src/org/xwt/Box.java.pp index 2b3a305..4da565a 100644 --- a/src/org/xwt/Box.java.pp +++ b/src/org/xwt/Box.java.pp @@ -514,7 +514,17 @@ public final class Box extends JS.Scope { } else if ("apply".equals(method)) { if (checkOnly) return Boolean.TRUE; - if (args.elementAt(0) instanceof String) { + if (args.elementAt(0) instanceof Res) { + Res res = (Res)args.elementAt(0); + res = res.addExtension(".xwt"); + Template t = Template.buildTemplate(res, "fromResource"); + if (ThreadMessage.suspendThread()) try { + JS.Callable callback = args.length() < 2 ? null : (Callable)args.elementAt(1); + t.apply(this, null, null, callback, 0, t.numUnits()); + } finally { + ThreadMessage.resumeThread(); + } + } else if (args.elementAt(0) instanceof String) { String templatename = (String)args.elementAt(0); Template t = Template.getTemplate(templatename, null); if (t == null) { -- 1.7.10.4