1. /*
  2. * @(#)HTMLFrameHyperlinkEvent.java 1.9 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.text.html;
  8. import javax.swing.text.*;
  9. import javax.swing.event.HyperlinkEvent;
  10. import java.net.URL;
  11. /**
  12. * HTMLFrameHyperlinkEvent is used to notify interested
  13. * parties that link was activated in a frame.
  14. *
  15. * @author Sunita Mani
  16. * @version 1.9, 12/19/03
  17. */
  18. public class HTMLFrameHyperlinkEvent extends HyperlinkEvent {
  19. /**
  20. * Creates a new object representing a html frame
  21. * hypertext link event.
  22. *
  23. * @param source the object responsible for the event
  24. * @param type the event type
  25. * @param targetURL the affected URL
  26. * @param targetFrame the Frame to display the document in
  27. */
  28. public HTMLFrameHyperlinkEvent(Object source, EventType type, URL targetURL,
  29. String targetFrame) {
  30. super(source, type, targetURL);
  31. this.targetFrame = targetFrame;
  32. }
  33. /**
  34. * Creates a new object representing a hypertext link event.
  35. *
  36. * @param source the object responsible for the event
  37. * @param type the event type
  38. * @param targetURL the affected URL
  39. * @param desc a description
  40. * @param targetFrame the Frame to display the document in
  41. */
  42. public HTMLFrameHyperlinkEvent(Object source, EventType type, URL targetURL, String desc,
  43. String targetFrame) {
  44. super(source, type, targetURL, desc);
  45. this.targetFrame = targetFrame;
  46. }
  47. /**
  48. * Creates a new object representing a hypertext link event.
  49. *
  50. * @param source the object responsible for the event
  51. * @param type the event type
  52. * @param targetURL the affected URL
  53. * @param sourceElement the element that corresponds to the source
  54. * of the event
  55. * @param targetFrame the Frame to display the document in
  56. */
  57. public HTMLFrameHyperlinkEvent(Object source, EventType type, URL targetURL,
  58. Element sourceElement, String targetFrame) {
  59. super(source, type, targetURL, null, sourceElement);
  60. this.targetFrame = targetFrame;
  61. }
  62. /**
  63. * Creates a new object representing a hypertext link event.
  64. *
  65. * @param source the object responsible for the event
  66. * @param type the event type
  67. * @param targetURL the affected URL
  68. * @param desc a desription
  69. * @param sourceElement the element that corresponds to the source
  70. * of the event
  71. * @param targetFrame the Frame to display the document in
  72. */
  73. public HTMLFrameHyperlinkEvent(Object source, EventType type, URL targetURL, String desc,
  74. Element sourceElement, String targetFrame) {
  75. super(source, type, targetURL, desc, sourceElement);
  76. this.targetFrame = targetFrame;
  77. }
  78. /**
  79. * returns the target for the link.
  80. */
  81. public String getTarget() {
  82. return targetFrame;
  83. }
  84. private String targetFrame;
  85. }