Skip to content

Can a FileSystem extension set icons for files in the FileSystem viewer/browser? #6953

Answered by sbrptdev2
hippietrail asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to alter the GIcon associated with the items, AFAIK. Whether a explicit API exists from Ghidra itself I don't know, but it's all Swing under the hood.

A cursory look gives some hints:

https://ghidra.re/ghidra_docs/api/ghidra/formats/gfilesystem/GIconProvider.html#getIconForFile(ghidra.formats.gfilesystem.GFile,ghidra.util.task.TaskMonitor)

https://ghidra.re/ghidra_docs/api/docking/widgets/tree/GTree.html

The documentation for examples and how things are built is very sparse, but fgrep will be your best companion for the time being.

fgrep --include '*.java' -rn getIconForFile . (from a clone of Ghidra's source)

From ./Ghidra/Features/Base/src/main/java/ghidra/plugins/fsb…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by hippietrail
Comment options

You must be logged in to vote
1 reply
@hippietrail
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants