Package ghidra.app.util.datatype
Class DataTypeDropDownSelectionDataModel
java.lang.Object
ghidra.app.util.datatype.DataTypeDropDownSelectionDataModel
- All Implemented Interfaces:
DropDownTextFieldDataModel<DataType>
public class DataTypeDropDownSelectionDataModel
extends Object
implements DropDownTextFieldDataModel<DataType>
The data model for
DropDownSelectionTextField that allows the text field to work with
DataTypes.-
Nested Class Summary
Nested classes/interfaces inherited from interface docking.widgets.DropDownTextFieldDataModel
DropDownTextFieldDataModel.SearchMode -
Constructor Summary
ConstructorsConstructorDescriptionDataTypeDropDownSelectionDataModel(ServiceProvider serviceProvider) DataTypeDropDownSelectionDataModel(DataTypeManager preferredDtm, DataTypeManagerService dataTypeService) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptiongetDescription(DataType value) Returns a description for this item that gives that will be displayed along side of theDropDownSelectionTextField's matching window.getDisplayText(DataType value) Returns the text for the given item that will be entered into theDropDownSelectionTextFieldwhen the user makes a selection.intgetIndexOfFirstMatchingEntry(List<DataType> 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.getMatchingData(String searchText, DropDownTextFieldDataModel.SearchMode mode) Returns a list of data that matches the givensearchText.Subclasses can override this to return all supported search modes.
-
Constructor Details
-
DataTypeDropDownSelectionDataModel
-
DataTypeDropDownSelectionDataModel
public DataTypeDropDownSelectionDataModel(DataTypeManager preferredDtm, DataTypeManagerService dataTypeService) Creates a new instance.- Parameters:
preferredDtm- the preferredDataTypeManager. Data types that are found in multiple data type managers will be pruned to just the ones already in the preferred data type manager.dataTypeService-DataTypeManagerService
-
-
Method Details
-
getSupportedSearchModes
Description copied from interface:DropDownTextFieldDataModelSubclasses can override this to return all supported search modes. The order of the modes is the order which they will cycle when requested by the user. The first mode is the default search mode.- Specified by:
getSupportedSearchModesin interfaceDropDownTextFieldDataModel<DataType>- Returns:
- the supported search modes
-
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<DataType>- Returns:
- the renderer.
-
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<DataType>- Parameters:
value- the value.- Returns:
- the description.
-
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<DataType>- Parameters:
value- the value.- Returns:
- the description.
-
getMatchingData
Description copied from interface:DropDownTextFieldDataModelReturns a list of data that matches the givensearchText. A list is returned to allow for multiple matches. The type of matching performed is determined by the currentsearch mode. If the implementation of this model does not support search modes, then it is up the the implementor to determine how matches are found.Implementation Note: a client request for all data will happen using the empty string. If your data model is sufficiently large, then you may choose to not return any data in this case. Smaller data sets should return all data when given the empty string
- Specified by:
getMatchingDatain interfaceDropDownTextFieldDataModel<DataType>- Parameters:
searchText- The text used to find matches.- Returns:
- a list of items matching the given text.
- See Also:
-
getMatchingData
public List<DataType> getMatchingData(String searchText, DropDownTextFieldDataModel.SearchMode mode) Description copied from interface:DropDownTextFieldDataModelReturns a list of data that matches the givensearchText. A list is returned to allow for multiple matches. The type of matching performed is determined by the currentsearch mode. If the implementation of this model does not support search modes, then it is up the the implementor to determine how matches are found.Implementation Note: a client request for all data will happen using the empty string. If your data model is sufficiently large, then you may choose to not return any data in this case. Smaller data sets should return all data when given the empty string
- Specified by:
getMatchingDatain interfaceDropDownTextFieldDataModel<DataType>- Parameters:
searchText- the text used to find matches.mode- the search mode to use- Returns:
- a list of items matching the given text.
- See Also:
-
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<DataType>- 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.
-