public final class AutoCompletion
extends javax.swing.text.PlainDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
Constructor and Description |
---|
AutoCompletion(javax.swing.JComboBox comboBox,
boolean showPopupOnMatch,
boolean normalize) |
Modifier and Type | Method and Description |
---|---|
static void |
enable(javax.swing.JComboBox comboBox) |
static void |
enable(javax.swing.JComboBox comboBox,
boolean showPopupOnMatch) |
static void |
enable(javax.swing.JComboBox comboBox,
boolean showPopupOnMatch,
boolean normalize) |
protected javax.swing.JComboBox |
getComboBox() |
protected javax.swing.ComboBoxModel |
getModel() |
protected void |
highlightCompletedText(int start) |
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a) |
protected boolean |
isNormalize() |
protected boolean |
isSelecting() |
protected java.lang.Object |
lookupItem(java.lang.String pattern) |
protected static java.lang.String |
normalize(java.lang.String str) |
void |
remove(int offset,
int len) |
protected void |
setSelectedItem(java.lang.Object item) |
protected void |
setTextAccordingToSelectedItem() |
protected static boolean |
startsWithIgnoreCase(java.lang.String str1,
java.lang.String str2,
boolean normalize) |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
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
public AutoCompletion(javax.swing.JComboBox comboBox, boolean showPopupOnMatch, boolean normalize)
comboBox
- the combo box to auto completeshowPopupOnMatch
- if false the popup menu is not displayed while selecting items via matchingnormalize
- if true then accented characters are normalized before matchingpublic static void enable(javax.swing.JComboBox comboBox)
comboBox
- the combobox on which to enable autocompletionpublic static void enable(javax.swing.JComboBox comboBox, boolean showPopupOnMatch)
comboBox
- the combobox on which to enable autocompletionshowPopupOnMatch
- if false the popup menu is not displayed while selecting items via matchingpublic static void enable(javax.swing.JComboBox comboBox, boolean showPopupOnMatch, boolean normalize)
comboBox
- the combobox on which to enable autocompletionshowPopupOnMatch
- if false the popup menu is not displayed while selecting items via matchingnormalize
- if true then accented characters are normalized before matchingpublic void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a) throws javax.swing.text.BadLocationException
insertString
in interface javax.swing.text.Document
insertString
in class javax.swing.text.PlainDocument
javax.swing.text.BadLocationException
public final void remove(int offset, int len) throws javax.swing.text.BadLocationException
remove
in interface javax.swing.text.Document
remove
in class javax.swing.text.AbstractDocument
javax.swing.text.BadLocationException
protected final javax.swing.JComboBox getComboBox()
protected final javax.swing.ComboBoxModel getModel()
protected final boolean isNormalize()
protected final boolean isSelecting()
protected final void setTextAccordingToSelectedItem()
protected final void highlightCompletedText(int start)
protected final void setSelectedItem(java.lang.Object item)
item
- Value to set for property 'selectedItem'.protected final java.lang.Object lookupItem(java.lang.String pattern)
protected static boolean startsWithIgnoreCase(java.lang.String str1, java.lang.String str2, boolean normalize)
protected static java.lang.String normalize(java.lang.String str)