PS - type of style that can be applied to paragraphs (e.g. TextFlow.SEG - type of segment used in Paragraph. Can be only text
(plain or styled) or a type that combines text and other Nodes via
Either<String, Node>.S - type of style that can be applied to a segment.EditableStyledDocument<PS,SEG,S>, StyledDocument<PS,SEG,S>, TwoDimensionalpublic final class GenericEditableStyledDocument<PS,SEG,S> extends java.lang.Object implements EditableStyledDocument<PS,SEG,S>
EditableStyledDocument while still allowing a developer to specify its
generics. See SimpleEditableStyledDocument for a version that specifies its segment style to String.| Type | Property | Description |
|---|---|---|
org.reactfx.SuspendableNo |
beingUpdated |
|
org.reactfx.value.Val<java.lang.Integer> |
length |
|
org.reactfx.value.Val<java.lang.String> |
text |
beingUpdated, length, textTwoDimensional.Bias, TwoDimensional.Position| Constructor | Description |
|---|---|
GenericEditableStyledDocument(Paragraph<PS,SEG,S> initialParagraph) |
Creates an
EditableStyledDocument with given paragraph as its initial content |
GenericEditableStyledDocument(ReadOnlyStyledDocument<PS,SEG,S> initialContent) |
Creates an
EditableStyledDocument with the given document as its initial content |
GenericEditableStyledDocument(PS initialParagraphStyle,
S initialStyle,
SegmentOps<SEG,S> segmentOps) |
Creates an empty
EditableStyledDocument |
| Modifier and Type | Method | Description |
|---|---|---|
org.reactfx.SuspendableNo |
beingUpdatedProperty() |
|
StyledDocument<PS,SEG,S> |
concat(StyledDocument<PS,SEG,S> that) |
|
int |
getLength() |
Gets the value of the property length.
|
org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> |
getParagraphs() |
|
java.lang.String |
getText() |
Gets the value of the property text.
|
boolean |
isBeingUpdated() |
|
int |
length() |
|
org.reactfx.value.Val<java.lang.Integer> |
lengthProperty() |
|
org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> |
multiRichChanges() |
Returns an
EventStream that emits a List of RichTextChanges every time a change is made
to this document, even when such a change does not modify the underlying document in any way. |
TwoDimensional.Position |
offsetToPosition(int offset,
TwoDimensional.Bias bias) |
Creates a two dimensional position in some entity (e.g.
|
TwoDimensional.Position |
position(int major,
int minor) |
Creates a two dimensional position in some entity (e.g.
|
void |
replace(int start,
int end,
StyledDocument<PS,SEG,S> replacement) |
Replaces the portion of this document
"from..to" with the given replacement. |
void |
replaceMulti(java.util.List<Replacement<PS,SEG,S>> replacements) |
Replaces multiple portions of this document in one update.
|
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> styleSpans) |
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> styleSpans) |
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.
|
StyledDocument<PS,SEG,S> |
subSequence(int start,
int end) |
|
org.reactfx.value.Val<java.lang.String> |
textProperty() |
beingUpdatedProperty, getLength, getParagraphs, isBeingUpdated, lengthProperty, multiPlainChanges, multiRichChanges, plainChanges, replace, replace, replaceMulti, richChanges, setParagraphStyle, setStyle, setStyle, setStyle, setStyleSpans, setStyleSpans, snapshot, textPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcharAt, concat, getAbsolutePosition, getParagraph, getParagraphLength, getParagraphStyle, getParagraphStyleAtPosition, getStyleAtPosition, getStyleAtPosition, getStyleOfChar, getStyleOfChar, getStyleRangeAtPosition, getStyleRangeAtPosition, getStyleSpans, getStyleSpans, getStyleSpans, getText, getText, getText, getText, length, subDocument, subSequence, subSequenceoffsetToPosition, positionpublic GenericEditableStyledDocument(ReadOnlyStyledDocument<PS,SEG,S> initialContent)
EditableStyledDocument with the given document as its initial contentpublic GenericEditableStyledDocument(Paragraph<PS,SEG,S> initialParagraph)
EditableStyledDocument with given paragraph as its initial contentpublic GenericEditableStyledDocument(PS initialParagraphStyle, S initialStyle, SegmentOps<SEG,S> segmentOps)
EditableStyledDocumentpublic org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> multiRichChanges()
EditableStyledDocumentEventStream that emits a List of RichTextChanges 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 EditableStyledDocument.replaceMulti(List).multiRichChanges in interface EditableStyledDocument<PS,SEG,S>public java.lang.String getText()
getText in interface StyledDocument<PS,SEG,S>public org.reactfx.value.Val<java.lang.String> textProperty()
textProperty in interface EditableStyledDocument<PS,SEG,S>getText()public int getLength()
getLength in interface EditableStyledDocument<PS,SEG,S>public org.reactfx.value.Val<java.lang.Integer> lengthProperty()
lengthProperty in interface EditableStyledDocument<PS,SEG,S>getLength()public int length()
length in interface StyledDocument<PS,SEG,S>public org.reactfx.collection.LiveList<Paragraph<PS,SEG,S>> getParagraphs()
getParagraphs in interface EditableStyledDocument<PS,SEG,S>getParagraphs in interface StyledDocument<PS,SEG,S>public ReadOnlyStyledDocument<PS,SEG,S> snapshot()
EditableStyledDocumentsnapshot in interface EditableStyledDocument<PS,SEG,S>public final org.reactfx.SuspendableNo beingUpdatedProperty()
beingUpdatedProperty in interface EditableStyledDocument<PS,SEG,S>public final boolean isBeingUpdated()
isBeingUpdated in interface EditableStyledDocument<PS,SEG,S>public TwoDimensional.Position position(int major, int minor)
TwoDimensionalmajor value is the index within the outer list) and the minor
value is either the index within the inner list or some amount of length in a list of objects that have length.position in interface TwoDimensionalpublic TwoDimensional.Position offsetToPosition(int offset, TwoDimensional.Bias bias)
TwoDimensionaloffset value is an absolute position in that entity.offsetToPosition in interface TwoDimensionalpublic void replaceMulti(java.util.List<Replacement<PS,SEG,S>> replacements)
EditableStyledDocumentreplaceMulti in interface EditableStyledDocument<PS,SEG,S>public void replace(int start,
int end,
StyledDocument<PS,SEG,S> replacement)
EditableStyledDocument"from..to" with the given replacement.replace in interface EditableStyledDocument<PS,SEG,S>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 documentpublic void setStyle(int from,
int to,
S style)
EditableStyledDocumentsetStyle in interface EditableStyledDocument<PS,SEG,S>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-stylepublic void setStyle(int paragraphIndex,
S style)
EditableStyledDocumentsetStyle in interface EditableStyledDocument<PS,SEG,S>public void setStyle(int paragraphIndex,
int fromCol,
int toCol,
S style)
EditableStyledDocumentsetStyle in interface EditableStyledDocument<PS,SEG,S>public void setStyleSpans(int from,
StyleSpans<? extends S> styleSpans)
EditableStyledDocument"from..(from + styleSpans.length())" with the given
style spanssetStyleSpans in interface EditableStyledDocument<PS,SEG,S>public void setStyleSpans(int paragraphIndex,
int from,
StyleSpans<? extends S> styleSpans)
EditableStyledDocument"from..(from + styleSpans.length())" in the given
paragraph with the given style spanssetStyleSpans in interface EditableStyledDocument<PS,SEG,S>public void setParagraphStyle(int paragraphIndex,
PS style)
EditableStyledDocumentsetParagraphStyle in interface EditableStyledDocument<PS,SEG,S>public StyledDocument<PS,SEG,S> concat(StyledDocument<PS,SEG,S> that)
concat in interface StyledDocument<PS,SEG,S>public StyledDocument<PS,SEG,S> subSequence(int start, int end)
subSequence in interface StyledDocument<PS,SEG,S>