Serializable
public final class PositionBounds extends Object implements Serializable
PositionRef
s.Constructor | Description |
---|---|
PositionBounds(PositionRef begin,
PositionRef end) |
Creates new
PositionBounds . |
Modifier and Type | Method | Description |
---|---|---|
PositionRef |
getBegin() |
Get the starting position of this range.
|
PositionRef |
getEnd() |
Get the ending position of this range.
|
String |
getText() |
Finds the text contained in this range.
|
PositionBounds |
insertAfter(String text) |
Inserts the text after this PositionBounds.
|
void |
setText(String text) |
Replaces the text contained in this range.
|
String |
toString() |
public PositionBounds(PositionRef begin, PositionRef end)
PositionBounds
.begin
- the start position of the rangeend
- the end position of the rangepublic PositionRef getBegin()
public PositionRef getEnd()
public void setText(String text) throws IOException, BadLocationException
If you are running this from user-oriented code, you may want to wrap it in NbDocument.runAtomicAsUser(javax.swing.text.StyledDocument, java.lang.Runnable)
.
text
- new text to insert over existing textIOException
- if any problem occurred during document loading (if that was necessary)BadLocationException
- if the positions are out of the bounds of the documentpublic PositionBounds insertAfter(String text) throws IOException, BadLocationException
text
- The text to insert. The text must not be empty.IOException
- if any problem occurred during document loading (if that was necessary)BadLocationException
- if the positions are out of the bounds of the documentpublic String getText() throws BadLocationException, IOException
IOException
- if any I/O problem occurred during document loading (if that was necessary)BadLocationException
- if the positions are out of the bounds of the documentBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.