Package org.fxmisc.richtext

Examples of org.fxmisc.richtext.TwoLevelNavigator


                });

        // initialize navigator
        IntSupplier cellCount = () -> area.getParagraphs().size();
        IntUnaryOperator cellLength = i -> virtualFlow.getCell(i).getNode().getLineCount();
        navigator = new TwoLevelNavigator(cellCount, cellLength);

        // emits a value every time the area is done updating
        EventStream<?> areaDoneUpdating = area.beingUpdatedProperty().offs();

        // follow the caret every time the caret position or paragraphs change
View Full Code Here


        return getLines().length;
    }

    public int currentLineIndex() {
        TextLine[] lines = getLines();
        TwoLevelNavigator navigator = new TwoLevelNavigator(() -> lines.length, i -> lines[i].getLength());
        return navigator.offsetToPosition(clampedCaretPosition.intValue(), Forward).getMajor();
    }
View Full Code Here

TOP

Related Classes of org.fxmisc.richtext.TwoLevelNavigator

Copyright © 2018 www.massapicom. 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.