Monthly Archives: December 2010

Inheritance

One my gripes about the Eclipse framework is the general lack of standardized interfaces & inheritance.

For instance: a TreeColumn & TableColumn both have a lot of attributes in common … width, alignment, movability, sortability, resizeability, etc.

But since they don’t share an interface or a common ancestor, you can’t handle them with common code.

Similarly widgets like the ComboBox and a Text field share a lot of attributes … they can hold text, they can be changed, etc, but you can’t access those attributes with a common interface.

Sadly most Eclipse widgets explicitly forbid subclassing … so I can’t subclass the various types and add my own interfaces. The following is a direct quote from the TableColumn javadocs …

IMPORTANT: This class is not intended to be subclassed.

And, unfortunately, they enforce this in code.

Preventing Multiple Instances

One of the things I needed to support in my RCP is the ability to prevent multiple copies (instances) of the application from running at the same time.

The solution is surprisingly easy … although, as with many things, not especially well documented.

In your Application class (that implements IApplication) you need to create a lock file in the application’s instance location.
Continue reading Preventing Multiple Instances

Help Icon on Dialog Pages

Another item I struggled with … adding the help icon to various dialogs (wizards, preferences, properties, about box, etc).

In almost all Eclipse dialogs … there is a question mark icon in the lower left hand corner. You click on this and it invokes the context sensitive help.

The problem was, I couldn’t figure out how to activate this.

I thought it would be controlled by some plug-in or product setting, but I couldn’t determine where.

After a fair bit of digging & debugging of base Eclipse, I determined that this feature is turned on globally for the entire application:

Continue reading Help Icon on Dialog Pages

Removing P2 from RCP

Recently I was struggling with a problem having to do with the headless build of my RCP application.

For some reason the P2 update function was being included in the build application, even though I never specified it as a requirement for the feature or plug-in.

The result was, when the user clicked on the Installation Details button on the applications about box, the tabs for “Installed Software” and “Installation History” were shown … but they were both empty.

After a lot of web searching I was unable to find a way to exclude the P2 feature & plug-in’s from my application.

My suspicion is that one of the other plug-in’s or feature’s that I’m using has p2 as a requirement.