Homer Is Addicted To Eclipse

October 31, 2008

Here is my participation to Nick Boldt new Eclipse Photoshop Challenge

Homer's Eclipse's Love

Homer's Eclipse's Love

Thanks to Homer and Eclipse I learned Gimp’s color selection feature and I am going to sleep at 2 am ;o)

Manu


Useless Plugins Dependencies

October 15, 2008

One of my preocupation when writing code is to perform exactly the needed work and to have pieces of code as small as possible. All unnecessary “things” HAVE to be removed.

One of these “things” in Eclipse is plugin dependencies.

The first way to avoid adding useless dependencies is to uncheck the “Generate activator …” and  “This plugin will make contribution to the UI” checkboxes when creating a new “Library plugin”.

New Plugin Wizard Page 2

New Plugin Wizard Page 2

“Library plugins” are plugins that do not contribute anything to the platform but just exposes some “library” code. For example a plugin encapsulating sqlite.jar (JDBC driver for sqlite database) is a library plugin. Such plugin doesn’t need an Activator so doesn’t need dependencies on any Eclipse plugin. A common mistake is to use the Activator only to access Eclipse logging service. Such plugins should just through exceptions to clients plugins instead of using Eclipse logging service in order to remove dependencies on Eclipse’s core classes.

The second way to remove unused dependencies for any plugin is to simply use the Wonderfull PDE ;o)

Find Unused Dependencies

Find Unused Dependencies

Just click on the find unused dependencies link and PDE will tell you what dependencies you can remove !!!

Remove all these dependencies will lead to a smaller (mainly in terms of disk space) application for RCP developers. For plateform plugins developers it will increase the probability that your bundle will be resolved on your client’s Eclipse installation.

Use the PDE tools and remove your unused dependencies !!!


Eclipse’s EventManager

October 7, 2008

Yesterday I reached a ConcurrentModificationException while notifying the selection listeners registered on my ViewPart. One listener was trying to remove itself of the listeners list while it was notified.

After a quick look into several Eclipse’s ViewPart classes providing selection change events it seems they all use the org.eclipse.core.commands.common.EventManager abstract class.

Here is this class description:

“A manager to which listeners can be attached. This handles the management of a list of listeners — optimizing memory and performance. All the methods on this class are guaranteed to be thread-safe”

This class also guarantees using org.eclipse.core.runtime.ListenerList class that a listener can be removed while we are itterating on the getListeners() method’s result.

This existing class was exactly the answer to my need.

Conclusion here is : REUSE and step into an Eclipse’s plugin already solving your problem (it’s generally easy to find such a plugin) to find the “right” answer.


Follow

Get every new post delivered to your Inbox.