/** * Tries to find the word at the given offset. * * @param document the document * @param offset the offset * @return the word or <code>null</code> if none * @since 3.5 */ protected IRegion findWord(IDocument document, int offset) { return findWord(document, offset, getWordBreakIterator()); }
/** * Tries to find the word at the given offset. * * @param document the document * @param offset the offset * @return the word or <code>null</code> if none * @since 3.5 */ protected IRegion findWord(IDocument document, int offset) { return findWord(document, offset, getWordBreakIterator()); }
@Override public void doubleClicked(ITextViewer text) { int offset= text.getSelectedRange().x; if (offset < 0) return; final IDocument document= text.getDocument(); IRegion region= findExtendedDoubleClickSelection(document, offset); if (region == null) region= findWord(document, offset); if (region != null) text.setSelectedRange(region.getOffset(), region.getLength()); }
@Override public void doubleClicked(ITextViewer text) { int offset= text.getSelectedRange().x; if (offset < 0) return; final IDocument document= text.getDocument(); IRegion region= findExtendedDoubleClickSelection(document, offset); if (region == null) region= findWord(document, offset); if (region != null) text.setSelectedRange(region.getOffset(), region.getLength()); }
IRegion wordRegion= findWord(document, offset, getPOSIXWordBreakIterator()); if (wordRegion != null) { int wordStart= wordRegion.getOffset();
IRegion wordRegion= findWord(document, offset, getPOSIXWordBreakIterator()); if (wordRegion != null) { int wordStart= wordRegion.getOffset();