Where to put images in project for plugins

I am writing my first plugin that has UI elements and I'm not sure how to configure my project to ensure that images are available to the plugin (e.g. getResource() calls). Is there a specific directorty structure I should use. Do I need to configure my project in a certain manner to include the images in the classpath of the generated plugin .jar?

Thanks!

Todd

4 comments
Comment actions Permalink

Hello Todd,

You can essentially put them anywhere you want as long as they end up in
the plugin classpath. Either pack them into the main plugin jar or have a
separate icons jar. To load the icons, use the IconLoader class in the OpenAPI.

I am writing my first plugin that has UI elements and I'm not sure how
to configure my project to ensure that images are available to the
plugin (e.g. getResource() calls). Is there a specific directorty
structure I should use. Do I need to configure my project in a certain
manner to include the images in the classpath of the generated plugin
.jar?


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks for the quick reply, Dmitry.

I guess I'm really asking how I configure IntelliJ to automatically copy the images into the .jar file when I build the plugin jar.

Todd

0
Comment actions Permalink

Hello Todd,

Make sure that the extension of your image files is listed in Settings |
Compiler | Resource patterns.

Thanks for the quick reply, Dmitry.

I guess I'm really asking how I configure IntelliJ to automatically
copy the images into the .jar file when I build the plugin jar.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Thanks!

That was the problem

Todd

0

Please sign in to leave a comment.