public interface DocumentEx extends Document
EMPTY_ARRAY, PROP_WRITABLE
Modifier and Type | Method and Description |
---|---|
default void |
addEditReadOnlyListener(EditReadOnlyListener listener) |
default void |
clearLineModificationFlags() |
LineIterator |
createLineIterator() |
default java.util.List<RangeMarker> |
getGuardedBlocks() |
default int |
getModificationSequence() |
default boolean |
isInEventsHandling() |
default void |
moveText(int srcStart,
int srcEnd,
int dstOffset)
Moves text from the
[srcStart; srcEnd) range to the dstOffset offset. |
boolean |
processRangeMarkers(Processor<? super RangeMarker> processor)
Get all range markers
and hand them to the
processor in their RangeMarker.getStartOffset() order |
boolean |
processRangeMarkersOverlappingWith(int start,
int end,
Processor<? super RangeMarker> processor)
Get range markers which
TextRange.intersects(int, int) the specified range
and hand them to the processor in their RangeMarker.getStartOffset() order |
void |
registerRangeMarker(RangeMarkerEx rangeMarker,
int start,
int end,
boolean greedyToLeft,
boolean greedyToRight,
int layer) |
default void |
removeEditReadOnlyListener(EditReadOnlyListener listener) |
boolean |
removeRangeMarker(RangeMarkerEx rangeMarker) |
void |
replaceText(java.lang.CharSequence chars,
long newModificationStamp) |
void |
setModificationStamp(long modificationStamp) |
default void |
setStripTrailingSpacesEnabled(boolean isEnabled) |
default void |
suppressGuardedExceptions() |
default void |
unSuppressGuardedExceptions() |
addDocumentListener, addDocumentListener, addPropertyChangeListener, createGuardedBlock, createRangeMarker, createRangeMarker, createRangeMarker, deleteString, fireReadOnlyModificationAttempt, getChars, getCharsSequence, getImmutableCharSequence, getLineCount, getLineEndOffset, getLineNumber, getLineSeparatorLength, getLineStartOffset, getModificationStamp, getOffsetGuard, getRangeGuard, getText, getText, getTextLength, insertString, isInBulkUpdate, isLineModified, isWritable, removeDocumentListener, removeGuardedBlock, removePropertyChangeListener, replaceString, setCyclicBufferSize, setInBulkUpdate, setReadOnly, setText, startGuardedBlockChecking, stopGuardedBlockChecking
getUserData, putUserData
default void setStripTrailingSpacesEnabled(boolean isEnabled)
LineIterator createLineIterator()
void setModificationStamp(long modificationStamp)
default void addEditReadOnlyListener(EditReadOnlyListener listener)
default void removeEditReadOnlyListener(EditReadOnlyListener listener)
void replaceText(java.lang.CharSequence chars, long newModificationStamp)
default void moveText(int srcStart, int srcEnd, int dstOffset)
[srcStart; srcEnd)
range to the dstOffset
offset.
The benefit to use this method over usual Document.deleteString(int, int)
and Document.replaceString(int, int, CharSequence)
is that range markers
from the [srcStart; srcEnd)
range have
a chance to be preserved. Default implementation doesn't preserve range markers, but has the same effect in terms of resulting
text content.
srcStart
- start offset of the text to move (inclusive)srcEnd
- end offset of the text to move (exclusive)dstOffset
- the offset to insert the text to. Must be outside of the (srcStart, srcEnd) range.default void suppressGuardedExceptions()
default void unSuppressGuardedExceptions()
default boolean isInEventsHandling()
default void clearLineModificationFlags()
boolean removeRangeMarker(RangeMarkerEx rangeMarker)
void registerRangeMarker(RangeMarkerEx rangeMarker, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer)
default java.util.List<RangeMarker> getGuardedBlocks()
boolean processRangeMarkers(Processor<? super RangeMarker> processor)
processor
in their RangeMarker.getStartOffset()
orderboolean processRangeMarkersOverlappingWith(int start, int end, Processor<? super RangeMarker> processor)
TextRange.intersects(int, int)
the specified range
and hand them to the processor
in their RangeMarker.getStartOffset()
orderdefault int getModificationSequence()
Document.getModificationStamp()
which can change arbitrarily.