} else {
p.apply(document);
}
fireAppliedEvent(p);
TextSelection selection= p.getSelection(document);
if (selection != null) {
contentAssistSubjectControlAdapter.setSelectedRange(selection.offset, selection.length);
contentAssistSubjectControlAdapter.revealRange(selection.offset, selection.length);
}