public Enumeration keys() { throw new Error("you cannot apply for..in to a " + this.getClass().getName()); }
protected boolean isTrappable() { return true; }
- public Object get(Object name) {
+ public Object get(Object name) throws JSExn {
if (name instanceof Number)
return redirect == null ? null : redirect == this ? getChild(toInt(name)) : redirect.get(name);
throw new Error("unreachable"); // unreachable
}
- public void put(Object name, Object value) {
+ public void put(Object name, Object value) throws JSExn {
if (name instanceof Number) { put(toInt(name), value); return; }
//#switch(name)
case "text": CHECKSET_STRING(text); MARK_RESIZE; dirty();
putAndTriggerTraps("childremoved", b);
}
- public void put(int i, Object value) {
+ public void put(int i, Object value) throws JSExn {
if (i < 0) return;
if (value != null && !(value instanceof Box)) {
}
}
+
+ public final void putAndTriggerTraps(Object key, Object value) {
+ try {
+ super.putAndTriggerTraps(key, value);
+ } catch (JSExn jse) {
+ Log.logJS("attempt to put value " + value + " to key " + key + " on a box triggered a trap which threw:");
+ Log.logJS(jse);
+ }
+ }
+
+ public final Object getAndTriggerTraps(Object key) {
+ try {
+ return super.getAndTriggerTraps(key);
+ } catch (JSExn jse) {
+ Log.logJS("attempt to get key " + key + " on a box triggered a trap which threw:");
+ Log.logJS(jse);
+ return null;
+ }
+ }
}
}
}
- if (encounteredUnrenderedGlyph && callback != null) Scheduler.add(new Scheduler.Task() { public void perform() {
- for(int i=0; i<text.length(); i++) {
- Glyph g = glyphs[text.charAt(i)];
- if (g == null || g.p == null) { Scheduler.add(this); return; }
- }
- callback.perform();
- }});
+ if (encounteredUnrenderedGlyph && callback != null) Scheduler.add(new Scheduler.Task() {
+ public void perform() throws Exception{
+ for(int i=0; i<text.length(); i++) {
+ Glyph g = glyphs[text.charAt(i)];
+ if (g == null || g.p == null) { Scheduler.add(this); return; }
+ }
+ callback.perform();
+ }});
if (!latinCharsPreloaded) {
for(int i=48; i<57; i++) glyphsToBeRendered.append(glyphs[i] = new Glyph((char)i, this));
for(int i=32; i<47; i++) glyphsToBeRendered.append(glyphs[i] = new Glyph((char)i, this));
public ProxyAutoConfigRootJSScope() { super(); }
- public Object get(Object name) {
+ public Object get(Object name) throws JSExn {
if (name.equals("isPlainHostName")) return isPlainHostName;
else if (name.equals("dnsDomainIs")) return dnsDomainIs;
else if (name.equals("localHostOrDomainIs")) return localHostOrDomainIs;
scarHolder =
Picture.fromRes((Res)Main.builtin.get("org/xwt/builtin/scar.png"),
- new Scheduler.Task() { public void perform() {
+ new Scheduler.Task() { public void perform() throws JSExn {
scarImage = scarHolder.picture;
Template.getTemplate(((Res)final_rr.get(initialTemplate))).apply(new Box(), xwt);
} });