FWDekker / intellij-randomness

IntelliJ plugin for inserting random numbers, UUIDs, names, IP addresses, and much more
https://plugins.jetbrains.com/plugin/9836-randomness
MIT License
45 stars 7 forks source link

Allow assigning icons to templates #517

Closed FWDekker closed 5 months ago

FWDekker commented 8 months ago

Users should be able to select an icon that represents their template better than the default icon. Doing so will let users recognise relevant templates sooner. I'd rather not have to deal with files, and would prefer only exposing icons available from the IDE by default. Also, I'd rather not create my own icon picker, so I'll have to see if there is some existing reusable component. If not, I might drop this issue as being not worth my time.

(This idea was originally suggested by @solonovamax.)

FWDekker commented 8 months ago

There might be a reusable component: In the "Menus and Toolbars" settings menu, it's possible to choose an icon. I might be able to reuse that element, or at least look at the code and see how it works.

This component is called BrowseIconsComboBox, and is internal :-(

Additionally/alternatively, I can use the AllIcons, use reflection to traverse all those icons that exist there, and make their paths available to the end-user; store that path, and load it again when needed. Unfortunately, much of the relevant code here is marked as internal, so this would result in quite a fragile API...

FWDekker commented 5 months ago

Thus far, the main "issue" in maintaining Randomness has been interacting with JB's ever-changing API, so setting up a fragile API as proposed above is not something I will consider.

I will close this issue until such a time that this is possible with JB's standard API.