// The annotation is completely inside the selection
if (pos.offset >= selectionOffset
&& pos.offset <= selectionOffset + length) {
boolean collapsed = annotation.isCollapsed();
pModel.expand(annotation);
Position newPos = new Position(pos.offset-selectionOffset,pos.length);
annotationList.add(new AnnotationPosition(annotation,newPos,collapsed));
// Remove the annotation for now.
pModel.removeAnnotation(annotation);