Category Archives: Eclipse

Eclipse plug-in & RCP stuff

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.

Related posts ...
There appears to be a known issue in the headless build facility that results in
I was trying to use Eclipse 3.6 to manually export a RPC using on a
Here's a problem I just encountered ... and, unfortunately, haven't figured out a solution. A
I'm in the process of updating the help text for my RCP and have found

Icons for RCP

When building an Eclipse RCP product, you have the ability to generate a native executable.  By default the icon associated with the executable is the Eclipse graphic.

There’s an option in the product definition (‘.product’ file) that lets you use your own icons.

There are two ways to attach the icons …

  • Six different BMP files – 16×16, 32×32, & 48×48 at 32 bit & 8 bit depths.
  • A single ICO file with all six graphics included.

I was struggling with creating the graphic files I needed.  I had no problem getting the 32 bit version of the files created, but couldn’t figure out how to create the 8 bit version.

Continue reading

Related posts ...
In a recent project I had a combo box that I wanted to add additional
Normally, when you view the property pages on Eclipse items, the pages show up in
You may have heard a variation of this at some point ... A lazy programmer
Here's a problem I just encountered ... and, unfortunately, haven't figured out a solution. A

Including a JRE in a headless build

There appears to be a known issue in the headless build facility that results in a built RCP product not having a JRE (even though the product configuration indicates there should be one).

If you do an export from the Eclipse UI, you do get the JRE included.

After a fair amount of digging I figured out how to resolve this problem.

First … you need to have your product based on features.

Next, modify your features build.properties file to include the following line …

root.win32.win32.x86.folder.jre=absolute:${java.home}/

This will cause the generated build script for the feature to copy the JRE that is executing the compile into the jre directory of the product.

Obviously this entry is specific to Windows 32bit compiles.

Related posts ...
Recently I was struggling with a problem having to do with the headless build of
I was trying to use Eclipse 3.6 to manually export a RPC using on a
Here's a problem I just encountered ... and, unfortunately, haven't figured out a solution. A
I'm in the process of updating the help text for my RCP and have found

Eclipse Development

At work I’m the process of building a new GUI application using the Eclipse RCP framework.

I’ve encountered a number of stumbling blocks, frustrations, and seridipidous moments … so I decided to blog about it.

You can find the blog at http://eclipse.geekyramblings.net.

Related posts ...
One of the things I needed to support in my RCP is the ability to
If you're seeing a lot of messages about untrusted TLS connections in your mail log
This post only covers the technical details of how to implement http/2 on an Apache
We all agree that email is crucial to modern life. But what email should you

Export RPC — File In Use

I was trying to use Eclipse 3.6 to manually export a RPC using on a Win7 x64 system but kept getting the following error:

C:\Users\myuserid\workspace\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\build.xml:103: Failed to copy C:\eclipse\configuration\org.eclipse.equinox.app\.manager\.tmp31587.instance to c:\test-app\eclipse\win32.win32.x86\eclipse\jre\configuration\org.eclipse.equinox.app\.manager\.tmp31587.instance due to The process cannot access the file because another process has locked a portion of the file

The file .tmp31587.instance was indeed locked … apparently by the eclipse instance that I was currently using.

So it appeared that the export function was trying to copy a file from the live Eclipse instance.

My solution was to move the configuration directory for the live eclipse instance to my personal home directory.

The eclipse product was installed in C:\eclipse … so I copied “C:\eclipse\configuration” to “C:\User\myuserid\eclipse\configuration” and then changed the shortcut I use to launch eclipse to include the parameter “-configuration C:\Users\myuserid\eclipse\configuration”.

Now, when I launch eclipse, and export the RPC … it doesn’t try to copy a file that’s in use, since the configuration is no longer in the eclipse application directory.

Related posts ...
Recently I was having a problem getting some software installed on my laptop running Windows
For those of you who are playing around with Windows 7 (like me) and use
Last week I decided to start playing around with Windows 7 on my laptop ...
Here's a problem I just encountered ... and, unfortunately, haven't figured out a solution. A

Wrap JLabel Text

It took a bit of experimentation, but I think this routine could be used to allow a Java JLabel component to contained wrapped text.

This routine depends on the ability for JLabel text to contain HTML.

Basically it iterates through each word in the JLabel text, appends the word to a ‘trial’ string buffer, and determines if the trial string is larger than the JLabel’s container. If the trial string is larger, then it inserts a html break in the text, resets the trial string buffer, and moves on to the next word.

private void wrapLabelText(JLabel label, String text) {
	FontMetrics fm = label.getFontMetrics(label.getFont());
	Container container = label.getParent();
	int containerWidth = container.getWidth();

	BreakIterator boundary = BreakIterator.getWordInstance();
	boundary.setText(text);

	StringBuffer trial = new StringBuffer();
	StringBuffer real = new StringBuffer("<html>");

	int start = boundary.first();
	for (int end = boundary.next(); end != BreakIterator.DONE;
		start = end, end = boundary.next()) {
		String word = text.substring(start,end);
		trial.append(word);
		int trialWidth = SwingUtilities.computeStringWidth(fm,
			trial.toString());
		if (trialWidth > containerWidth) {
			trial = new StringBuffer(word);
			real.append("<br>");
		}
		real.append(word);
	}

	real.append("</html>");

	label.setText(real.toString());
}
Related posts ...
If you're seeing a lot of messages about untrusted TLS connections in your mail log
We all agree that email is crucial to modern life. But what email should you
As part of my migration to the cloud, I terminated the Comcast Business internet service
With my recent migration of servers from my basement to Amazon cloud servers, I had