// Defer change requests so that if changes are
// requested during execution, they get queued.
previousDeferStatus = setDeferringChangeRequests(true);
while (requests.hasNext()) {
ChangeRequest change = (ChangeRequest) requests.next();
change.setListeners(_changeListeners);
if (_debugging) {
_debug("-- Executing change request "
+ "with description: "
+ change.getDescription());
}
// The change listeners should be those of this
// actor and any container that it has!
// FIXME: This is expensive... Better solution?
// We previously tried issuing a dummy change
// request to the container, but this caused big
// problems... (weird null-pointer expections
// deep in diva when making connections).
// Is it sufficient to just go to the top level?
List changeListeners = new LinkedList();
NamedObj container = getContainer();
while (container != null) {
List list = container.getChangeListeners();
if (list != null) {
changeListeners.addAll(list);
}
container = container.getContainer();
}
change.setListeners(changeListeners);
change.execute();
}
} finally {
_workspace.doneWriting();
setDeferringChangeRequests(previousDeferStatus);
}