|
JavaTM 2 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 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。