- java.lang.Object
-
- javax.swing.undo.UndoableEditSupport
-
public class UndoableEditSupport extends Object
用于管理UndoableEdit监听器的支持类。
-
-
Field Summary
Fields Modifier and Type Field 描述 protected CompoundEditcompoundEdit复合编辑。protected Vector<UndoableEditListener>listeners听众列表。protected ObjectrealSource真正的来源。protected intupdateLevel更新级别。
-
构造方法摘要
构造方法 Constructor 描述 UndoableEditSupport()构造一个UndoableEditSupport对象。UndoableEditSupport(Object r)构造一个UndoableEditSupport对象。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected void_postEdit(UndoableEdit e)仅限postEdit和endUpdate。voidaddUndoableEditListener(UndoableEditListener l)注册UndoableEditListener。voidbeginUpdate()protected CompoundEditcreateCompoundEdit()仅限于beginUpdate。voidendUpdate()死锁警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。UndoableEditListener[]getUndoableEditListeners()返回使用addUndoableEditListener()添加到此UndoableEditSupport的所有UndoableEditListener的数组。intgetUpdateLevel()返回更新级别值。voidpostEdit(UndoableEdit e)死锁警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。voidremoveUndoableEditListener(UndoableEditListener l)删除一个UndoableEditListener。StringtoString()返回显示和标识此对象属性的字符串。
-
-
-
字段详细信息
-
updateLevel
protected int updateLevel
更新级别。
-
compoundEdit
protected CompoundEdit compoundEdit
复合编辑。
-
listeners
protected Vector<UndoableEditListener> listeners
听众列表。
-
realSource
protected Object realSource
真正的来源。
-
-
构造方法详细信息
-
UndoableEditSupport
public UndoableEditSupport()
构造一个UndoableEditSupport对象。
-
UndoableEditSupport
public UndoableEditSupport(Object r)
构造一个UndoableEditSupport对象。- 参数
-
r- aObject
-
-
方法详细信息
-
addUndoableEditListener
public void addUndoableEditListener(UndoableEditListener l)
注册UndoableEditListener。 每当编辑发生时,监听器都会被通知,可以撤消。- 参数
-
l- 一个UndoableEditListener对象 - 另请参见:
-
removeUndoableEditListener(javax.swing.event.UndoableEditListener)
-
removeUndoableEditListener
public void removeUndoableEditListener(UndoableEditListener l)
删除一个UndoableEditListener。- 参数
-
l- 要删除的UndoableEditListener对象 - 另请参见:
-
addUndoableEditListener(javax.swing.event.UndoableEditListener)
-
getUndoableEditListeners
public UndoableEditListener[] getUndoableEditListeners()
返回使用addUndoableEditListener()添加到此UndoableEditSupport的所有UndoableEditListener的数组。- 结果
-
所有的
UndoableEditListener添加或一个空数组,如果没有添加听众 - 从以下版本开始:
- 1.4
-
_postEdit
protected void _postEdit(UndoableEdit e)
仅限postEdit和endUpdate。 在所有听众中呼叫undoableEditHappened。 这里不执行同步,因为两个调用方法是同步的。- 参数
-
e- 编辑要验证
-
postEdit
public void postEdit(UndoableEdit e)
死锁警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。 从其中一个监听器调用此方法是不明智的。- 参数
-
e- 编辑发布
-
getUpdateLevel
public int getUpdateLevel()
返回更新级别值。- 结果
- 表示更新级别的整数
-
beginUpdate
public void beginUpdate()
-
createCompoundEdit
protected CompoundEdit createCompoundEdit()
仅限于beginUpdate。 暴露在这里用于子类的使用。- 结果
-
新建了
CompoundEdit对象
-
endUpdate
public void endUpdate()
死锁警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。 从其中一个监听器调用此方法是不明智的。
-
-