java.lang.Object
org.autogui.swing.util.SearchTextField.SearchTextFieldModelEmpty
- All Implemented Interfaces:
SearchTextField.SearchTextFieldModel
- Enclosing class:
SearchTextField
public static class SearchTextField.SearchTextFieldModelEmpty
extends Object
implements SearchTextField.SearchTextFieldModel
the empty model for searching nothing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCandidates
(String text, boolean editable, SearchTextField.SearchTextFieldPublisher publisher) the method is executed under the background thread ofSwingWorker
.AfterSearchTextField.SearchTextFieldModel.getCandidates(String, boolean, SearchTextField.SearchTextFieldPublisher)
, an exact matching item might be found, and then the method returns the item.boolean
void
The method is executed under the event dispatching thread.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.autogui.swing.util.SearchTextField.SearchTextFieldModel
isFixedCategorySize
-
Constructor Details
-
SearchTextFieldModelEmpty
public SearchTextFieldModelEmpty()
-
-
Method Details
-
getCandidates
public List<PopupCategorized.CategorizedMenuItem> getCandidates(String text, boolean editable, SearchTextField.SearchTextFieldPublisher publisher) Description copied from interface:SearchTextField.SearchTextFieldModel
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.- Specified by:
getCandidates
in interfaceSearchTextField.SearchTextFieldModel
- 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
Description copied from interface:SearchTextField.SearchTextFieldModel
The method is executed under the event dispatching thread. The user selects the item from a menu and then this method will be called.- Specified by:
select
in interfaceSearchTextField.SearchTextFieldModel
- Parameters:
item
- the selected item
-
getSelection
Description copied from interface:SearchTextField.SearchTextFieldModel
AfterSearchTextField.SearchTextFieldModel.getCandidates(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.- Specified by:
getSelection
in interfaceSearchTextField.SearchTextFieldModel
- Returns:
- the exact matched item or null
-
isBackgroundTask
public boolean isBackgroundTask()- Specified by:
isBackgroundTask
in interfaceSearchTextField.SearchTextFieldModel
-