2003/09/27 09:08:26
[org.ibex.core.git] / src / org / xwt / Template.java
index 209ae25..338771d 100644 (file)
@@ -117,7 +117,7 @@ public class Template {
             t.apply(b, callback, xwt);
         }
 
-        PerInstantiationScope pis = new PerInstantiationScope(b, xwt, parentPis);
+        PerInstantiationScope pis = new PerInstantiationScope(b, xwt, parentPis, staticScope);
         for (int i=0; children != null && i<children.size(); i++) {
             Box kid = new Box();
             ((Template)children.elementAt(i)).apply(kid, callback, xwt, pis);
@@ -337,21 +337,24 @@ public class Template {
     private static class PerInstantiationScope extends JS.Scope {
         XWT xwt = null;
         PerInstantiationScope parentBoxPis = null;
+        JS.Scope myStatic = null;
         void putDollar(String key, Box target) {
             if (parentBoxPis != null) parentBoxPis.putDollar(key, target);
             declare("$" + key);
             put("$" + key, target);
         }
-        public PerInstantiationScope(Scope parentScope, XWT xwt, PerInstantiationScope parentBoxPis) {
+        public PerInstantiationScope(Scope parentScope, XWT xwt, PerInstantiationScope parentBoxPis, JS.Scope myStatic) {
             super(parentScope);
             this.parentBoxPis = parentBoxPis;
             this.xwt = xwt;
+            this.myStatic = myStatic;
         }
         public boolean isTransparent() { return true; }
         public boolean has(Object key) { return false; }
         public void declare(String s) { super.declare(s); }
         public Object get(Object key) {
             if (key.equals("xwt")) return xwt;
+            if (key.equals("static")) return myStatic;
             if (Box.SpecialBoxProperty.specialBoxProperties.get(key.toString()) != null) return getParentScope().get(key);
             if (super.has(key)) return super.get(key);
             Object ret = xwt.rr.get(key);