- java.lang.Object
 -  
      
- javax.swing.undo.UndoableEditSupport
 
 
-  
       
public class UndoableEditSupport extends Object
用于管理UndoableEdit侦听器的支持类。 
-  
        
       
-  
             
字段汇总
字段 变量和类型 字段 描述 protected CompoundEditcompoundEdit复合编辑。protected Vector<UndoableEditListener>listeners听众列表。protected ObjectrealSource真正的来源。protected intupdateLevel更新级别。 
-  
             
构造方法摘要
构造方法 构造器 描述 UndoableEditSupport()构造一个UndoableEditSupport对象。UndoableEditSupport(Object r)构造一个UndoableEditSupport对象。 
-  
             
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 protected void_postEdit(UndoableEdit e)仅来自postEdit和endUpdate。voidaddUndoableEditListener(UndoableEditListener l)注册UndoableEditListener。voidbeginUpdate()protected CompoundEditcreateCompoundEdit()仅来自beginUpdate。voidendUpdate()DEADLOCK警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。UndoableEditListener[]getUndoableEditListeners()返回使用addUndoableEditListener()添加到此UndoableEditSupport的所有UndoableEditListener的数组。intgetUpdateLevel()返回更新级别值。voidpostEdit(UndoableEdit e)DEADLOCK警告:调用此方法可能会在所有侦听器中调用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-Object 
 
 -  
 
-  
             
方法详细信息
-  
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)
DEADLOCK警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。 从其中一个侦听器调用此方法是不明智的。- 参数
 -  
              
e- 编辑即可发布 
 
-  
getUpdateLevel
public int getUpdateLevel()
返回更新级别值。- 结果
 - 表示更新级别的整数
 
 
-  
beginUpdate
public void beginUpdate()
 
-  
createCompoundEdit
protected CompoundEdit createCompoundEdit()
仅来自beginUpdate。 这里暴露了子类的使用。- 结果
 - 
               新创建的 
              
CompoundEdit对象 
 
-  
endUpdate
public void endUpdate()
DEADLOCK警告:调用此方法可能会在所有侦听器中调用undoableEditHappened。 从其中一个侦听器调用此方法是不明智的。 
 -  
 
 -