Module org.autogui

Class SearchTextField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
GuiSwingViewStringField.PropertyStringPane, SearchTextFieldFilePath

public class SearchTextField extends JComponent
a text-field implementation with supporting background searching.
     [ icon: JButton | textField | popupButton ]
       [ popupMenu:
             model.getCandidates(textField.text,...) ]
 
The popup menus are composition of getMenuItemsSource() -> PopupExtensionText.getEditActions(JTextComponent), and getSearchedItems() whose items are set by setCurrentSearchedItems(List, boolean) or setCurrentSearchedItems(List, PopupCategorized.CategorizedMenuItem), called from SearchTextField.SearchTask's background task via SearchTextField.SearchTextFieldModel.

If a background task calls setCurrentSearchedItems and getSearchedItems() is changed, then SearchTextField.SearchedItemsListener is called. In initPopup(), it registers a listener returned by getPopupUpdateListener(PopupExtensionText, PopupCategorized), which dynamically calls PopupExtension.setupMenu().

If the user edits texts, then it needs to dynamically update the popup. To do this, initField() sets up EditingRunner with updateField(List) and registers it to the field as document listener, action listener and focus listener .

See Also: