Package java.text

Examples of java.text.BreakIterator.previous()


        while (pos < FIRST_LINE_MAX_SIZE
                && pos != BreakIterator.DONE) {
            pos = breaker.next();
        }
        if (pos != BreakIterator.DONE
                && breaker.previous() != BreakIterator.DONE) {
            return text.substring(0, breaker.current()).replaceAll("\\s*$", "") + "…";
        }
        return text.substring(0, FIRST_LINE_MAX_SIZE-1) + "…";
    }

View Full Code Here


            return rowStart;
        }
        if (wordStart == (offsetInRow + 1)) {
            // This is the case we guarded against by added an "X" to the string we're testing.
            // We need to find the previous word break.
            wordStart = it.previous();
        }
        return rowStart + wordStart;
    }
   
    private DocumentUtils() {/**/}
 
View Full Code Here

                    return null;
                }
                if (end > seg.offset + seg.count) {
                    return null;
                }
                int begin = iterator.previous();
                if (begin == BreakIterator.DONE ||
                    begin >= seg.offset + seg.count) {
                    return null;
                }
                seg.modelOffset = seg.modelOffset + begin - seg.offset;
View Full Code Here

        }

        BreakIterator wordBreakIterator = BreakIterator.getWordInstance();
        wordBreakIterator.setText(getText());
        wordBreakIterator.preceding(getCaretPosition());
        wordBreakIterator.previous();

        moveTo(wordBreakIterator.current(), selectionPolicy);
    }

    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.