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);
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]);
}
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);