public class EditorTextFieldRendererDocument extends UserDataHolderBase implements DocumentEx
EMPTY_ARRAY, PROP_WRITABLE
Constructor and Description |
---|
EditorTextFieldRendererDocument() |
Modifier and Type | Method and Description |
---|---|
RangeMarker |
createGuardedBlock(int startOffset,
int endOffset)
Marks a range of text in the document as read-only (attempts to modify text in the
range cause
ReadOnlyFragmentModificationException to be thrown). |
LineIterator |
createLineIterator() |
RangeMarker |
createRangeMarker(int startOffset,
int endOffset,
boolean surviveOnExternalChange)
Creates a range marker which points to the specified range of text in the document and
is automatically adjusted when the document text is changed.
|
void |
deleteString(int startOffset,
int endOffset)
Deletes the specified range of text from the document.
|
char [] |
getChars() |
java.lang.CharSequence |
getImmutableCharSequence() |
int |
getLineCount()
Returns the number of lines in the document.
|
int |
getLineEndOffset(int line)
Returns the end offset for the line with the specified number.
|
int |
getLineNumber(int offset)
Returns the line number (0-based) corresponding to the specified offset in the document.
|
int |
getLineStartOffset(int line)
Returns the start offset for the line with the specified number.
|
long |
getModificationStamp()
Gets the modification stamp value.
|
void |
insertString(int offset,
java.lang.CharSequence s)
Inserts the specified text at the specified offset in the document.
|
boolean |
isWritable()
Checks if the document text is read-only.
|
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) |
boolean |
removeRangeMarker(RangeMarkerEx rangeMarker) |
void |
replaceString(int startOffset,
int endOffset,
java.lang.CharSequence s)
Replaces the specified range of text in the document with the specified string.
|
void |
replaceText(java.lang.CharSequence chars,
long newModificationStamp) |
void |
setModificationStamp(long modificationStamp) |
void |
setText(java.lang.CharSequence text) |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEditReadOnlyListener, clearLineModificationFlags, getGuardedBlocks, getModificationSequence, isInEventsHandling, moveText, removeEditReadOnlyListener, setStripTrailingSpacesEnabled, suppressGuardedExceptions, unSuppressGuardedExceptions
addDocumentListener, addDocumentListener, addPropertyChangeListener, createRangeMarker, createRangeMarker, fireReadOnlyModificationAttempt, getCharsSequence, getLineSeparatorLength, getOffsetGuard, getRangeGuard, getText, getText, getTextLength, isInBulkUpdate, isLineModified, removeDocumentListener, removeGuardedBlock, removePropertyChangeListener, setCyclicBufferSize, setInBulkUpdate, setReadOnly, startGuardedBlockChecking, stopGuardedBlockChecking
getUserData, putUserData
public void setModificationStamp(long modificationStamp)
setModificationStamp
in interface DocumentEx
public void replaceText(java.lang.CharSequence chars, long newModificationStamp)
replaceText
in interface DocumentEx
public void setText(java.lang.CharSequence text)
public LineIterator createLineIterator()
createLineIterator
in interface DocumentEx
public boolean removeRangeMarker(RangeMarkerEx rangeMarker)
removeRangeMarker
in interface DocumentEx
public void registerRangeMarker(RangeMarkerEx rangeMarker, int start, int end, boolean greedyToLeft, boolean greedyToRight, int layer)
registerRangeMarker
in interface DocumentEx
public boolean processRangeMarkers(Processor<? super RangeMarker> processor)
DocumentEx
processor
in their RangeMarker.getStartOffset()
orderprocessRangeMarkers
in interface DocumentEx
public boolean processRangeMarkersOverlappingWith(int start, int end, Processor<? super RangeMarker> processor)
DocumentEx
TextRange.intersects(int, int)
the specified range
and hand them to the processor
in their RangeMarker.getStartOffset()
orderprocessRangeMarkersOverlappingWith
in interface DocumentEx
public java.lang.CharSequence getImmutableCharSequence()
getImmutableCharSequence
in interface Document
ImmutableCharSequence
public int getLineCount()
Document
getLineCount
in interface Document
public int getLineNumber(int offset)
Document
getLineNumber
in interface Document
offset
- the offset to get the line number for (must be in the range from 0 to
getTextLength()-1)public int getLineStartOffset(int line)
Document
getLineStartOffset
in interface Document
line
- the line number (from 0 to getLineCount()-1)public int getLineEndOffset(int line)
Document
getLineEndOffset
in interface Document
line
- the line number (from 0 to getLineCount()-1)public void insertString(int offset, java.lang.CharSequence s)
Document
insertString
in interface Document
offset
- the offset to insert the text at.s
- the text to insert.public void deleteString(int startOffset, int endOffset)
Document
deleteString
in interface Document
startOffset
- the start offset of the range to delete.endOffset
- the end offset of the range to delete.public void replaceString(int startOffset, int endOffset, java.lang.CharSequence s)
Document
replaceString
in interface Document
startOffset
- the start offset of the range to replace.endOffset
- the end offset of the range to replace.s
- the text to replace with.public boolean isWritable()
Document
isWritable
in interface Document
true
if the document text is writable, false
if it is read-only.Document.fireReadOnlyModificationAttempt()
public long getModificationStamp()
Document
getModificationStamp
in interface Document
PsiFile.getModificationStamp()
,
VirtualFile.getModificationStamp()
public RangeMarker createRangeMarker(int startOffset, int endOffset, boolean surviveOnExternalChange)
Document
createRangeMarker
in interface Document
startOffset
- the start offset for the range of text covered by the marker.endOffset
- the end offset for the range of text covered by the marker.surviveOnExternalChange
- if true, the marker is not invalidated by external changes.public RangeMarker createGuardedBlock(int startOffset, int endOffset)
Document
ReadOnlyFragmentModificationException
to be thrown).createGuardedBlock
in interface Document
startOffset
- the start offset of the text range to mark as read-only.endOffset
- the end offset of the text range to mark as read-only.Document.removeGuardedBlock(RangeMarker)
,
Document.startGuardedBlockChecking()
,
EditorActionManager.setReadonlyFragmentModificationHandler(com.intellij.openapi.editor.actionSystem.ReadonlyFragmentModificationHandler)