Modify the icon of an eclipse template plugin

100 views Asked by At

Followed the steps here and created an eclipse plugin based on the Hello World, Command template - exported it, dropped in the plugins folder of my eclipse install and I saw the menu and toolbar entries alright.

Then I had the idea to modify the icon it showed in the toolbar item. Modified the plugin.xml as in (git diff):

    <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
        <toolbar id="gr.uoa.di.regas.eclipse.poc.toolbars.sampleToolbar">
            <command 
               commandId="gr.uoa.di.regas.eclipse.poc.commands.sampleCommand"
-              icon="icons/sample.gif"
+              icon="icons/my_icon.gif"
               tooltip="Say hello world"
               id="gr.uoa.di.regas.eclipse.poc.toolbars.sampleCommand">
            </command>
        </toolbar>
    </menuContribution>
</extension>

and of course added my_icon.gif into the icons directory. Initially eclipse just kept loading the old icon till I deleted it and reexported just to see the little square that means 'icon not found'

So how do I change the icon ? Also where are the specifications for the icon - can't find any ?

EDIT: renamed the icon to icon.gif thinking the underscores might be the issue - nothing changed - of note that eclipse went ahead and renamed the icon in the plugin.xml (I renamed through the package explorer) - so the setup seems correct - eclipse knows about icon.gif.

EDIT2: the repo for the plugin: https://github.com/Utumno/eclipse_poc

0

There are 0 answers