How to change custom perspective icon in eclipse?

I want to change my custom perspective icon in eclipse. I searched a lot, but I did not find a solution.

+8
eclipse perspective icons
source share
3 answers

If you saved an existing perspective with a different name as your custom perspective, you cannot change the icon.

You will need to determine the perspective by writing a small Eclipse plugin to be able to change the icon.

+3
source share

You can change the perspective icon by updating the iconURI attribute of the iconURI definition in the workbench.xmi file. This file is located inside the workspace metadame directory. e.g. /My-Workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi .

There are usually two lines with the iconURI attribute. For example:

 <children xsi:type="advanced:Perspective" ... iconURI="platform:/plugin/com.atlassian.clover.eclipse.core/icons/cview16/clover.gif" tooltip="Clover"> 

and

 <snippets xsi:type="advanced:Perspective" ... iconURI="platform:/plugin/com.atlassian.clover.eclipse.core/icons/cview16/clover.gif" tooltip="Clover"> 

The icon URI is the path to the image in the Eclipse plugin. (Plugins are located in the {ECLIPSE_HOME}/plugins directory.)

The workbench.xmi file must be edited after closing the Eclipse IDE, because the file will be overwritten when you exit Eclipse.

In this example, I created a custom perspective called Clover, changing the Java Perspective available in Eclipse and saving it as "Clover". My perspective originally had the same icon as the Java perspective:

initial icon of the custom perspective

So, I closed Eclipse, changed the icon paths in workbench.xmi , saved the file, opened the IDE again and got a new icon:

new icon of the custom perspective

Note. I am using Eclipse 4.6.0 (Neon), but this solution will work for all versions of Eclipse 4.

0
source share

Open plugin.xml for your plugin; Go to the "Extensions" page; and select the perspective extension (in org.eclipse.ui.perspectives: you must enter your custom prspective here). There is an icon attribute that you can set for your custom perspective. (I am using Neon2)

0
source share

All Articles