ScrollPane that JabRef's PreviewViewer already is (instead of a WebView).
Not a live browser: re-renders whenever htmlProperty() or optionsProperty() changes.
Must be used on the JavaFX application thread, like any other node.
| Modifier and Type | Field and Description |
|---|---|
| private final StringProperty | |
| private final ObjectProperty |
| Access | Constructor and Description |
|---|---|
| public | |
| public | HtmlView(@Nullable String
the initial HTML content; html)null is treated as emptyCreates a view showing |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final String | |
| public final HtmlRenderOptions | |
| public final Optional | |
| public final StringProperty | |
| public final boolean | isPressOnSelection()
Returns: whether the current mouse press started on an existing selection — drag-and-drop consumers should only drag the content in that case, otherwise dragging extends the text selection |
| public final ObjectProperty | |
| private void | |
| private Optional | |
| public final void | |
| public final void | setOptions(@Nullable HtmlRenderOptions
the rendering options; newOptions)null restores HtmlRenderOptions#defaults()
|
| public final String | Returns: the plain text; seeHtmlToNode#toPlainText(String)Extracts readable plain text from the current content, e.g. for "copy as text". |
| html | back to summary |
|---|---|
| private final StringProperty html | |
| options | back to summary |
|---|---|
| private final ObjectProperty<HtmlRenderOptions> options | |
| HtmlView | back to summary |
|---|---|
| public HtmlView() Creates an empty view with | |
| HtmlView | back to summary |
|---|---|
| public HtmlView(@Nullable String html) Creates a view showing | |
| clearSelection | back to summary |
|---|---|
| public final void clearSelection() Clears the mouse text selection. | |
| getHtml | back to summary |
|---|---|
public final String getHtml()
| |
| getOptions | back to summary |
|---|---|
public final HtmlRenderOptions getOptions()
| |
| 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()
| |
| 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() | |
| selection | back to summary |
|---|---|
| private Optional | |
| setHtml | back to summary |
|---|---|
| public final void setHtml(@Nullable String newHtml) | |
| setOptions | back to summary |
|---|---|
public final void setOptions(@Nullable HtmlRenderOptions newOptions)
| |
| toPlainText | back to summary |
|---|---|
| public final String toPlainText() Extracts readable plain text from the current content, e.g. for "copy as text".
| |