java.lang.Object
javax.swing.undo.UndoableEditSupport
用于管理
UndoableEdit监听器的支持类。
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CompoundEdit复合编辑。protected Vector<UndoableEditListener> 监听器列表。protected Object真实源。protected int更新级别。 -
Constructor Summary
ConstructorsConstructorDescription构造一个UndoableEditSupport对象。构造一个UndoableEditSupport对象。 -
Method Summary
Modifier and TypeMethodDescriptionprotected void仅从postEdit和endUpdate调用。void注册一个UndoableEditListener。void开始一个复合编辑更新。protected CompoundEdit仅从beginUpdate调用。void死锁警告:调用此方法可能会在所有监听器中调用undoableEditHappened。返回添加到此UndoableEditSupport的所有UndoableEditListener数组。int返回更新级别值。void死锁警告:调用此方法可能会在所有监听器中调用undoableEditHappened。void移除一个UndoableEditListener。toString()返回显示和标识此对象属性的字符串。
-
Field Details
-
updateLevel
protected int updateLevel更新级别。 -
compoundEdit
复合编辑。 -
listeners
监听器列表。 -
realSource
真实源。
-
-
Constructor Details
-
UndoableEditSupport
public UndoableEditSupport()构造一个UndoableEditSupport对象。 -
UndoableEditSupport
构造一个UndoableEditSupport对象。- 参数:
-
r- 一个Object
-
-
Method Details
-
addUndoableEditListener
注册一个UndoableEditListener。每当可以撤销的编辑发生时,将通知监听器。- 参数:
-
l- 一个UndoableEditListener对象 - 参见:
-
removeUndoableEditListener
移除一个UndoableEditListener。- 参数:
-
l- 要移除的UndoableEditListener对象 - 参见:
-
getUndoableEditListeners
返回使用addUndoableEditListener()添加到此UndoableEditSupport的所有UndoableEditListener数组。- 返回:
-
所有添加的
UndoableEditListener数组,如果没有添加监听器,则返回空数组 - 自:
- 1.4
-
_postEdit
仅从postEdit和endUpdate调用。调用所有监听器中的undoableEditHappened。此处不执行同步,因为两个调用方法都是同步的。- 参数:
-
e- 要验证的编辑
-
postEdit
死锁警告:调用此方法可能会在所有监听器中调用undoableEditHappened。从其中一个监听器调用此方法是不明智的。- 参数:
-
e- 要发布的编辑
-
getUpdateLevel
public int getUpdateLevel()返回更新级别值。- 返回:
- 代表更新级别的整数
-
beginUpdate
public void beginUpdate()开始一个复合编辑更新。 -
createCompoundEdit
仅从beginUpdate调用。为子类的使用而公开。- 返回:
-
新创建的
CompoundEdit对象
-
endUpdate
public void endUpdate()死锁警告:调用此方法可能会在所有监听器中调用undoableEditHappened。从其中一个监听器调用此方法是不明智的。 -
toString
返回显示和标识此对象属性的字符串。
-