KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > event > DocumentEvent


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: DocumentEvent.java,v $
11    Revision 1.1 2004/01/26 08:11:00 bobintetley
12    Many bugfixes and addition of SwingSet
13
14
15 */

16
17 package swingwtx.swing.event;
18
19 import swingwtx.swing.text.*;
20
21 public interface DocumentEvent {
22
23     public interface ElementChange {
24     public Element getElement();
25     public int getIndex();
26         public Element[] getChildrenRemoved();
27         public Element[] getChildrenAdded();
28     }
29     
30     public int getOffset();
31     public int getLength();
32     public Document getDocument();
33     public EventType getType();
34     public ElementChange getChange(Element elem);
35
36     public static final class EventType {
37         private EventType(String JavaDoc s) {
38         typeString = s;
39     }
40     public static final EventType INSERT = new EventType("INSERT");
41     public static final EventType REMOVE = new EventType("REMOVE");
42     public static final EventType CHANGE = new EventType("CHANGE");
43         public String JavaDoc toString() {
44         return typeString;
45     }
46     private String JavaDoc typeString;
47     }
48 }
Popular Tags