2003/10/29 02:52:17
[org.ibex.core.git] / src / org / xwt / Template.java
index 338771d..e7e72b5 100644 (file)
@@ -128,8 +128,8 @@ public class Template {
 
         for(int i=0; keys != null && i<keys.length; i++)
             if (vals[i] instanceof String && ((String)vals[i]).charAt(0) == '$') b.put(keys[i], pis.get(vals[i]));
-            else if (keys[i].equals("image")) b.put("image", resolveStringToResource((String)vals[i], xwt, true));
-            else b.put(keys[i], vals[i]);
+            else if ("image".equals(keys[i])) b.put("image", resolveStringToResource((String)vals[i], xwt, true));
+            else if (keys[i] != null) b.put(keys[i], vals[i]);
     }
 
 
@@ -350,20 +350,16 @@ public class Template {
             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 (super.has(key)) return super.get(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);
-            if (ret != null) return ret;
             throw new JS.Exn("must declare " + key + " before using it!");
         }
         public void put(Object key, Object val) {
-            if (Box.SpecialBoxProperty.specialBoxProperties.get(key.toString()) != null) getParentScope().put(key, val);
-            else if (super.has(key)) super.put(key, val);
+            if (super.has(key)) super.put(key, val);
+            else if (Box.SpecialBoxProperty.specialBoxProperties.get(key.toString()) != null) getParentScope().put(key, val);
             else throw new JS.Exn("must declare " + key + " before using it!");
         }
     }