Monday, December 26, 2005

Simplified resource bundle handling with osgi.util.NLS

In eclipse 3.1 there is a new package org.eclipse.osgi.util.NLS. This class allows you to have simple access to a resource bundle.
public class MyMessages extends NLS {
private static final String BUNDLE_NAME = "gr.scharf.MyMessages"; //$NON-NLS-1$

public static String HELLO_WORLD;
public static String HELLO_SOMETHING;

static {
// initialize resource bundles
NLS.initializeMessages(BUNDLE_NAME, MyMessages.class);
}
}

And in the file gr/scharf/MyMessages.properties I put:
  HELLO_WORLD=Hello world!
HELLO_SOMETHING=Hello {0}!


Then access to the properties is very simple:
    System.out.println(MyMessages.HELLO_WORLD);
System.out.println(MyMessages.bind(MyMessages.HELLO_SOMETHING,"world"));


Pretty cool, I think, because it loads the strings from the .properties file into the Messages class transparently. This also helps searching for strings in the code, because it is the same name as in the .properties file.

Sunday, December 25, 2005

When workspaces don't build correctly....

I have some workspaces that are quite 'old'. They have been used with several versions of eclipse. It happens quite often, when I add or remove a project that those workspaces do not build. Eclipse complains that some project should be build first and I should clean the workspace. Well, cleaning the workspace does not help. So, I opened and closed some projects until I got it to work. Very frustrating! It seems that the build order is wrong.

Today, I had the problem again. But I looked at Preferences->General->Workspace->"Build Order". There nothing was set and "use default build order" was unchecked. I checked use default build order and now it works!

Am I the only one having this problem? I wonder if something has changed between two versions of eclipse and the "Build Order" setting did not migrate well and caused that problem.

Thursday, December 15, 2005

How to split eclipse plugins into features?

At the eclipse council meeting this week, we discussed pluging dependencies. There was some controversy on how to split features.

I think installable features should minimize external dependencies. If possible, put plugins that have no external dependencies (=depend only to the platform) into a feature. And put plugins with external dependencies into other features.

Some (bad) examples to illustrate the problem, of what happens if you create features that contain everything:

At the level of features EMF requires JDT. This means: although you can have a meaningful set of plugins (that is the EMF runtime) that do not require JDT, there is currently no way to properly install EMF without installing JDT (else you get some kind of errors in the error log).

The other bad example is the PDE error log: If you want to use the PDE error log, you have to install PDE and JDT. In practice, you can simply install org.eclipse.pde.runtime, and it works fine. However, if someone installs PDE in another extension location, eclipse will complain.

Therefore, installable features should allow you to use a "meaningful" set of plugins without pulling in the rest of the world...

Take-home message: When you create features ask yourself if there is a useful subset of plugins that has minimal external dependencies and create a feature for those. Others using these plugins will not be forced to install the rest.

Tuesday, December 06, 2005

eclipse news and findings 2005-12-05

Tuesday, November 01, 2005

HTMLSave saves files as HTML

htmlSave saves editor contents as HTML. It needs access to the text to extract the style information...

Tuesday, October 25, 2005

CDT: Mike Milinkovich starting talk


- eclipse fondation does not dictate what to do
- next june 9 projects will ship at the seame time next
year
- last 13 month committers doubled
- 3 * startegic membership
- cdt should become over-night sensation
- escape the java ghetto
- eclipse is not only about java
- eclipse ia about more language and platforms
- even microsoft regognizes eclipse: do you know how
expensive it is to use eclipse?
- eclipse commiters work for companies
- being predictable is very important
- eclipse wants to be predictable
- as apposed to GNU
- at appache it juts happens
- fundation wants to make the life of projects easy!
- commiters now live in silos
- Ward Cunningham will be the "free radical"
- break walls between projects
- about dev. process
- nurture committer culture
- we want people to feel proud to work for eclipse
- eclipse needs more successes
- cdt should become more successfull
- software takes time...
- php projects will be part of eclipse
- eclipse acts as a bridge to other OS
- linux
- mozilla as scalability
- big value of eclipse is how to embrace commercial
adoption

Q: have a session for managers about eclipse
A: business track at eclipsecon. There was also a panel.



Monday, October 17, 2005

Examples of eclipse RCP projects

A PDF document with screenshots of many RCP apps.

Ian Skerrett gives great insight into open source marketing

Ian Skerrett wrote a great article on open source marketing. He starts with: "Fire the marketers..."

Eclipse press release guidelines.

Eclipse press release guidelines. It explains, when a press release is triggered. Ian Skerrett, thinks fewer press releases is better....

Blog of Eclipse foundation members

Mike Milinkovich, Executive Director of the Eclipse Foundation..
Ian Skerrett, Director of Marketing with the Eclipse Foundation.
Bjorn Freeman-Benson, Technical Director, Open Source Process and Infrastructure for the Eclipse Foundation.

Eclipse liveliness map

Bjorn Freeman-Benson created an nice life page that shows lifeliness of eclipse projects.

Eclipse Map of committers

Ther's a nice world map of committers. You can see where how many committers are located.

Saturday, October 15, 2005

A wiki at eclipse.org: Eclipsepedia

eclipsepedia is online. Feedback and comments can be given in bug 87949. Unfortunately, you have to be an eclipse committer to contribute. So, it's not really a wikipedia.....

Thursday, October 13, 2005

Carbide: Nokias CDT based C++ tools for Symbian OS

Nokia announces new Eclipse-based IDE for Symbian OS called Carbide.c++ (or Carbide Mobile Studio). It seems to be CDT based.

