public void update(XPDLElementChangeInfo info) {
if (info.getSource() == this) {
return;
}
XMLElement changedElement = info.getChangedElement();
XMLElement current = getActiveElement();
List removedElements = new ArrayList();
JaWESelectionManager jsm = JaWEManager.getInstance().getJaWEController().getSelectionManager();
if (changedElement == null || (jsm.getSelectedElements().size() == 1 && !jsm.canEditProperties())) {
setActiveElement(null);
} else if (info.getAction() == XMLElementChangeInfo.UPDATED) {
if (current != null && XMLUtil.isChildsParent(current, info.getChangedElement())) {
setActiveElement(current);
}
} else if (info.getAction() == XPDLElementChangeInfo.SELECTED) {
setActiveElement(changedElement);
// TODO: send multi sel to XMLTable and XMLList panels
// if (changedElement instanceof XMLCollection) {
// List chngdSubEls=info.getChangedSubElements();
// if (chngdSubEls.size()>0) {
// }
// }
} else if (info.getAction() == XMLElementChangeInfo.REMOVED) {
List l = info.getChangedSubElements();
if (l == null || l.size() == 0) {
l = new ArrayList();
l.add(info.getChangedElement());
}
for (int i = 0; i < l.size(); i++) {
XMLElement el = (XMLElement) l.get(i);
if (el==current || XMLUtil.isParentsChild(el, current)) {
setActiveElement(null);
}
removedElements.add(el);
}