Class RichParagraph
java.lang.Object
jfx.incubator.scene.control.richtext.model.RichParagraph
Represents a single immutable paragraph within the
StyledModel
.
A single paragraph may contain either:
- A number of
StyledSegments
such as styled text orSupplier
s of embeddedNode
s - A supplier of a single
Region
which fills the entire paragraph
- Since:
- 24
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Utility class for building immutableRichParagraph
s. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RichParagraph.Builder
builder()
Creates an instance of theBuilder
class.Returns the paragraph attributes.Returns the generator for this paragraphRegion
representation.abstract String
Returns the plain text of this paragraph, or null.static RichParagraph
Creates a paragraph consisting of a single Rectangle.
-
Constructor Details
-
RichParagraph
public RichParagraph()The constructor.
-
-
Method Details
-
of
Creates a paragraph consisting of a single Rectangle. The paragraph will typically assume its Rectangle preferred size, or, when the text wrap mode is on, might get resized to fit the available width.The supplied generator must not cache or keep reference to the created Node, but the created Node can keep a reference to the model or a property therein.
For example, a bidirectional binding between an inline control and some property in the model would synchronize the model with all the views that use it.
- Parameters:
paragraphGenerator
- the content generator- Returns:
- the RichParagraph instance
-
getParagraphRegion
-
getPlainText
Returns the plain text of this paragraph, or null.- Returns:
- the plain text
-
getParagraphAttributes
Returns the paragraph attributes.- Returns:
- the paragraph attributes, can be null
-
builder
Creates an instance of theBuilder
class.- Returns:
- the new Builder instance
-