GapContent
, StringContent
AbstractDocument
public static interface AbstractDocument.Content
Modifier and Type | Method | Description |
---|---|---|
Position |
createPosition |
Creates a position within the content that will track change as the content is mutated. |
void |
getChars |
Gets a sequence of characters and copies them into a Segment. |
String |
getString |
Fetches a string of characters contained in the sequence. |
UndoableEdit |
insertString |
Inserts a string of characters into the sequence. |
int |
length() |
Current length of the sequence of character content. |
UndoableEdit |
remove |
Removes some portion of the sequence. |
Position createPosition(int offset) throws BadLocationException
offset
- the offset in the content >= 0BadLocationException
- for an invalid offsetint length()
UndoableEdit insertString(int where, String str) throws BadLocationException
where
- offset into the sequence to make the insertion >= 0str
- string to insertEdit
implementation will be returned, otherwise returns null
BadLocationException
- thrown if the area covered by the arguments is not contained in the character sequenceUndoableEdit remove(int where, int nitems) throws BadLocationException
where
- The offset into the sequence to make the insertion >= 0.nitems
- The number of items in the sequence to remove >= 0.BadLocationException
- Thrown if the area covered by the arguments is not contained in the character sequence.String getString(int where, int len) throws BadLocationException
where
- Offset into the sequence to fetch >= 0.len
- number of characters to copy >= 0.BadLocationException
- Thrown if the area covered by the arguments is not contained in the character sequence.void getChars(int where, int len, Segment txt) throws BadLocationException
where
- the starting offset >= 0len
- the number of characters >= 0txt
- the target location to copy intoBadLocationException
- Thrown if the area covered by the arguments is not contained in the character sequence.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/AbstractDocument.Content.html