java.lang.Object
javax.swing.undo.AbstractUndoableEdit
javax.swing.text.AbstractDocument.ElementEdit
- 所有已实现的接口:
-
Serializable,DocumentEvent.ElementChange,UndoableEdit
- 封装类:
-
AbstractDocument
public static class AbstractDocument.ElementEdit extends AbstractUndoableEdit implements DocumentEvent.ElementChange
可以添加到文档事件的ElementChange的实现。
-
Field Summary
Fields declared in class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName -
Constructor Summary
ConstructorsConstructorDescriptionElementEdit(Element e, int index, Element[] removed, Element[] added) 构造一个编辑记录。 -
Method Summary
Methods declared in class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
-
Constructor Details
-
ElementEdit
构造一个编辑记录。这不会修改元素,因此可以安全地用于使视图与刚刚附加到模型的视图的当前模型状态保持一致。- 参数:
-
e- 元素 -
index- 模型中的索引 >= 0 -
removed- 已移除的元素集合 -
added- 已添加的元素集合
-
-
Method Details
-
getElement
返回基础元素。- 指定者:
-
getElement在接口DocumentEvent.ElementChange - 返回:
- 元素
-
getIndex
public int getIndex()返回元素列表中的索引。- 指定者:
-
getIndex在接口DocumentEvent.ElementChange - 返回:
- 索引 >= 0
-
getChildrenRemoved
获取已移除的子元素列表。- 指定者:
-
getChildrenRemoved在接口DocumentEvent.ElementChange - 返回:
- 列表
-
getChildrenAdded
获取已添加的子元素列表。- 指定者:
-
getChildrenAdded在接口DocumentEvent.ElementChange - 返回:
- 列表
-
redo
重做更改。- 指定者:
-
redo在接口UndoableEdit - 覆盖:
-
redo在类AbstractUndoableEdit - 抛出:
-
CannotRedoException- 如果无法重做更改 - 参见:
-
undo
撤消更改。- 指定者:
-
undo在接口UndoableEdit - 覆盖:
-
undo在类AbstractUndoableEdit - 抛出:
-
CannotUndoException- 如果无法撤消更改 - 参见:
-