1. /*
  2. * @(#)UndoableEditEvent.java 1.18 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.event;
  8. import javax.swing.undo.*;
  9. /**
  10. * An event indicating that an operation which can be undone has occurred.
  11. * <p>
  12. * <strong>Warning:</strong>
  13. * Serialized objects of this class will not be compatible with
  14. * future Swing releases. The current serialization support is
  15. * appropriate for short term storage or RMI between applications running
  16. * the same version of Swing. As of 1.4, support for long term storage
  17. * of all JavaBeans<sup><font size="-2">TM</font></sup>
  18. * has been added to the <code>java.beans</code> package.
  19. * Please see {@link java.beans.XMLEncoder}.
  20. *
  21. * @version 1.18 12/19/03
  22. * @author Ray Ryan
  23. */
  24. public class UndoableEditEvent extends java.util.EventObject {
  25. private UndoableEdit myEdit;
  26. /**
  27. * Constructs an UndoableEditEvent object.
  28. *
  29. * @param source the Object that originated the event
  30. * (typically <code>this</code>)
  31. * @param edit an UndoableEdit object
  32. */
  33. public UndoableEditEvent(Object source, UndoableEdit edit) {
  34. super(source);
  35. myEdit = edit;
  36. }
  37. /**
  38. * Returns the edit value.
  39. *
  40. * @return the UndoableEdit object encapsulating the edit
  41. */
  42. public UndoableEdit getEdit() {
  43. return myEdit;
  44. }
  45. }