Class SelectableText
java.lang.Object
io.github.jbastgen.stemma.app.ui.widget.SelectableText
Makes the text in a part of the scene selectable with the mouse and copyable, which labels cannot do. The text of such a part is in
TextFlows (a paragraph, a heading, a cell, a code block each); a drag selects from one point to another across them, a double click a
word, a triple click a paragraph, and Ctrl/⌘ + C or the context menu copies it as plain text, one line per paragraph. The selection is drawn
as a translucent layer above the text. Links keep working (a click on one is not the start of a selection).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Takes the selection away (for example before the text is replaced).static javafx.scene.text.TextFlowA paragraph of plain text as a flow thatSelectableTextcan select.javafx.scene.layout.Regionnode()The node to put into the scene: the content with the layer of the selection above it.The selected text as plain text, one line per paragraph; empty when nothing is selected.
-
Field Details
-
PREFIX
A property of a flow: text that goes before it when it is copied from its start (the bullet of a list item).- See Also:
-
-
Constructor Details
-
SelectableText
public SelectableText(javafx.scene.layout.Region content) - Parameters:
content- the rendered text blocks; every text flow in it can be selected
-
-
Method Details
-
node
public javafx.scene.layout.Region node()The node to put into the scene: the content with the layer of the selection above it. -
flow
A paragraph of plain text as a flow thatSelectableTextcan select. -
clear
public void clear()Takes the selection away (for example before the text is replaced). -
selectedText
The selected text as plain text, one line per paragraph; empty when nothing is selected.
-