@Override public int preceding(int offset) { return fIcuBrkItr.preceding(offset); }
@Override public int preceding(int offset) { return internalPrev(delegate.preceding(offset)); }
public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous= offset - 1; do { previous= fIterator.preceding(previous); } while (!isBoundary(previous)); int last= DONE; while (previous < offset) { last= previous; previous= following(previous); } return last; }
@Override public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous= offset - 1; do { previous= fIterator.preceding(previous); } while (!isBoundary(previous)); int last= DONE; while (previous < offset) { last= previous; previous= following(previous); } return last; }
@Override public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous = offset - 1; do { previous = fIterator.preceding(previous); } while (!isBoundary(previous)); int last = DONE; while (previous < offset) { last = previous; previous = following(previous); } return last; }
@Override public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous= offset - 1; do { previous= fIterator.preceding(previous); } while (!isBoundary(previous)); int last= DONE; while (previous < offset) { last= previous; previous= following(previous); } return last; }
@Override public int preceding(int offset) { if (offset == getText().getBeginIndex()) { return DONE; } if (isBoundary(offset - 1)) { return offset - 1; } int previous = offset - 1; do { previous = fIterator.preceding(previous); } while (!isBoundary(previous)); int last = DONE; while (previous < offset) { last = previous; previous = following(previous); } return last; }
} else { assert direction == Direction.Backwards; result = breakIterator.preceding(position);
@Override protected IRegion findWord(IDocument document, int offset) { try { IRegion line = document.getLineInformationOfOffset(offset); if (offset == line.getOffset() + line.getLength()) return null; com.ibm.icu.text.BreakIterator breakIter = createBreakIterator(); breakIter.setText(new DocumentCharacterIterator(document)); int start = breakIter.preceding(offset); if (start == BreakIterator.DONE) start = line.getOffset(); int end = breakIter.following(offset); if (end == BreakIterator.DONE) end = line.getOffset() + line.getLength(); if (breakIter.isBoundary(offset)) { if (end - offset > offset - start) start = offset; else end = offset; } if (end == start) return null; return new Region(start, end - start); } catch (BadLocationException e) { return null; } }
breakIter.setText(fDocIter); int start= breakIter.preceding(position); if (start == BreakIterator.DONE) start= line.getOffset();
int start= wordBreakIterator.preceding(offset); if (start == BreakIterator.DONE) start= line.getOffset();
int start= wordBreakIterator.preceding(offset); if (start == BreakIterator.DONE) start= line.getOffset();