I want to change my custom perspective's icon in eclipse. I have searched a lot but I didn't find any solution.
the saved perspective's settings will be included in the preferences file. when you've updated the layout, just resave and overwrite the perspective and export the preferences again. to save your perspective, select window > save perspective as… from the application menu.
In Eclipse the user can open a new perspective with a particular type, switch from one perspective to another with different type, or change the type (layout) of an existing perspective as they move from one task to another.
The icon for a perspective can be changed by updating the iconURI
attribute of the perspective's definition in workbench.xmi
file. This file is located inside the .metadata directory of the workspace. 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 a path to an image within an Eclipse plugin. (Plugins are located at {ECLIPSE_HOME}/plugins
directory.)
The workbench.xmi
file needs to be edited after closing the Eclipse IDE, because the file gets overwritten when you exit from Eclipse.
In this example I created a custom perspective named Clover by modifying the Java Perspective available in Eclipse, and saving it as "Clover". Initially my perspective had the same icon as the Java perspective:
So I closed Eclipse, changed the icon paths in workbench.xmi
, saved the file, reopened the IDE, and got the new icon displayed:
Note: I use Eclipse 4.6.0 (Neon) but this solution would work for all Eclipse 4 versions.
If you stored an existing perspective under a different name as your custom perspective, then it is not possible to change the icon.
You would have to define the perspective by writing a small Eclipse plugin to be able to change the icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With