EditableStyledDocument<PS,java.lang.String,S>
, StyledDocument<PS,SEG,S>
, TwoDimensional
public final class SimpleEditableStyledDocument<PS,S>
extends java.lang.Object
EditableStyledDocument
that specifies its segment type as String
.
For a version that can specify the segment's generics, see GenericEditableStyledDocument
.Type | Property | Description |
---|---|---|
org.reactfx.SuspendableNo |
beingUpdated |
|
org.reactfx.value.Val<java.lang.Integer> |
length |
|
org.reactfx.value.Val<java.lang.String> |
text |
TwoDimensional.Bias, TwoDimensional.Position
Constructor | Description |
---|---|
SimpleEditableStyledDocument(Paragraph<PS,java.lang.String,S> initialParagraph) |
Creates an
EditableStyledDocument with given paragraph as its initial content |
SimpleEditableStyledDocument(ReadOnlyStyledDocument<PS,java.lang.String,S> initialContent) |
Creates an
EditableStyledDocument with the given document as its initial content |
SimpleEditableStyledDocument(PS initialParagraphStyle,
S initialStyle) |
Creates a document that does not merge consecutive styles
|
SimpleEditableStyledDocument(PS initialParagraphStyle,
S initialStyle,
java.util.function.BiFunction<S,S,java.util.Optional<S>> mergeStyle) |
Creates a document that uses
SegmentOps.styledTextOps(BiFunction) to operate on segments and merge
consecutive styles. |
SimpleEditableStyledDocument(PS initialParagraphStyle,
S initialTextStyle,
SegmentOps<java.lang.String,S> segOps) |
Creates a document that uses a custom
SegmentOps to operate on segments and merge styles. |
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 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. |
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() |
multiPlainChanges, plainChanges, replace, richChanges
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
charAt, getAbsolutePosition, getParagraph, getParagraphLength, getParagraphStyle, getParagraphStyleAtPosition, getStyleAtPosition, getStyleAtPosition, getStyleOfChar, getStyleOfChar, getStyleRangeAtPosition, getStyleRangeAtPosition, getStyleSpans, getStyleSpans, getStyleSpans, getText, getText, getText, subDocument, subSequence
public SimpleEditableStyledDocument(PS initialParagraphStyle, S initialStyle)
public SimpleEditableStyledDocument(PS initialParagraphStyle, S initialStyle, java.util.function.BiFunction<S,S,java.util.Optional<S>> mergeStyle)
SegmentOps.styledTextOps(BiFunction)
to operate on segments and merge
consecutive styles.public SimpleEditableStyledDocument(PS initialParagraphStyle, S initialTextStyle, SegmentOps<java.lang.String,S> segOps)
SegmentOps
to operate on segments and merge styles.public SimpleEditableStyledDocument(Paragraph<PS,java.lang.String,S> initialParagraph)
EditableStyledDocument
with given paragraph as its initial contentpublic SimpleEditableStyledDocument(ReadOnlyStyledDocument<PS,java.lang.String,S> initialContent)
EditableStyledDocument
with the given document as its initial contentpublic org.reactfx.EventStream<java.util.List<RichTextChange<PS,SEG,S>>> multiRichChanges()
EditableStyledDocument
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 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()
EditableStyledDocument
snapshot
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)
TwoDimensional
major
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 TwoDimensional
public TwoDimensional.Position offsetToPosition(int offset, TwoDimensional.Bias bias)
TwoDimensional
offset
value is an absolute position in that entity.offsetToPosition
in interface TwoDimensional
public void replaceMulti(java.util.List<Replacement<PS,SEG,S>> replacements)
EditableStyledDocument
replaceMulti
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)
EditableStyledDocument
setStyle
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)
EditableStyledDocument
setStyle
in interface EditableStyledDocument<PS,SEG,S>
public void setStyle(int paragraphIndex, int fromCol, int toCol, S style)
EditableStyledDocument
setStyle
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)
EditableStyledDocument
setParagraphStyle
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>