/** * Returns a selection similar to <code>selection</code> but {@linkplain #isEmpty(ISelection) * empty}. Typically, the selection is reduced to its extreme offsets. * * @param selection the selection * @param beginning <code>true</code> to collapse the selection to its smallest position (i.e. * its left-most offset), <code>false</code> to collapse it to its greatest position * (e.g its right-most offset) * @return an empty variant of <code>selection</code> * @throws BadLocationException if accessing the document failed */ public ISelection makeEmpty(ISelection selection, boolean beginning) throws BadLocationException { return getImplementation(selection).makeEmpty(selection, beginning); }
/** * Returns a selection similar to <code>selection</code> but {@linkplain #isEmpty(ISelection) * empty}. Typically, the selection is reduced to its extreme offsets. * * @param selection the selection * @param beginning <code>true</code> to collapse the selection to its smallest position (i.e. * its left-most offset), <code>false</code> to collapse it to its greatest position * (e.g its right-most offset) * @return an empty variant of <code>selection</code> * @throws BadLocationException if accessing the document failed */ public ISelection makeEmpty(ISelection selection, boolean beginning) throws BadLocationException { return getImplementation(selection).makeEmpty(selection, beginning); }
/** * Returns the selection after replacing <code>selection</code> by <code>replacement</code>. * * @param selection the selection to be replaced * @param replacement the replacement text * @return the selection that the user expects after the specified replacement operation * @throws BadLocationException if accessing the document failed */ ISelection makeReplaceSelection(ISelection selection, String replacement) throws BadLocationException { return makeEmpty(selection, false); } }
/** * Returns the selection after replacing <code>selection</code> by <code>replacement</code>. * * @param selection the selection to be replaced * @param replacement the replacement text * @return the selection that the user expects after the specified replacement operation * @throws BadLocationException if accessing the document failed */ ISelection makeReplaceSelection(ISelection selection, String replacement) throws BadLocationException { return makeEmpty(selection, false); } }