Package docking.widgets.filechooser
Class FileDropDownSelectionDataModel
java.lang.Object
docking.widgets.filechooser.FileDropDownSelectionDataModel
- All Implemented Interfaces:
DropDownTextFieldDataModel<File>
public class FileDropDownSelectionDataModel
extends Object
implements DropDownTextFieldDataModel<File>
A model that allows the
DropDownSelectionTextField to work with File objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDescription(File file) Returns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField's matching window.getDisplayText(File value) Returns the text for the given item that will be entered into theDropDownSelectionTextFieldwhen the user makes a selection.intgetIndexOfFirstMatchingEntry(List<File> data, String text) Returns the index in the given list of the first item that matches the given text.Returns the renderer to be used to paint the contents of the list returned byDropDownTextFieldDataModel.getMatchingData(String).getMatchingData(String searchText) Returns a list of data that matches the givensearchText.
-
Constructor Details
-
FileDropDownSelectionDataModel
-
-
Method Details
-
getDisplayText
Description copied from interface:DropDownTextFieldDataModelReturns the text for the given item that will be entered into theDropDownSelectionTextFieldwhen the user makes a selection.- Specified by:
getDisplayTextin interfaceDropDownTextFieldDataModel<File>- Parameters:
value- the value.- Returns:
- the description.
-
getIndexOfFirstMatchingEntry
Description copied from interface:DropDownTextFieldDataModelReturns the index in the given list of the first item that matches the given text. For data sets that do not allow duplicates, this is simply the index of the item that matches the text in the list. For items that allow duplicates, the is the index of the first match.- Specified by:
getIndexOfFirstMatchingEntryin interfaceDropDownTextFieldDataModel<File>- Parameters:
data- the list to search.text- the text to match against the items in the list.- Returns:
- the index in the given list of the first item that matches the given text.
-
getListRenderer
Description copied from interface:DropDownTextFieldDataModelReturns the renderer to be used to paint the contents of the list returned byDropDownTextFieldDataModel.getMatchingData(String).- Specified by:
getListRendererin interfaceDropDownTextFieldDataModel<File>- Returns:
- the renderer.
-
getMatchingData
Description copied from interface:DropDownTextFieldDataModelReturns a list of data that matches the givensearchText. A match typically means a "startsWith" match. A list is returned to allow for multiple matches.- Specified by:
getMatchingDatain interfaceDropDownTextFieldDataModel<File>- Parameters:
searchText- The text used to find matches.- Returns:
- a list of items matching the given text.
-
getDescription
Description copied from interface:DropDownTextFieldDataModelReturns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField's matching window.- Specified by:
getDescriptionin interfaceDropDownTextFieldDataModel<File>- Parameters:
file- the value.- Returns:
- the description.
-