Package ghidra.app.services

# Interface DataTypeManagerService

All Superinterfaces:
  `DataTypeArchiveService`, `DataTypeQueryService`

public interface DataTypeManagerService extends DataTypeQueryService, DataTypeArchiveService
Service to provide list of cycle groups and data types identified as "favorites." Favorites will show up on the popup menu for creating data and defining function return types and parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addDataTypeManagerChangeListener(DataTypeManagerChangeListener listener)`
  Adds a listener to be notified when changes occur to any open datatype manager.
  `void`
  `edit(Composite composite, String fieldName)`
  Pop up an editor window for the given structure or union
  `void`
  `edit(DataType dt)`
  Pop up an editor window for the given data type.
  `CategoryPath`
  `getCategoryPath(TreePath selectedPath)`
  Shows the user a dialog that allows them to choose a category path from a tree of all available categories.
  `DataType`
  `getDataType(TreePath selectedPath)`
  Shows the user a dialog that allows them to choose a data type from a tree of all available data types.
  `HelpLocation`
  `getEditorHelpLocation(DataType dataType)`
  Gets the location of the help for editing the specified data type.
  `List<DataType>`
  `getFavorites()`
  Get the data types marked as favorites that will show up on a popup menu.
  `Set<String>`
  `getPossibleEquateNames(long value)`
  Examines all enum dataTypes for items that match the given value.
  `DataType`
  `getRecentlyUsed()`
  Get the data type that was most recently used to apply data to a Program.
  `List<DataType>`
  `getSelectedDatatypes()`
  Returns the list of data types that are currently selected in the data types tree
  `boolean`
  `isEditable(DataType dt)`
  Determine if the indicated data type can be edited (i.e.
  `void`
  `removeDataTypeManagerChangeListener(DataTypeManagerChangeListener listener)`
  Removes the given listener from receiving dataTypeManger change notifications.
  `void`
  `setCategorySelected(Category category)`
  Selects the given data type category in the tree of data types.
  `void`
  `setDataTypeSelected(DataType dataType)`
  Selects the given data type in the display of data types.
  `void`
  `setRecentlyUsed(DataType dt)`
  Set the given data type as the most recently used to apply a data type to a Program.

  ### Methods inherited from interface ghidra.app.services.DataTypeArchiveService

  `closeArchive, getBuiltInDataTypesManager, getDataTypeManagers, openArchive, openArchive, openArchive, openArchive, openDataTypeArchive`

  ### Methods inherited from interface ghidra.app.services.DataTypeQueryService

  `findDataTypes, getDataType, getDataTypesByPath, getProgramDataTypeByPath, getSortedCategoryPathList, getSortedDataTypeList, promptForDataType`

- ## Method Details

  - ### getFavorites

    List<DataType> getFavorites()
    Get the data types marked as favorites that will show up on a popup menu.
    Returns:
      list of favorite datatypes

  - ### addDataTypeManagerChangeListener

    void addDataTypeManagerChangeListener(DataTypeManagerChangeListener listener)
    Adds a listener to be notified when changes occur to any open datatype manager.
    Parameters:
      `listener` - the listener to be added.

  - ### removeDataTypeManagerChangeListener

    void removeDataTypeManagerChangeListener(DataTypeManagerChangeListener listener)
    Removes the given listener from receiving dataTypeManger change notifications.
    Parameters:
      `listener` - the listener to be removed.

  - ### setRecentlyUsed

    void setRecentlyUsed(DataType dt)
    Set the given data type as the most recently used to apply a data type to a Program.
    Parameters:
      `dt` - data type that was most recently used

  - ### getRecentlyUsed

    DataType getRecentlyUsed()
    Get the data type that was most recently used to apply data to a Program.
    Returns:
      data type that was most recently used

  - ### getEditorHelpLocation

    HelpLocation getEditorHelpLocation(DataType dataType)
    Gets the location of the help for editing the specified data type.
    Parameters:
      `dataType` - the data type to be edited.
    Returns:
      the help location for editing the data type.

  - ### isEditable

    boolean isEditable(DataType dt)
    Determine if the indicated data type can be edited (i.e. it has an editor that this service knows how to invoke).
    Parameters:
      `dt` - data type to be edited
    Returns:
      true if this service can invoke an editor for changing the data type.

  - ### edit

    void edit(DataType dt)
    Pop up an editor window for the given data type.
    Parameters:
      `dt` - the data type; built in types cannot be edited
    Throws:
      `IllegalArgumentException` - if the given has not been resolved by a DataTypeManager; in other words, if `DataType.getDataTypeManager()` returns null

  - ### edit

    void edit(Composite composite, String fieldName)
    Pop up an editor window for the given structure or union
    Parameters:
      `composite` - the structure or union
      `fieldName` - the optional field name to select in the editor window
    Throws:
      `IllegalArgumentException` - if the given has not been resolved by a DataTypeManager; in other words, if `DataType.getDataTypeManager()` returns null

  - ### setDataTypeSelected

    void setDataTypeSelected(DataType dataType)
    Selects the given data type in the display of data types. A null `dataType` value will clear the current selection.
    Parameters:
      `dataType` - The data type to select.

  - ### setCategorySelected

    void setCategorySelected(Category category)
    Selects the given data type category in the tree of data types. This method will cause the data type tree to come to the front, scroll to the category and then to select the tree node that represents the category. If the category is null, the selection is cleared.
    Parameters:
      `category` - the category to select; may be null

  - ### getSelectedDatatypes

    List<DataType> getSelectedDatatypes()
    Returns the list of data types that are currently selected in the data types tree
    Returns:
      the list of data types that are currently selected in the data types tree

  - ### getDataType

    DataType getDataType(TreePath selectedPath)
    Shows the user a dialog that allows them to choose a data type from a tree of all available data types.
    Parameters:
      `selectedPath` - An optional tree path to select in the tree
    Returns:
      A data type chosen by the user

  - ### getCategoryPath

    CategoryPath getCategoryPath(TreePath selectedPath)
    Shows the user a dialog that allows them to choose a category path from a tree of all available categories.
    Parameters:
      `selectedPath` - An optional tree path to select in the tree
    Returns:
      A category path chosen by the user

  - ### getPossibleEquateNames

    Set<String> getPossibleEquateNames(long value)
    Examines all enum dataTypes for items that match the given value. Returns a list of Strings that might make sense for the given value.
    Parameters:
      `value` - the value to search for.
    Returns:
      the list of enum item names that match the given value