public boolean toggleBookmark(int line) throws BadLocationException {

		if (!isBookmarkingEnabled() || getBookmarkIcon()==null) {
			return false;
		}

		GutterIconInfo[] icons = getTrackingIcons(line);
		if (icons.length==0) {
			int offs = textArea.getLineStartOffset(line);
			addOffsetTrackingIcon(offs, bookmarkIcon);
			return true;
		}

		boolean found = false;
		for (int i=0; i<icons.length; i++) {
			if (icons[i].getIcon()==bookmarkIcon) {
				removeTrackingIcon(icons[i]);
				found = true;
				// Don't quit, in case they manipulate the document so > 1
				// bookmark is on a single line (kind of flaky, but it
				// works...).  If they delete all chars in the document,
				// AbstractDocument gets a little flaky with the returned line
				// number for viewToModel(), so this is just us trying to save
				// face a little.
			}
		}
		if (!found) {
			int offs = textArea.getLineStartOffset(line);
			addOffsetTrackingIcon(offs, bookmarkIcon);
		}

		return !found;

	}