RichTextArea — like
org.jabref.htmltonode.HtmlView, but with native text selection, caret navigation, and
accessibility. The area scrolls itself; do not wrap this view in a ScrollPane.
Re-renders whenever htmlProperty() or optionsProperty() changes. Must be used on the
JavaFX application thread. Requires the jfx.incubator.richtext module at runtime.
| Modifier and Type | Field and Description |
|---|---|
| private final RichTextArea | |
| private final StringProperty | |
| private final ObjectProperty |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final String | |
| public final HtmlRenderOptions | |
| public final RichTextArea | |
| public final Optional | getSelectedText()
Returns: the selected text, joined with line breaks at paragraph boundaries; empty if nothing is selected |
| public final StringProperty | |
| public final boolean | isPressOnSelection(double
the horizontal screen coordinate of a mouse press screenX, double the vertical screen coordinate of a mouse press screenY)Returns: whether the given position lies on the current text selection — only then a drag gesture should drag the selected content instead of extending the selection |
| public final ObjectProperty | |
| private void | |
| public final void | |
| public final void | setOptions(@Nullable HtmlRenderOptions
the rendering options; newOptions)null restores HtmlRenderOptions#defaults()
|
| public final void | setUseContentHeight(boolean
whether the area should size to its content on)Sizes the area to its content so that an enclosing pane handles the scrolling — by default the area scrolls itself. |
| public final String | Returns: the plain text; seeHtmlToNode#toPlainText(String)Extracts readable plain text from the current content, e.g. for "copy as text". |
| area | back to summary |
|---|---|
| private final RichTextArea area | |
| html | back to summary |
|---|---|
| private final StringProperty html | |
| options | back to summary |
|---|---|
| private final ObjectProperty<HtmlRenderOptions> options | |
| RichHtmlView | back to summary |
|---|---|
| public RichHtmlView() Creates an empty view with | |
| getHtml | back to summary |
|---|---|
public final String getHtml()
| |
| getOptions | back to summary |
|---|---|
public final HtmlRenderOptions getOptions()
| |
| getRichTextArea | back to summary |
|---|---|
public final RichTextArea getRichTextArea()
| |
| getSelectedText | back to summary |
|---|---|
| public final Optional | |
| htmlProperty | back to summary |
|---|---|
| public final StringProperty htmlProperty() The HTML content of this view. Setting a new value re-renders. Never
| |
| isPressOnSelection | back to summary |
|---|---|
public final boolean isPressOnSelection(double screenX, double screenY)
| |
| optionsProperty | back to summary |
|---|---|
| public final ObjectProperty The rendering options of this view. Setting a new value re-renders. Never
| |
| rerender | back to summary |
|---|---|
| private void rerender() | |
| setHtml | back to summary |
|---|---|
| public final void setHtml(@Nullable String newHtml) | |
| setOptions | back to summary |
|---|---|
public final void setOptions(@Nullable HtmlRenderOptions newOptions)
| |
| setUseContentHeight | back to summary |
|---|---|
| public final void setUseContentHeight(boolean on) Sizes the area to its content so that an enclosing pane handles the scrolling — by default the area scrolls itself.
| |
| toPlainText | back to summary |
|---|---|
| public final String toPlainText() Extracts readable plain text from the current content, e.g. for "copy as text".
| |