Package docking.widgets
Interface DropDownTextFieldDataModel<T>
-
- Type Parameters:
T
- The type of object that this model manipulates
- All Known Implementing Classes:
DataTypeDropDownSelectionDataModel
,DefaultDropDownSelectionDataModel
,FileDropDownSelectionDataModel
public interface DropDownTextFieldDataModel<T>
This interface represents all methods needed by theDropDownSelectionTextField
in order to search, show, manipulate and select objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getDescription(T value)
Returns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField
's matching window.java.lang.String
getDisplayText(T value)
Returns the text for the given item that will be entered into theDropDownSelectionTextField
when the user makes a selection.int
getIndexOfFirstMatchingEntry(java.util.List<T> data, java.lang.String text)
Returns the index in the given list of the first item that matches the given text.javax.swing.ListCellRenderer<T>
getListRenderer()
Returns the renderer to be used to paint the contents of the list returned bygetMatchingData(String)
.java.util.List<T>
getMatchingData(java.lang.String searchText)
Returns a list of data that matches the givensearchText
.
-
-
-
Method Detail
-
getMatchingData
java.util.List<T> getMatchingData(java.lang.String searchText)
Returns a list of data that matches the givensearchText
. A match typically means a "startsWith" match. A list is returned to allow for multiple matches.- Parameters:
searchText
- The text used to find matches.- Returns:
- a list of items matching the given text.
-
getIndexOfFirstMatchingEntry
int getIndexOfFirstMatchingEntry(java.util.List<T> data, java.lang.String text)
Returns 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.- Parameters:
data
- the list to searchtext
- 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
javax.swing.ListCellRenderer<T> getListRenderer()
Returns the renderer to be used to paint the contents of the list returned bygetMatchingData(String)
.
-
getDescription
java.lang.String getDescription(T value)
Returns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField
's matching window.
-
getDisplayText
java.lang.String getDisplayText(T value)
Returns the text for the given item that will be entered into theDropDownSelectionTextField
when the user makes a selection.
-
-