public void idChanged(HelpModelEvent e) {
debug("idChanged("+e+")");
//next values
ID id = e.getID();
contentTitle = e.getHistoryName();
URL nurl = e.getURL();
String nURL = null;
if (nurl != null)
nURL = nurl.toExternalForm();
//current values
ID currentID = null;
String currentURL = null;
String currentName = null;
FavoritesItem item = null;
HelpModel helpModel = favorites.getModel();
if (e.getSource() != helpModel) {
debug("Internal inconsistency!");
debug(" "+e.getSource()+" != "+helpModel);
throw new Error("Internal error");
}
TreePath s = tree.getSelectionPath();
if (s != null) {
Object o = s.getLastPathComponent();
// should require only a TreeNode
if (o instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode tn = (DefaultMutableTreeNode) o;
item = (FavoritesItem) tn.getUserObject();
if (item != null){
currentID = (Map.ID) dataMap.get(item);
currentURL = item.getURLSpec();
currentName = item.getName();
}
if((currentName != null) && (currentName.equals(contentTitle))){
if(currentID != null)
if(currentID.equals(id))
return;
if(currentURL != null)
if(currentURL.equals(nURL))
return;
}