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:
parent
2c8585c611
commit
49f011ab87
2 changed files with 6 additions and 5 deletions
|
@ -212,9 +212,9 @@ public final class RequestEvaluator implements Runnable {
|
|||
if (currentElement != null) {
|
||||
// add to requestPath array
|
||||
requestPath.add (currentElement);
|
||||
String protoName = app.getPrototypeName (currentElement);
|
||||
if (protoName != null)
|
||||
macroHandlers.put (protoName, currentElement);
|
||||
Prototype proto = app.getPrototype (currentElement);
|
||||
if (proto != null)
|
||||
proto.addToHandlerMap (macroHandlers, currentElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -347,10 +347,11 @@ public final class Skin {
|
|||
// was called with this object - check it or its parents for matching prototype
|
||||
if (!handler.equals ("this") && !handler.equals (app.getPrototypeName (thisObject))) {
|
||||
// the handler object is not what we want
|
||||
Object n = app.getParentElement (thisObject);
|
||||
Object n = thisObject;
|
||||
// walk down parent chain to find handler object
|
||||
while (n != null) {
|
||||
if (handler.equals (app.getPrototypeName (n))) {
|
||||
Prototype proto = app.getPrototype (n);
|
||||
if (proto != null && proto.isInstanceOf (handler)) {
|
||||
handlerObject = n;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue