@Override
	public List<DockingActionIf> getPopupActions(Tool activeTool, ActionContext context) {
		Object contextObject = context.getContextObject();
		if (!(contextObject instanceof MarkerLocation)) {
			return null;
		}
		MarkerLocation loc = (MarkerLocation) contextObject;
		if (loc.getProgram() != currentProgram) {
			return null;
		}
		BookmarkManager mgr = currentProgram.getBookmarkManager();
		Address address = loc.getAddr();
		Bookmark[] bookmarks = mgr.getBookmarks(address);

		List<DockingActionIf> defaultBookmarkList = new ArrayList<>();
		for (Bookmark element : bookmarks) {
			DockingAction action = new DeleteBookmarkAction(this, element, false);
			action.setEnabled(true);
			defaultBookmarkList.add(action);
		}

		// add the delete actions at the current address
		List<DockingActionIf> popupActionList = new ArrayList<>();
		addActionsToList(popupActionList, defaultBookmarkList, MAX_DELETE_ACTIONS);

		// add the delete actions for the surrounding code unit
		List<DockingActionIf> actionsForCodeUnitList =
			getActionsForCodeUnit(address, MAX_DELETE_ACTIONS - popupActionList.size());
		addActionsToList(popupActionList, actionsForCodeUnitList, MAX_DELETE_ACTIONS);

		return popupActionList;
	}
Called when a new bookmark is to be added; called from the add bookmark dialog

@param addr bookmark address. If null a Note bookmark will set at the start address of each
           range in the current selection
@param category bookmark category
@param comment comment text
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/BookmarkPlugin.java