Source code: javax/ide/model/DocumentEvent.java
1 package javax.ide.model;
2
3 import java.util.EventObject;
4
5 /**
6 * The DocumentEvent is used to indicate that state of a {@link Document}
7 * has been modified.
8 */
9 public final class DocumentEvent extends EventObject
10 {
11 /**
12 * Constructor.
13 *
14 * @param document the document whose state has been altered.
15 */
16 public DocumentEvent( Document document )
17 {
18 super(document);
19 }
20
21 /**
22 * Get the {@link Document} whose state has changed.
23 * This is functionally equivalent to casting the result of getSource() to
24 * a <code>Document</code> object.
25 *
26 * @return the {@link Document} whose state has changed.
27 */
28 public Document getDocument()
29 {
30 return (Document)getSource();
31 }
32 }