Use new methods in Prototype to check whether an object is of this prototype or

one of its parent prototypes when resolving macro handlers.
This commit is contained in:
hns 2003-03-04 18:19:33 +00:00
parent 2c8585c611
commit 49f011ab87
2 changed files with 6 additions and 5 deletions

View file

@ -212,9 +212,9 @@ public final class RequestEvaluator implements Runnable {
if (currentElement != null) { if (currentElement != null) {
// add to requestPath array // add to requestPath array
requestPath.add (currentElement); requestPath.add (currentElement);
String protoName = app.getPrototypeName (currentElement); Prototype proto = app.getPrototype (currentElement);
if (protoName != null) if (proto != null)
macroHandlers.put (protoName, currentElement); proto.addToHandlerMap (macroHandlers, currentElement);
} }
} }
} }

View file

@ -347,10 +347,11 @@ public final class Skin {
// was called with this object - check it or its parents for matching prototype // was called with this object - check it or its parents for matching prototype
if (!handler.equals ("this") && !handler.equals (app.getPrototypeName (thisObject))) { if (!handler.equals ("this") && !handler.equals (app.getPrototypeName (thisObject))) {
// the handler object is not what we want // the handler object is not what we want
Object n = app.getParentElement (thisObject); Object n = thisObject;
// walk down parent chain to find handler object // walk down parent chain to find handler object
while (n != null) { while (n != null) {
if (handler.equals (app.getPrototypeName (n))) { Prototype proto = app.getPrototype (n);
if (proto != null && proto.isInstanceOf (handler)) {
handlerObject = n; handlerObject = n;
break; break;
} }