|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public static interface AbstractDocument.Content
描述可编辑的字符序列内容的接口。各个实现不一定支持历史机制,历史机制可通过变化是否返回 UndoableEdit 实现反映出来。
AbstractDocument| 方法摘要 | |
|---|---|
Position |
createPosition(int offset)
在内容中创建一个位置,该位置将在内容改变时跟踪更改。 |
void |
getChars(int where,
int len,
Segment txt)
获得字符序列并将其复制到 Segment 中。 |
String |
getString(int where,
int len)
获取序列中包含的字符串。 |
UndoableEdit |
insertString(int where,
String str)
向序列中插入一个字符串。 |
int |
length()
当前字符序列内容的长度。 |
UndoableEdit |
remove(int where,
int nitems)
移除该序列的某一部分。 |
| 方法详细信息 |
|---|
Position createPosition(int offset)
throws BadLocationException
offset - 内容中的偏移量,该偏移量 >= 0
BadLocationException - 如果 offset 无效int length()
UndoableEdit insertString(int where,
String str)
throws BadLocationException
where - 序列中插入位置的偏移量,该偏移量 >= 0str - 要插入的字符串
Edit 实现的引用,否则返回 null
BadLocationException - 如果参数所覆盖的区域不包含在字符序列中
UndoableEdit remove(int where,
int nitems)
throws BadLocationException
where - 序列中插入位置的偏移量,该偏移量 >= 0。nitems - 序列中要移除的条目数量,该数量 >= 0。
BadLocationException - 如果参数所覆盖的区域不包含在字符序列中。
String getString(int where,
int len)
throws BadLocationException
where - 要获取的序列中的 Offset,该 Offset >= 0。len - 要复制的字符的数量,该数量 >= 0。
BadLocationException - 如果参数所覆盖的区域不包含在字符序列中。
void getChars(int where,
int len,
Segment txt)
throws BadLocationException
where - 起始偏移量,该偏移量 >= 0len - 字符的数量,该数量 >= 0txt - 将内容复制到的目标位置
BadLocationException - 如果参数所覆盖的区域不包含在字符序列中。
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。