Package org.fxmisc.richtext.model
Interface EditableStyledDocument<PS,SEG,S>
-
- Type Parameters:
PS- the paragraph style typeSEG- the segment typeS- the segment's style
- All Superinterfaces:
StyledDocument<PS,SEG,S>,TwoDimensional
- All Known Implementing Classes:
GenericEditableStyledDocument,SimpleEditableStyledDocument
public interface EditableStyledDocument<PS,SEG,S> extends StyledDocument<PS,SEG,S>
Content model forGenericStyledArea. Specifies edit operations on paragraph's styles, segments (like text), and segments' style, but does not worry about view-related aspects (e.g. scrolling).
-
-
Property Summary
Properties Type Property Description SuspendableNobeingUpdatedVal<Integer>lengthObservableValue<String>text
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.fxmisc.richtext.model.TwoDimensional
TwoDimensional.Bias, TwoDimensional.Position
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SuspendableNobeingUpdatedProperty()intgetLength()Gets the value of the property length.LiveList<Paragraph<PS,SEG,S>>getParagraphs()booleanisBeingUpdated()Val<Integer>lengthProperty()default EventStream<List<PlainTextChange>>multiPlainChanges()Returns anEventStreamthat emits aListofPlainTextChanges every time a non-style change is made to this document.EventStream<List<RichTextChange<PS,SEG,S>>>multiRichChanges()Returns anEventStreamthat emits aListofRichTextChanges every time a change is made to this document, even when such a change does not modify the underlying document in any way.default EventStream<PlainTextChange>plainChanges()voidreplace(int start, int end, StyledDocument<PS,SEG,S> replacement)Replaces the portion of this document"from..to"with the givenreplacement.default voidreplace(Replacement<PS,SEG,S> replacement)Convenience method forreplace(int, int, StyledDocument)using aReplacementargument.voidreplaceMulti(List<Replacement<PS,SEG,S>> replacements)Replaces multiple portions of this document in one update.default EventStream<RichTextChange<PS,SEG,S>>richChanges()voidsetParagraphStyle(int paragraphIndex, PS style)Sets the given paragraph to the given paragraph stylevoidsetStyle(int paragraphIndex, int fromCol, int toCol, S style)Sets the given range "fromCol..toCol" in the given paragraph to the given stylevoidsetStyle(int from, int to, S style)Sets the style of all segments in the given "from..to" range to the given style.voidsetStyle(int paragraphIndex, S style)Sets all segments in the given paragraph to the given stylevoidsetStyleSpans(int paragraphIndex, int from, StyleSpans<? extends S> styleSpens)Replaces the style spans for the given range"from..(from + styleSpans.length())"in the given paragraph with the given style spansvoidsetStyleSpans(int from, StyleSpans<? extends S> styleSpens)Replaces the style spans for the given range"from..(from + styleSpans.length())"with the given style spansReadOnlyStyledDocument<PS,SEG,S>snapshot()Read-only snapshot of the current state of this document.ObservableValue<String>textProperty()-
Methods inherited from interface org.fxmisc.richtext.model.StyledDocument
charAt, concat, getAbsolutePosition, getParagraph, getParagraphLength, getParagraphStyle, getParagraphStyleAtPosition, getStyleAtPosition, getStyleAtPosition, getStyleOfChar, getStyleOfChar, getStyleRangeAtPosition, getStyleRangeAtPosition, getStyleSpans, getStyleSpans, getStyleSpans, getText, getText, getText, getText, length, subDocument, subSequence, subSequence
-
Methods inherited from interface org.fxmisc.richtext.model.TwoDimensional
offsetToPosition, position
-
-
-
-
Property Detail
-
text
ObservableValue<String> textProperty
-
length
Val<Integer> lengthProperty
- See Also:
getLength()
-
beingUpdated
SuspendableNo beingUpdatedProperty
-
-
Method Detail
-
textProperty
ObservableValue<String> textProperty()
-
getLength
int getLength()
Gets the value of the property length.- Property description:
-
lengthProperty
Val<Integer> lengthProperty()
- See Also:
getLength()
-
getParagraphs
LiveList<Paragraph<PS,SEG,S>> getParagraphs()
- Specified by:
getParagraphsin interfaceStyledDocument<PS,SEG,S>
-
snapshot
ReadOnlyStyledDocument<PS,SEG,S> snapshot()
Read-only snapshot of the current state of this document.
-
multiRichChanges
EventStream<List<RichTextChange<PS,SEG,S>>> multiRichChanges()
Returns anEventStreamthat emits aListofRichTextChanges every time a change is made to this document, even when such a change does not modify the underlying document in any way. The emitted list will only have one item in it unless one usedreplaceMulti(List).
-
multiPlainChanges
default EventStream<List<PlainTextChange>> multiPlainChanges()
Returns anEventStreamthat emits aListofPlainTextChanges every time a non-style change is made to this document. A style change would include setting a segment's style, but not changing that segment or setting a paragraph's style. A non-style change would include adding/removing/modifying a segment itself. The emitted list will only have one item in it unless one usedreplaceMulti(List).
-
plainChanges
default EventStream<PlainTextChange> plainChanges()
-
richChanges
default EventStream<RichTextChange<PS,SEG,S>> richChanges()
-
beingUpdatedProperty
SuspendableNo beingUpdatedProperty()
-
isBeingUpdated
boolean isBeingUpdated()
-
replaceMulti
void replaceMulti(List<Replacement<PS,SEG,S>> replacements)
Replaces multiple portions of this document in one update.
-
replace
default void replace(Replacement<PS,SEG,S> replacement)
Convenience method forreplace(int, int, StyledDocument)using aReplacementargument.
-
replace
void replace(int start, int end, StyledDocument<PS,SEG,S> replacement)Replaces the portion of this document"from..to"with the givenreplacement.- Parameters:
start- the absolute position in the document that starts the portion to replaceend- the absolute position in the document that ends the portion to replacereplacement- the document that replaces the removed portion of this document
-
setStyle
void setStyle(int from, int to, S style)Sets the style of all segments in the given "from..to" range to the given style.- Parameters:
from- the absolute position in the document that starts the range to re-styleto- the absolute position in the document that ends the range to re-style
-
setStyle
void setStyle(int paragraphIndex, S style)Sets all segments in the given paragraph to the given style
-
setStyle
void setStyle(int paragraphIndex, int fromCol, int toCol, S style)Sets the given range "fromCol..toCol" in the given paragraph to the given style
-
setStyleSpans
void setStyleSpans(int from, StyleSpans<? extends S> styleSpens)Replaces the style spans for the given range"from..(from + styleSpans.length())"with the given style spans
-
setStyleSpans
void setStyleSpans(int paragraphIndex, int from, StyleSpans<? extends S> styleSpens)Replaces the style spans for the given range"from..(from + styleSpans.length())"in the given paragraph with the given style spans
-
setParagraphStyle
void setParagraphStyle(int paragraphIndex, PS style)Sets the given paragraph to the given paragraph style
-
-