Package ghidra.plugins.fsbrowser

# Class FileIconService

java.lang.Object
ghidra.plugins.fsbrowser.FileIconService

public class FileIconService extends Object
Provides `Icon`s that represent the type and status of a file, based on a filename mapping and caller specified status overlays.

The mappings between a file's extension and its icon are stored in a resource file called "file_extension_icons.xml", which is read and parsed the first time this service is referenced.

Status overlays are also specified in the file_extension_icons.xml file, and are resized to be 1/2 the width and height of the icon they are being overlaid on.

Thread safe

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Icon`
  `DEFAULT_ICON`
  `static final Icon`
  `FILESYSTEM_OVERLAY_ICON`
  `static final Icon`
  `IMPORTED_OVERLAY_ICON`
  `static final Icon`
  `MISSING_PASSWORD_OVERLAY_ICON`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Icon`
  `getIcon(String fileName, List<Icon> overlays)`
  Returns an `Icon` that represents a file's content based on its name.
  `static FileIconService`
  `getInstance()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### IMPORTED_OVERLAY_ICON

    public static final Icon IMPORTED_OVERLAY_ICON

  - ### FILESYSTEM_OVERLAY_ICON

    public static final Icon FILESYSTEM_OVERLAY_ICON

  - ### MISSING_PASSWORD_OVERLAY_ICON

    public static final Icon MISSING_PASSWORD_OVERLAY_ICON

  - ### DEFAULT_ICON

    public static final Icon DEFAULT_ICON

- ## Method Details

  - ### getInstance

    public static FileIconService getInstance()

  - ### getIcon

    public Icon getIcon(String fileName, List<Icon> overlays)
    Returns an `Icon` that represents a file's content based on its name.
    Parameters:
      `fileName` - name of file that an icon is being requested for.
      `overlays` - optional list of overlay icons that should be overlaid on top of the base icon. These icons represent a status or feature independent of the file's base icon.
    Returns:
      `Icon` instance that best represents the named file, never null.