9

Is it possible in some way to change icon of the Eclipse workspace based on the workspace chosen? 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?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Chetan Sachdev
  • 738
  • 1
  • 12
  • 31
  • To change color, I think I have to write a plugin, for now I tried using -showlocation argument to eclipse. But the problem is it shows a very long title. e.g. If I am in Java perspective, it will show Java - Eclipse Platform - [workspaceName]. Is there a way to reset the title bar string and only show the workspace name ? I want to select the workspace from TaskBar itself, ofcourse a plugin with color configuration will be helpful but for now, can somebody help me with resetting the title bar string of eclipse. – Chetan Sachdev May 19 '09 at 07:59

1 Answers1

8

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
  • 4,279
  • 2
  • 19
  • 22
  • 1
    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 May 31 '09 at 14:31