/**
* Processes an idChanged event.
*/
public synchronized void idChanged(HelpModelEvent e) {
ID id = e.getID();
HelpModel helpModel = toc.getModel();
debug("idChanged("+e+")");
if (e.getSource() != helpModel) {
debug("Internal inconsistency!");
debug(" "+e.getSource()+" != "+helpModel);
throw new Error("Internal error");
}
if (id == null) {
id = helpModel.getHelpSet().getCombinedMap().getClosestID(e.getURL());
}
TreePath s = tree.getSelectionPath();
if (s != null) {
Object o = s.getLastPathComponent();
// should require only a TreeNode
if (o instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode tn = (DefaultMutableTreeNode) o;
TOCItem item = (TOCItem) tn.getUserObject();
if (item != null) {
ID nId = item.getID();
if (nId != null && nId.equals(id)) {
return;
}
}
}
}