|
Oxygen XML Editor 12.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Content
Interface to describe a sequence of character content that can be edited.
Method Summary | |
---|---|
javax.swing.text.Position |
createPosition(int offset)
Creates a position within the content. |
void |
getChars(int where,
int len,
javax.swing.text.Segment chars)
Retrieves a portion of the content into the specified Segment . |
int |
getLength()
The length in characters of the content. |
java.lang.String |
getString(int where,
int len)
Fetches a string of characters contained in the content sequence. |
void |
insertChars(int where,
char[] ch,
int start,
int length)
Inserts a sequence of characters into the content at a given offset. |
void |
remove(int where,
int nitems)
Removes some portion of the content sequence. |
Method Detail |
---|
javax.swing.text.Position createPosition(int offset) throws javax.swing.text.BadLocationException
offset
- The offset in the content >= 0
Position
.
javax.swing.text.BadLocationException
- For an invalid offsetint getLength()
void insertChars(int where, char[] ch, int start, int length) throws javax.swing.text.BadLocationException
where
- Offset into the content to make the insertion >= 0ch
- The char buffer to insert from.start
- Start of useful data in the char buffer.length
- Length of useful data in the char buffer.
javax.swing.text.BadLocationException
- thrown if the offset indicated by the where
argument is not
contained in the boundaries of the content character sequence.void remove(int where, int nitems) throws javax.swing.text.BadLocationException
where
- The offset into the sequence to make the removal >= 0.nitems
- The number of items in the sequence to be removed >= 0.
javax.swing.text.BadLocationException
- Thrown if the area covered by the where
and nitems
parameters is not
contained in the content character sequence.java.lang.String getString(int where, int len) throws javax.swing.text.BadLocationException
where
- Offset into the sequence to fetch >= 0.len
- Number of characters to copy >= 0.
javax.swing.text.BadLocationException
- Thrown if the area covered by the arguments is not
contained in the content character sequence.void getChars(int where, int len, javax.swing.text.Segment chars) throws javax.swing.text.BadLocationException
Segment
.
If the desired content spans the gap, we copy the content.
If the desired content does not span the gap, the actual store is returned to avoid the copy since
it is contiguous.
where
- The starting position >= 0, where + len <= length()len
- The number of characters to be retrieved >= 0chars
- The Segment
object to return the characters into.
javax.swing.text.BadLocationException
- If the specified position or length are invalid.
|
Oxygen XML Editor 12.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |