boolean (EventObject e) { Object node; if(e instanceof MouseEvent) { final Point point = ((MouseEvent)e).getPoint(); final TreePath location = myTree.getClosestPathForLocation(point.x, point.y); node = location.getLastPathComponent(); } else { node = myTree.getLastSelectedPathComponent(); } final ErrorTreeElement element = getElement(node); return element instanceof EditableMessageElement; }