standup.utils
Class AutoCompletion

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by standup.utils.AutoCompletion
All Implemented Interfaces:
Serializable, Document

public class AutoCompletion
extends PlainDocument

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
(package private)  JComboBox comboBox
           
(package private)  JTextComponent editor
           
(package private)  FocusListener editorFocusListener
           
(package private)  KeyListener editorKeyListener
           
(package private)  boolean hidePopupOnFocusLoss
           
(package private)  boolean hitBackspace
           
(package private)  boolean hitBackspaceOnSelection
           
(package private)  ComboBoxModel model
           
(package private)  boolean selecting
           
private static long serialVersionUID
           
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
AutoCompletion(JComboBox comboBox)
           
 
Method Summary
(package private)  void configureEditor(ComboBoxEditor newEditor)
           
private static void createAndShowGUI()
           
static void enable(JComboBox comboBox)
           
private  void highlightCompletedText(int start)
           
 void insertString(int offs, String str, AttributeSet a)
           
private  Object lookupItem(String pattern)
           
static void main(String[] args)
           
 void remove(int offs, int len)
           
private  void setSelectedItem(Object item)
           
private  void setText(String text)
           
private  boolean startsWithIgnoreCase(String str1, String str2)
           
 
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

comboBox

JComboBox comboBox

model

ComboBoxModel model

editor

JTextComponent editor

selecting

boolean selecting

hidePopupOnFocusLoss

boolean hidePopupOnFocusLoss

hitBackspace

boolean hitBackspace

hitBackspaceOnSelection

boolean hitBackspaceOnSelection

editorKeyListener

KeyListener editorKeyListener

editorFocusListener

FocusListener editorFocusListener
Constructor Detail

AutoCompletion

public AutoCompletion(JComboBox comboBox)
Method Detail

enable

public static void enable(JComboBox comboBox)

configureEditor

void configureEditor(ComboBoxEditor newEditor)

remove

public void remove(int offs,
                   int len)
            throws BadLocationException
Specified by:
remove in interface Document
Overrides:
remove in class AbstractDocument
Throws:
BadLocationException

insertString

public void insertString(int offs,
                         String str,
                         AttributeSet a)
                  throws BadLocationException
Specified by:
insertString in interface Document
Overrides:
insertString in class PlainDocument
Throws:
BadLocationException

setText

private void setText(String text)

highlightCompletedText

private void highlightCompletedText(int start)

setSelectedItem

private void setSelectedItem(Object item)

lookupItem

private Object lookupItem(String pattern)

startsWithIgnoreCase

private boolean startsWithIgnoreCase(String str1,
                                     String str2)

createAndShowGUI

private static void createAndShowGUI()

main

public static void main(String[] args)