2003/12/16 23:01:41
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:42:58 +0000 (07:42 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:42:58 +0000 (07:42 +0000)
darcs-hash:20040130074258-2ba56-16e11c53aef310e6ee8b46a129e3db68e465a849.gz

src/org/xwt/Box.java
src/org/xwt/HTTP.java
src/org/xwt/Template.java

index 07c0066..8287e45 100644 (file)
@@ -57,6 +57,8 @@ public final class Box extends JSScope implements Scheduler.Task {
     //#define CHECKSET_BOOLEAN(prop) boolean nu = toBoolean(value); if (nu == prop) break; prop = nu;
     //#define CHECKSET_STRING(prop) if ((value==null&&prop==null)||(value!=null&&value.equals(prop))) break; prop=(String)value;
 
+    void mark_for_repack() { MARK_REPACK; }
+
     protected Box() { super(null); }
 
     static Hash boxToCursor = new Hash(500, 3);
@@ -74,7 +76,7 @@ public final class Box extends JSScope implements Scheduler.Task {
     static final String[] props = new String[] {
         "fill", "stroke", "image", "tile", "fixedaspect", "text", "path", "font",
         "shrink", "hshrink", "vshrink", "x", "y", "width", "height", "cols", "rows",
-        "colspan", "rowspan", "align", "invisible", "absolute", "globalx", "globaly",
+        "colspan", "rowspan", "align", "visible", "absolute", "globalx", "globaly",
         "minwidth", "maxwidth", "minheight", "maxheight",
         "numchildren", "redirect", "cursor", "mousex", "mousey", "xwt", "static",
         "mouseinside", "root", "thisbox", "indexof"
index 8d7ffda..de013f0 100644 (file)
@@ -782,7 +782,7 @@ public class HTTP {
                         public void perform() throws Exception {
                             Box b = new Box();
                             Template t = Template.getTemplate((Res)Main.builtin.get("org/xwt/builtin/proxy_authorization.xwt"));
-                            t.apply(b, null, null);
+                            t.apply(b, null);
                             b.put("realm", realm);
                             b.put("proxyIP", proxyIP);
                         }
index b11cf7c..1d39655 100644 (file)
@@ -106,8 +106,20 @@ public class Template {
      *  @param pboxes a vector of all box parents on which to put $-references
      *  @param ptemplates a vector of the fileNames to recieve private references on the pboxes
      */
-    void apply(Box b, XWT xwt) throws JSExn { apply(b, xwt, null); }
-    void apply(Box b, XWT xwt, PerInstantiationJSScope parentPis) throws JSExn {
+    void apply(Box b, XWT xwt) {
+        try {
+            apply(b, xwt, null);
+        } catch (JSExn e) {
+            b.clear(b.VISIBLE);
+            b.mark_for_repack();
+            Log.log(Template.class, "WARNING: exception (below) thrown during application of template;");
+            Log.log(Template.class, "         setting visibility of target box to \"false\"");
+            Log.logJS(e);
+        }
+    }
+
+
+    private void apply(Box b, XWT xwt, PerInstantiationJSScope parentPis) throws JSExn {
 
         getStatic();