1. /*
  2. * @(#)ExpandVetoException.java 1.10 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.tree;
  8. import javax.swing.event.TreeExpansionEvent;
  9. /**
  10. * Exception used to stop and expand/collapse from happening.
  11. * See <a
  12. href="http://java.sun.com/docs/books/tutorial/uiswing/events/treewillexpandlistener.html">How to Write a Tree-Will-Expand Listener</a>
  13. * in <em>The Java Tutorial</em>
  14. * for further information and examples.
  15. *
  16. * @version 1.10 12/19/03
  17. * @author Scott Violet
  18. */
  19. public class ExpandVetoException extends Exception {
  20. /** The event that the exception was created for. */
  21. protected TreeExpansionEvent event;
  22. /**
  23. * Constructs an ExpandVetoException object with no message.
  24. *
  25. * @param event a TreeExpansionEvent object
  26. */
  27. public ExpandVetoException(TreeExpansionEvent event) {
  28. this(event, null);
  29. }
  30. /**
  31. * Constructs an ExpandVetoException object with the specified message.
  32. *
  33. * @param event a TreeExpansionEvent object
  34. * @param message a String containing the message
  35. */
  36. public ExpandVetoException(TreeExpansionEvent event, String message) {
  37. super(message);
  38. this.event = event;
  39. }
  40. }