lexx.autocomplete.java
Class JavaPopup

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--lexx.autocomplete.java.JavaPopup
All Implemented Interfaces:
javax.swing.ListCellRenderer, java.lang.Runnable, SelectionPopup

public final class JavaPopup
extends java.lang.Thread
implements SelectionPopup

This is the GUI side of autocompletion

This class takes list of methods/fields and user can choose which method/field he/she would like

Copyright (c) 2002-2003

Since:
19/03/2003
Version:
1.0
Author:
Mohammed Imran

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JavaPopup(Trie nodes, EditorPanel comp, int xCord, int yCord, int offSet)
          Displays the methods/fields of an object
 
Method Summary
 java.util.List getDisplayedList()
          Used for testing purposes to allow automated tests
 java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
          Used in JList is allows you to put graphics instead of calling toString()
 boolean hasFinished()
           
protected  void remove()
          Turns off the popup
 void run()
           
 void update(boolean wasInserted)
          Updates the GUI when user presses key
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaPopup

public JavaPopup(Trie nodes,
                 EditorPanel comp,
                 int xCord,
                 int yCord,
                 int offSet)
Displays the methods/fields of an object

Parameters:
nodes - - is the trie data structure containing all the methods and fields
comp - - the component you wish the popup to be displayed in
xCord - - the x co-ordinate where the popup should be displayed
yCord - - the y co-ordinate where the popup should be displayed
offSet - - the position where autocompletion began
Method Detail

getDisplayedList

public java.util.List getDisplayedList()
Used for testing purposes to allow automated tests

Specified by:
getDisplayedList in interface SelectionPopup
Returns:
the list that is being displayed

hasFinished

public final boolean hasFinished()

update

public final void update(boolean wasInserted)
Updates the GUI when user presses key

Specified by:
update in interface SelectionPopup
Parameters:
wasInserted - - if the user inserted some text

run

public void run()
Specified by:
run in interface SelectionPopup
Overrides:
run in class java.lang.Thread

getListCellRendererComponent

public final java.awt.Component getListCellRendererComponent(javax.swing.JList list,
                                                             java.lang.Object value,
                                                             int index,
                                                             boolean isSelected,
                                                             boolean cellHasFocus)
Used in JList is allows you to put graphics instead of calling toString()

Specified by:
getListCellRendererComponent in interface SelectionPopup

remove

protected void remove()
Turns off the popup