I'm trying to write some code which modifies what happens when you
click on a bookmark, based on an annotation on that bookmark. It looks
like the load in sidebar option does something similar. I found the
code that puts the bookmarkProperties/loadInSidebar annotation on the
bookmark, but I can't find the code that actually executes when the
bookmark is clicked and decides to load in sidebar or not.

Where/what file is that code located in?