Package ghidra.app.util.datatype
Class DataTypeDropDownSelectionDataModel
- java.lang.Object
-
- ghidra.app.util.datatype.DataTypeDropDownSelectionDataModel
-
- All Implemented Interfaces:
DropDownTextFieldDataModel<DataType>
public class DataTypeDropDownSelectionDataModel extends java.lang.Object implements DropDownTextFieldDataModel<DataType>
The data model forDropDownSelectionTextField
that allows the text field to work withDataType
s.
-
-
Constructor Summary
Constructors Constructor Description DataTypeDropDownSelectionDataModel(DataTypeManagerService dataTypeService)
DataTypeDropDownSelectionDataModel(ServiceProvider serviceProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription(DataType value)
Returns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField
's matching window.java.lang.String
getDisplayText(DataType 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<DataType> data, java.lang.String text)
Returns the index in the given list of the first item that matches the given text.javax.swing.ListCellRenderer<DataType>
getListRenderer()
Returns the renderer to be used to paint the contents of the list returned byDropDownTextFieldDataModel.getMatchingData(String)
.java.util.List<DataType>
getMatchingData(java.lang.String searchText)
Returns a list of data that matches the givensearchText
.
-
-
-
Constructor Detail
-
DataTypeDropDownSelectionDataModel
public DataTypeDropDownSelectionDataModel(ServiceProvider serviceProvider)
-
DataTypeDropDownSelectionDataModel
public DataTypeDropDownSelectionDataModel(DataTypeManagerService dataTypeService)
-
-
Method Detail
-
getListRenderer
public javax.swing.ListCellRenderer<DataType> getListRenderer()
Description copied from interface:DropDownTextFieldDataModel
Returns the renderer to be used to paint the contents of the list returned byDropDownTextFieldDataModel.getMatchingData(String)
.- Specified by:
getListRenderer
in interfaceDropDownTextFieldDataModel<DataType>
-
getDescription
public java.lang.String getDescription(DataType value)
Description copied from interface:DropDownTextFieldDataModel
Returns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField
's matching window.- Specified by:
getDescription
in interfaceDropDownTextFieldDataModel<DataType>
-
getDisplayText
public java.lang.String getDisplayText(DataType value)
Description copied from interface:DropDownTextFieldDataModel
Returns the text for the given item that will be entered into theDropDownSelectionTextField
when the user makes a selection.- Specified by:
getDisplayText
in interfaceDropDownTextFieldDataModel<DataType>
-
getMatchingData
public java.util.List<DataType> getMatchingData(java.lang.String searchText)
Description copied from interface:DropDownTextFieldDataModel
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.- Specified by:
getMatchingData
in interfaceDropDownTextFieldDataModel<DataType>
- Parameters:
searchText
- The text used to find matches.- Returns:
- a list of items matching the given text.
-
getIndexOfFirstMatchingEntry
public int getIndexOfFirstMatchingEntry(java.util.List<DataType> data, java.lang.String text)
Description copied from interface:DropDownTextFieldDataModel
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.- Specified by:
getIndexOfFirstMatchingEntry
in interfaceDropDownTextFieldDataModel<DataType>
- 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.
-
-