- All Known Implementing Classes:
GuiSwingTableColumnFilePath.SearchTextFieldModelFilePathEmpty,SearchTextField.SearchTextFieldModelEmpty,SearchTextFieldFilePath.SearchTextFieldModelFilePath
- Enclosing class:
SearchTextField
public static interface SearchTextField.SearchTextFieldModel
the interface for the searching model
-
Method Summary
Modifier and TypeMethodDescriptiongetCandidates(String text, boolean editable, SearchTextField.SearchTextFieldPublisher publisher) the method is executed under the background thread ofSwingWorker.AftergetCandidates(String, boolean, SearchTextField.SearchTextFieldPublisher), an exact matching item might be found, and then the method returns the item.default booleandefault booleanvoidThe method is executed under the event dispatching thread.
-
Method Details
-
getCandidates
List<PopupCategorized.CategorizedMenuItem> getCandidates(String text, boolean editable, SearchTextField.SearchTextFieldPublisher publisher) the method is executed under the background thread ofSwingWorker. The publisher is passed for checking cancellation and publishing intermediate result.List<CategorizedMenuItem> results = new ArrayList<>(); for (CategorizedMenuItem item : ...) { if (publisher.isSearchCancelled()) { break; } results.add(item); publisher.publishSearch(results); } return results;Note: the method is also called by selection of a searched menu item. Then the select is already set as the same value of the text.- Parameters:
text- the input texteditable- whether the field is editable or notpublisher- the publisher for submitting the searched item- Returns:
- the total results of searched items
-
select
The method is executed under the event dispatching thread. The user selects the item from a menu and then this method will be called.- Parameters:
item- the selected item
-
getSelection
PopupCategorized.CategorizedMenuItem getSelection()AftergetCandidates(String, boolean, SearchTextField.SearchTextFieldPublisher), an exact matching item might be found, and then the method returns the item. Otherwise, returns null. The method is executed under the event dispatching thread.- Returns:
- the exact matched item or null
-
isFixedCategorySize
default boolean isFixedCategorySize() -
isBackgroundTask
default boolean isBackgroundTask()
-