The Symbian OS company announced they have joined the Eclipse Foundation as an add-in provider.

IBM contributes the "Eclipse Process Framework Project"

IBM announces the Eclipse Process Framework Project (Beacon). It focuses on best practices for software development. The goal is to provide tools to support the software development process (part of the Rational Unified Process).

Chris Recoskie adds macro support to CDT managed build

Chris announces that he is adding macro support to CDT. He created a bugzilla entry for discussion.

Wednesday, October 12, 2005

eclipse developres journal

Just stumbled over the Eclipse Developers Journal. A little bit too much advertizement for my taste, but interesting stories... Hmm, very american "The Leading Eclipse Magazine for the Open Community"... what about the nice German Eclipse Magazin???

Why freeing SWT resources follows "the fundamental rules of java"...

From time to time, I see complains like this:
"SWT controls cannot be garbage collected. If SWT were being used in C++ that wasn't a problem. But this design decision for a Java API/Framework is a terrible flaw....This is IBM which is not adhering to the most fundamental rules of Java."
I think, it is a terrible flaw to do resource cleanup using the garbage collector.

Sun uses a similar policy for resources allocated outside the garbage collector. For example in JDK 1.4.2 they changed the policy to free native resources. Originally channels were garbage collected. But now you have to explicitely close them. It was for performance reasons, but th problem is the same: external resources are not seen by the garbage collector, and therefore it cannot trigger a collection if the system runs out of resources.

Just think of a simple object that allocates a megabyte in a native call and holding it in a pointer. The pointer is freed in the finalize method of the object. 1000 of those objects are are nothing to the garbage collector, but it takes 1 GB of your system resources. The simple loop:
for(int i=0;i<5000;i++)
new My1MbObject();
Will not work on most systems, becuase you allocate 5000 "small" objects .....

I think that's a general good rule to close resources that are created outside the garbage collector explicitely.

Therefore it is a good thing, that SWT relys on explicit disposing of native resources.

Migration to flexible workspaces (EFS)

John Arthorne wrote a document that describes how clients can transition towards supporting these more flexible workspaces (see also my previous blog entry "Restrictions of the eclipse workspace concept")

Tuesday, October 11, 2005

A guide to the workbench internals -- how workbench works

Stefan Xenos explains how the Eclipse 3.1 workbench works. He describes the infrastructure that makes views and editors work. The goal is to make the reader familiar with important classes in the workbench, and how they interact. It is assumed that the reader is already familiar with using the workbench APIs and with creating views, editors, action sets, etc.

Content-type-based editor lookup

Explains the retionale behind Content-type-based editor lookup.

Here is a paper with the details.

To have project specific content matcher, 3.1 added IProject.getContentTypeMatcher()

Here is a document that describes the BinarySignatureDescriber (for binary content types) and XMLRootElementContentDescriber. They can be used in the org.eclipse.core.runtime.contentTypes extension point to define a content type.

Plan for 3.2 core debug

The overall themes for platform debug 3.2 are:
  • Scaling Up

  • Design for Extensibility: Be a Better Platform

  • Simple to Use

Breaking up of platforn for better OSGi separation

Jeff McAffer explains how will be split into more plugins to better support OSGI. This will be done without breaking existing code.

org.eclipse.osgi
org.eclipse.core.common - some common base support classes like IStatus, etc. We'll look to take into account the JFace uses here as well as other. This will NOT be a dumping ground.
org.eclipse.equinox.registry - the extension registry mechanism
org.eclipse.core.jobs - job support
org.eclipse.core.preferences - preferneces support
org.eclipse.core.contenttypes - content types
org.eclipse.core.runtime - the original runtime layer with things like Platform, Plugin, ...

It will require and reexport all of the above plugins. Make this optional if possible.

Restrictions of the eclipse workspace concept

There is an old paper nicely describing the problems and another with possible solutions (it also contains an analysis what other IDEs do).

Bugzilla entries:
- Allow editors to open files outside workspace
- Support logical model integration
- Problems with opening external files
- Allow a search to be done on external directories, outside of the workspace
- Rsource exclusion filters
The discussion about tne new eclipse virtual file system (EFS) in here: Provide more flexible workspaces. In 3.2 resources will probably be based on EFS.

Note: There might be problems with code that assumes IResource.getLocation().toFile() does not return null, if the resource is not a file!

Monday, October 10, 2005

Eclipse remote development (paper from 2002)

There are many environments where the primary tools reside only on a remote system distinct from the developer's workstation, called remote development.

This document explains how the Eclipse Platform can also be extended by plug-ins to support a remote development paradigm, and provides recommendations and guidelines for plug-in developers building remote development support.

Eclipse 3.1 statistics

- Java source files: 11,548
- Lines of Java source code: 2,425,709
- Lines of XML source code: 57,533

.. and more

Testing CDT with OpenOffice

Doug Schaefer is testing CDT with OpenOffice (35000 C/C++).
It's double the size of Mozilla.....

YourKit Java Profiler alternative to Optimize It

I'm not really happy with Optimize it. Here's another (commercial $500) profiler YourKit Java profiler. I should give it a try....

eRCP M4 with eSWT RC2 available!

eRCP is the embedded version of the eclipse rich client platform.

JUnit 4 will use java 1.5 annotations @Test

An early look at JUnit 4

Wayne Beaton is the new eclipse evangelist.

Wayne Beaton is the new eclipse evangelist. His job is to promote eclipse (talk at conferences etc). In an interview
he explins that many eclipse core developers come from smalltalk (like himself).

Eclipse and Java links