模块 java.desktop

类 UndoableEditSupport

java.lang.Object
javax.swing.undo.UndoableEditSupport

public class UndoableEditSupport extends Object
用于管理 UndoableEdit 监听器的支持类。
  • 字段详细信息

    • 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

      public void removeUndoableEditListener(UndoableEditListener  l)
      删除 UndoableEditListener
      参数:
      l - 要删除的 UndoableEditListener 对象
      参见:
    • getUndoableEditListeners

      public UndoableEditListener [] getUndoableEditListeners()
      返回使用 addUndoableEditListener() 添加到此 UndoableEditSupport 的所有 UndoableEditListener 的数组。
      返回:
      添加所有 UndoableEditListener s,如果没有添加任何监听器,则为空数组
      自从:
      1.4
    • _postEdit

      protected void _postEdit(UndoableEdit  e)
      仅从 postEditendUpdate 调用。在所有监听器中调用 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。从其监听器之一调用此方法是不明智的。
    • toString

      public String  toString()
      返回显示和标识此对象属性的字符串。
      重写:
      toString 在类 Object
      返回:
      此对象的 String 表示