C:\Java WorkShop\Lexx\src\lexx\autocomplete\AutoCompleteListener.java

1    package lexx.autocomplete; 
2     
3    import java.util.List; 
4     
5    import javax.swing.event.DocumentEvent; 
6    import javax.swing.event.DocumentListener; 
7     
8    /** 
9     * <p>Performs autocompletion once an AST has been produced</p> 
10    * <p>This class becomes activated when a DocumentEvent is called</p> 
11    * <p>Copyright (c) 2002-2003</p> 
12    * @since 15/02/2003 
13    * @author Mohammed Imran 
14    * @version 1.0 
15    */ 
16   public abstract class AutoCompleteListener implements DocumentListener 
17   { 
18     /** 
19      * This method is where you take the DocumentEvent and check if autocompletion 
20      * can occur 
21      * @param e when user changes the text 
22      * @param wasInserted if the user inserted text into the source code 
23      */ 
24     public abstract void update(DocumentEvent e, boolean wasInserted); 
25    
26     public final void insertUpdate(DocumentEvent e) 
27     { 
28       this.update(e, true); 
29     } 
30    
31     /** 
32      * Used in automated testing 
33      * @return the display of the pop 
34      */ 
35     public abstract List getCurrentDisplayedList(); 
36    
37     public final void removeUpdate(DocumentEvent e) 
38     { 
39       this.update(e, false); 
40     } 
41    
42     public final void changedUpdate(DocumentEvent e) 
43     { 
44     } 
45   } 
46