Module org.autogui
Package org.autogui.swing.util
Class SearchTextFieldFilePath.SearchTextFieldModelFilePath
java.lang.Object
org.autogui.swing.util.SearchTextFieldFilePath.SearchTextFieldModelFilePath
- All Implemented Interfaces:
SearchTextField.SearchTextFieldModel
- Direct Known Subclasses:
GuiSwingTableColumnFilePath.SearchTextFieldModelFilePathEmpty
- Enclosing class:
SearchTextFieldFilePath
public static class SearchTextFieldFilePath.SearchTextFieldModelFilePath
extends Object
implements SearchTextField.SearchTextFieldModel
the model definition for the completing file items
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileSystemView
protected PopupCategorized.CategorizedMenuItem
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getCandidates
(String text, boolean editable, SearchTextField.SearchTextFieldPublisher publisher) the method is executed under the background thread ofSwingWorker
.getChildItems
(Path path) getCompletionItems
(String text, Path path) getFileItem
(Path path, String category, boolean nameOnly) getParentItems
(Path path) 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.setSelection
(String text) 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
isBackgroundTask
-
Field Details
-
selection
-
iconSource
-
-
Constructor Details
-
SearchTextFieldModelFilePath
public SearchTextFieldModelFilePath()
-
-
Method Details
-
isFixedCategorySize
public boolean isFixedCategorySize()- Specified by:
isFixedCategorySize
in interfaceSearchTextField.SearchTextFieldModel
-
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
-
setSelection
-
getCompletionItems
-
getParentItems
-
getChildItems
-
compare
-
getDefaultItems
-
getDefaultCurrent
-
getFileItem
-
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
-