Module org.autogui

Interface SearchTextField.SearchTextFieldModel

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 Details

    • getCandidates

      the method is executed under the background thread of SwingWorker. 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 text
      editable - whether the field is editable or not
      publisher - 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

      After 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.
      Returns:
      the exact matched item or null
    • isFixedCategorySize

      default boolean isFixedCategorySize()
    • isBackgroundTask

      default boolean isBackgroundTask()