Saturday, May 30, 2009

I use eclipse badly

Many times I find myself confused when I am working with different instance of eclipse running and toggling from one to another; to jump on to the right workbench. Why ? well below screenshot can tell you why ?

many-eclipse

And below is how my taskbar looks.

taskbar

And it becomes difficult if I minimize all of them and then later figure out ok this one belongs to this project and so on. After you think that you know which task belongs to which project and within a few minutes you will be confused :). One way to solve this confusion/problem is by having multiple copies of eclipse on different locations in your hard drive. This has some disadvantages too. Some which I can see are:

  1. You have to manage different plugins you installed yourself.
  2. Loosing your disk space by having multiple instance of eclipse and plugins copies
  3. You can also notice a few more, isn’t it.

So, to reduce this difficulty I developed a basic eclipse plugin which can help you by setting an icon when you open your eclipse instance. Can’t believe !! here is how my taskbar and Tab Navigation appears now.

many-eclipse-new

And below is how my taskbar looks now.

taskbar-new

You can see here I have set different icons for different languages e.g. C Sharp, Flash, Google Apps, Ruby, Labs and Php. This way it becoms easy to navigate and recognize on which workbench I have to jump now. If you have read this far and are interested then go ahead and read further, else you can jump to some other page on this blog.

Disclaimer: This is my first plugin which is just an experiment, try at your own risk.

Plugin name: productivegeek

Note: PNG files are used from iconfinder.com which are under GPL license.

I think this plugin can enhance the productivity thus the name productivegeek. Atleast it can save you some time toggling between different workbench. Here is how to install.

1. Download this jar file: click here (Right click and Save as)

2. paste this file in your eclipse dropins or plugin folder and then close all instances of eclipse (if open).

3. Now, create a new icon of your eclipse executable and send it to desktop.

4. Now give some arguments to the executable by setting shortcut properties, below is a screenshot

image

Here is what I have supplied in Target field:

G:\eclipse\eclipse.exe -product com.riageeks.productivegeek.flash -data g:\flash-ws

Here G:\eclipse\eclipse.exe is installation location of my eclipse.

-product com.riageeks.productivegeek.flash –> I am asking to set the icon of flash

-data g:\flash –> I am asking to open my workspace at location g:\flash

This way you can create multiple icons on your desktop for each workbench and work with less hassle. If you want to set a new product and a different icon, all you need is a png file to set as icon and a nice workspace name.

You can define your own by following these steps:

  1. Keep your png file and workspace name ready (Tough task!!) and close all eclipse instances.
  2. Use a nice archive explorer which can allow you to add files and change files in a jar file e.g. WinRAR.
  3. Now open the archive file and place your png in the icons folder.
  4. Then open plugin.xml in a nice editor (Notepad++) and define a new extension in this file.
    <!-- Here id is your workspace name and you will open it like
    eclipse.exe -product com.riageeks.productivegeek.flash
    ignore the point value.
    -->
    <extension id="flash" point="org.eclipse.core.runtime.products">
    <!-- Here name attribute is important for you, this will be displayed
    in your title bar so set it as your workspace,
    I choose to set it as "platform-ws" where ws stands for workspace
    -->
    <product application="org.eclipse.ui.ide.workbench" name="flash-ws">
    <!-- here in the value attribute set your png file name -->
    <property name="windowImages" value="icons/flashicon.png" />
    <property name="appName" value="productivegeek"/>
    <property name="aboutImage" value="about_riageeks.jpg"/>
    <property name="aboutText" value="RIAGeeks.com Developed by: Chetan Sachdev"/>
    </product>
    </extension>



  5. That’s all you need to define, save the file and close the jar file.


  6. Now redeploy this plugin in dropins/plugins folder and start your eclipse with the –product argument pointing to your new extension and hopefully it should work.



Thanks to Andrew Niefer for answering my question on stackoverflow.



If you liked this plugin; share it. Have some idea about enhancement ? drop in comments here.