JavaTM 2 Platform
Standard Ed. 6

javax.swing.undo
类 UndoableEditSupport

java.lang.Object
  继承者 javax.swing.undo.UndoableEditSupport

public class UndoableEditSupport
extends Object

用于管理 UndoableEdit 侦听器的支持类。


字段摘要
protected  CompoundEdit compoundEdit
           
protected  Vector<UndoableEditListener> listeners
           
protected  Object realSource
           
protected  int updateLevel
           
 
构造方法摘要
UndoableEditSupport()
          构造一个 UndoableEditSupport 对象。
UndoableEditSupport(Object r)
          构造一个 UndoableEditSupport 对象。
 
方法摘要
protected  void _postEdit(UndoableEdit e)
          仅从 postEditendUpdate 调用。
 void addUndoableEditListener(UndoableEditListener l)
          注册一个 UndoableEditListener
 void beginUpdate()
           
protected  CompoundEdit createCompoundEdit()
          仅从 beginUpdate 调用。
 void endUpdate()
          死锁警告:调用此方法可能调用所有侦听器中的 undoableEditHappened
 UndoableEditListener[] getUndoableEditListeners()
          返回使用 addUndoableEditListener() 添加到此 UndoableEditSupport 中的所有 UndoableEditListener 组成的数组。
 int getUpdateLevel()
          返回更新级别值。
 void postEdit(UndoableEdit e)
          死锁警告:调用此方法可能调用所有侦听器中的 undoableEditHappened
 void removeUndoableEditListener(UndoableEditListener l)
          移除一个 UndoableEditListener
 String toString()
          返回显示和标识此对象属性的字符串。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

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)
仅从 postEditendUpdate 调用。调用所有侦听器中的 undoableEditHappened。此处不执行同步,因为两个调用方法已同步。


postEdit

public void postEdit(UndoableEdit e)
死锁警告:调用此方法可能调用所有侦听器中的 undoableEditHappened。从它的一个侦听器中调用此方法是不明智的。


getUpdateLevel

public int getUpdateLevel()
返回更新级别值。

返回:
表示更新级别的整数

beginUpdate

public void beginUpdate()

createCompoundEdit

protected CompoundEdit createCompoundEdit()
仅从 beginUpdate 调用。在此处公开供子类使用。


endUpdate

public void endUpdate()
死锁警告:调用此方法可能调用所有侦听器中的 undoableEditHappened。从它的一个侦听器中调用此方法是不明智的。


toString

public String toString()
返回显示和标识此对象属性的字符串。

覆盖:
Object 中的 toString
返回:
该对象的 String 表示形式

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only