1. /*
  2. * @(#)ExpandVetoException.java 1.7 00/02/02
  3. *
  4. * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.tree;
  11. import javax.swing.event.TreeExpansionEvent;
  12. /**
  13. * Exception used to stop and expand/collapse from happening.
  14. * See <a
  15. href="http://java.sun.com/docs/books/tutorial/uiswing/events/treewillexpandlistener.html">How to Write a Tree-Will-Expand Listener</a>
  16. * in <em>The Java Tutorial</em>
  17. * for further information and examples.
  18. *
  19. * @version 1.7 02/02/00
  20. * @author Scott Violet
  21. */
  22. public class ExpandVetoException extends Exception {
  23. /** The event that the exception was created for. */
  24. protected TreeExpansionEvent event;
  25. /**
  26. * Constructs an ExpandVetoException object with no message.
  27. *
  28. * @param event a TreeExpansionEvent object
  29. */
  30. public ExpandVetoException(TreeExpansionEvent event) {
  31. this(event, null);
  32. }
  33. /**
  34. * Constructs an ExpandVetoException object with the specified message.
  35. *
  36. * @param event a TreeExpansionEvent object
  37. * @param message a String containing the message
  38. */
  39. public ExpandVetoException(TreeExpansionEvent event, String message) {
  40. super(message);
  41. this.event = event;
  42. }
  43. }