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 SuspendableNo
beingUpdated
Val<Integer>
length
ObservableValue<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 SuspendableNo
beingUpdatedProperty()
int
getLength()
Gets the value of the property length.LiveList<Paragraph<PS,SEG,S>>
getParagraphs()
boolean
isBeingUpdated()
Val<Integer>
lengthProperty()
default EventStream<List<PlainTextChange>>
multiPlainChanges()
Returns anEventStream
that emits aList
ofPlainTextChange
s every time a non-style change is made to this document.EventStream<List<RichTextChange<PS,SEG,S>>>
multiRichChanges()
Returns anEventStream
that emits aList
ofRichTextChange
s 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()
void
replace(int start, int end, StyledDocument<PS,SEG,S> replacement)
Replaces the portion of this document"from..to"
with the givenreplacement
.default void
replace(Replacement<PS,SEG,S> replacement)
Convenience method forreplace(int, int, StyledDocument)
using aReplacement
argument.void
replaceMulti(List<Replacement<PS,SEG,S>> replacements)
Replaces multiple portions of this document in one update.default EventStream<RichTextChange<PS,SEG,S>>
richChanges()
void
setParagraphStyle(int paragraphIndex, PS style)
Sets the given paragraph to the given paragraph stylevoid
setStyle(int paragraphIndex, int fromCol, int toCol, S style)
Sets the given range "fromCol..toCol" in the given paragraph to the given stylevoid
setStyle(int from, int to, S style)
Sets the style of all segments in the given "from..to" range to the given style.void
setStyle(int paragraphIndex, S style)
Sets all segments in the given paragraph to the given stylevoid
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 spansvoid
setStyleSpans(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:
getParagraphs
in 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 anEventStream
that emits aList
ofRichTextChange
s 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 anEventStream
that emits aList
ofPlainTextChange
s 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 aReplacement
argument.
-
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
-
-