IconDescriptor

Describes an Icon, and can instantiate an icon, but is not itself an icon.

You may think it's better to just extend the Icon class instead of having this class in between. However, as noted in the comments to IJPL-163887, this leads to issues with IntelliJ's built-in icon mechanisms that are responsible for loading, caching, and scaling.

You may also think it's better to just create functions that return Icons directly, i.e. replace this class with a function that implements only the get function. However, this would result in a loss of metadata. For example, with TypeIcon, the returned LayeredIcon does not tell you what the original TypeIcon.text and TypeIcon.colors are, making a function such as TypeIcon.combine a real mess to implement.

Inheritors

Functions

Link copied to clipboard
abstract fun get(): Icon

Creates or returns the described Icon.