PS
- the paragraph style typeSEG
- the segment typeS
- the segment's styleStyledDocument<PS,SEG,S>
, TwoDimensional
GenericEditableStyledDocument
, SimpleEditableStyledDocument
public interface EditableStyledDocument<PS,SEG,S> extends StyledDocument<PS,SEG,S>
GenericStyledArea
. Specifies edit operations
on paragraph's styles, segments (like text), and segments' style, but does not worry about view-related aspects
(e.g. scrolling).Type | Property | Description |
---|---|---|
org.reactfx.SuspendableNo |
beingUpdated |
|
org.reactfx.value.Val<java.lang.Integer> |
length |
|
javafx.beans.value.ObservableValue<java.lang.String> |
text |
TwoDimensional.Bias, TwoDimensional.Position
Modifier and Type | Method | Description |
---|---|---|
org.reactfx.SuspendableNo |
beingUpdatedProperty() |
|
int |
getLength() |
Gets the value of the property length.
|
org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> |
getParagraphs() |
|
boolean |
isBeingUpdated() |
|
org.reactfx.value.Val<java.lang.Integer> |
lengthProperty() |
|
default org.reactfx.EventStream<java.util.List<PlainTextChange>> |
multiPlainChanges() |
Returns an
EventStream that emits a List of PlainTextChange s every time a non-style
change is made to this document. |
org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> |
multiRichChanges() |
Returns an
EventStream that emits a List of RichTextChange 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 org.reactfx.EventStream<PlainTextChange> |
plainChanges() |
|
void |
replace(int start,
int end,
StyledDocument<PS,SEG,S> replacement) |
Replaces the portion of this document
"from..to" with the given replacement . |
default void |
replace(Replacement<PS,SEG,S> replacement) |
Convenience method for
replace(int, int, StyledDocument) using a Replacement argument. |
void |
replaceMulti(java.util.List<Replacement<PS,SEG,S>> replacements) |
Replaces multiple portions of this document in one update.
|
default org.reactfx.EventStream<RichTextChange<PS,SEG,S>> |
richChanges() |
|
void |
setParagraphStyle(int paragraphIndex,
PS style) |
Sets the given paragraph to the given paragraph style
|
void |
setStyle(int paragraphIndex,
int fromCol,
int toCol,
S style) |
Sets the given range "fromCol..toCol" in the given paragraph to the given style
|
void |
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 style
|
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 |
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 |
ReadOnlyStyledDocument<PS,SEG,S> |
snapshot() |
Read-only snapshot of the current state of this document.
|
javafx.beans.value.ObservableValue<java.lang.String> |
textProperty() |
charAt, concat, getAbsolutePosition, getParagraph, getParagraphLength, getParagraphStyle, getParagraphStyleAtPosition, getStyleAtPosition, getStyleAtPosition, getStyleOfChar, getStyleOfChar, getStyleRangeAtPosition, getStyleRangeAtPosition, getStyleSpans, getStyleSpans, getStyleSpans, getText, getText, getText, getText, length, subDocument, subSequence, subSequence
offsetToPosition, position
javafx.beans.value.ObservableValue<java.lang.String> textProperty
org.reactfx.value.Val<java.lang.Integer> lengthProperty
getLength()
org.reactfx.SuspendableNo beingUpdatedProperty
javafx.beans.value.ObservableValue<java.lang.String> textProperty()
int getLength()
org.reactfx.value.Val<java.lang.Integer> lengthProperty()
getLength()
org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> getParagraphs()
getParagraphs
in interface StyledDocument<PS,SEG,S>
ReadOnlyStyledDocument<PS,SEG,S> snapshot()
org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> multiRichChanges()
EventStream
that emits a List
of RichTextChange
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 used replaceMulti(List)
.default org.reactfx.EventStream<java.util.List<PlainTextChange>> multiPlainChanges()
EventStream
that emits a List
of PlainTextChange
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 used replaceMulti(List)
.default org.reactfx.EventStream<PlainTextChange> plainChanges()
default org.reactfx.EventStream<RichTextChange<PS,SEG,S>> richChanges()
org.reactfx.SuspendableNo beingUpdatedProperty()
boolean isBeingUpdated()
void replaceMulti(java.util.List<Replacement<PS,SEG,S>> replacements)
default void replace(Replacement<PS,SEG,S> replacement)
replace(int, int, StyledDocument)
using a Replacement
argument.void replace(int start, int end, StyledDocument<PS,SEG,S> replacement)
"from..to"
with the given replacement
.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 documentvoid setStyle(int from, int to, S style)
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-stylevoid setStyle(int paragraphIndex, S style)
void setStyle(int paragraphIndex, int fromCol, int toCol, S style)
void setStyleSpans(int from, StyleSpans<? extends S> styleSpens)
"from..(from + styleSpans.length())"
with the given
style spansvoid setStyleSpans(int paragraphIndex, int from, StyleSpans<? extends S> styleSpens)
"from..(from + styleSpans.length())"
in the given
paragraph with the given style spansvoid setParagraphStyle(int paragraphIndex, PS style)