views:

937

answers:

1

Is it possible in some way to change icon of the eclipse workspace based on the workspace choosen, I have multiple workspace open running in different eclipse instances and it becomes complex to recognize. I tried the location argument, which shows the location, but it changes based on selection of directory in the Package Explorer/Navigator. Any tips ?

+3  A: 

In Eclipse, products are define using the products extension point. Among other things, this extension point defines branding icons. These affect the windows task bar, and also the icons in the alt-tab list.

What you could do is create your own plug-in that defines new products that each use a different icon, these products can then just run the regular eclipse application. You can switch between products on the command line.

The product extension point would be like this:

  <extension id="my_product_1" point="org.eclipse.core.runtime.products">
      <product application="org.eclipse.ui.ide.workbench" name="My Product">
         <property name="windowImages" value="icons/sample2.gif" />
         <property name="appName"      value="My Product"/>
         <property name="aboutImage"   value="product_lg.gif"/>
         <property name="aboutText"    value="My Product"/>
      </product>
   </extension>

You can create several in the same plug-in, each referring to a different icon. You can see an example by creating a new plug-in using the RCP Mail Template.

You refer to this product on the command line with "-product [plug-in id].[product-id]". So you can create several windows shortcuts with different command lines, specifying different products and workspaces:

eclipse -product org.my.plugin.my_product_1 -data /path/workspace1
eclipse -product org.my.plugin.my_product_2 -data /path/workspace2

In Eclipse 3.3 and earlier, you can just copy your plug-in into the eclipse/plugins directory for it to be used. In 3.5 there is an option during plug-in export to "Install into host". In 3.4 (and 3.5) there is the dropins folder.

Andrew Niefer
Thanks Andrew, I explored the Eclipse Plugin Lifecycle and developed a basic eclipse plugin which defines multiple products in a plugin. Thanks for your help. Here is the link: http://cksachdev.blogspot.com/2009/05/i-use-eclipse-badly.html
Chetan Sachdev