0

OS X 10.7.5, Eclipse 4.3 Kepler build ID 20130919-0819, Java 1.7.0_51

I'm following along the Vogel tutorial, and I have (another) problem. I've added a toolbar as described in the tutorial, but no icons appear on the toolbar. The toolbar itself appears, but it is empty. If I click in the empty space where the icon should be, the handler is called as expected. I can add an icon file to my project, and have my HandledToolItem point to it, and in that case the icon is visible, and operates as expected.

Should I expect default icons to appear automatically? Do I have to import or include standard Eclipse icons somehow? Or do I have to add each icon manually (I rather doubt this is the case.)

Thanks, gary

greg-449
  • 109,219
  • 232
  • 102
  • 145
garyp
  • 967
  • 7
  • 36
  • If you don't specify an icon you should get the text from the `Label` shown. There are no default icons. – greg-449 Jan 30 '14 at 17:15
  • Yes, that works, thanks. But if I want an icon, where do I get it? The one I used as a test case I downloaded from the internet, and added to my project. Is that the conventional way to do it? Does Eclipse have a pool of icons to draw from so that I don't have to find and add each icon by hand? – garyp Jan 30 '14 at 21:31
  • The various Eclipse plugins have their own icons but they are not really part of the API and might change between releases. You could copy some of these to your own plugin. – greg-449 Jan 30 '14 at 21:38

1 Answers1

0

You can add Icons via the platform-notation, e.g. platform:/plugin/de.myplugin.ui/icons/icon.gif.

Using this way, you can also access eclipse-build-in-icons.

See this blogpost: http://codeandme.blogspot.co.at/2012/07/reusing-platform-images.html for a plugin to browse the available plugins.

Steffen
  • 341
  • 1
  • 12