All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fxmisc.richtext.InlineCssTextArea Maven / Gradle / Ivy

There is a newer version: 0.11.3
Show newest version
package org.fxmisc.richtext;

/**
 * Text area that uses inline css to define style of text segments.
 */
public class InlineCssTextArea extends InlineStyleTextArea {

    public InlineCssTextArea() {
        super("", css -> css);
    }

    /**
     * Creates a text area with initial text content.
     * Initial caret position is set at the beginning of text content.
     *
     * @param text Initial text content.
     */
    public InlineCssTextArea(String text) {
        this();

        replaceText(0, 0, text);
        getUndoManager().forgetHistory();
        getUndoManager().mark();

        setStyleCodec(Codec.STRING_CODEC);

        // position the caret at the beginning
        selectRange(0, 0);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy