* @param editor Editor to set the annotation, with non-null selection and doc.
* @param key Annotation key to set.
* @param value Annotation value to set key to.
*/
public static void setAnnotationOverSelection(EditorContext editor, String key, String value) {
Range range = Preconditions.checkNotNull(
editor.getSelectionHelper().getSelectionRange(), "Editor must have selection").asRange();
setAnnotationOverRange(editor.getDocument(), editor.getCaretAnnotations(),
key, value, range.getStart(), range.getEnd());
}