Monday, May 23, 2011

Contributing new preference types in the Eclipse export preferences page

Someone asked me today how he could extend the "Export Preferences" page in Eclipse and add an option to export his own kind of preferences other than whats given in the default. He didn't know the name of the extension, and neither did I at the top of my head. This is what the export preferences page looks like:
This can be opened by right clicking on a project in Package Explorer > Export > Preferences.

I did some digging around to find out how the Java Development Tools (JDT) project contributes the Java Preference options here. And I found that the extension point "org.eclipse.ui.preferenceTransfer" is actually the one that we need to extend in order to define new preference kinds to export. The following snippet is taken from org.eclipse.jdt.ui project's plugin.xml file:


So if you have new preference kinds you want to export, this is the way to go. You can also peek into JDT/UI's plugin file to explore further.

Friday, May 20, 2011

What's new in Java 7

In the recently concluded Eclipse Day India 2011 , I gave a talk on the new features of Java 7.





There were many questions and people generally seemed interested in the stuff. I mostly talked about the following features:

1. Project Coin:
  • Switch on Strings
  • Binary literals and underscores in numeral literals.
  • Improved type inference for generic instance creation - Diamond.
  • Multi - catch and more precise rethrow.
  • Try with resources.
  • @SafeVarargs
2. Support for dynamic languages

Other things also part of java 7 are:

3. Unicode 6.0 character set

4. New I/O and concurrent APIs

Eclipse Java 7 support

IF you're wondering what's going on with Java 7 work at Eclipse, here are some insights:

1. Eclipse 3.7(Indigo release) will not be shipped with Java 7 support. This is not because we folks at JDT are lazy and didn't want to do the whole work by the time 3.7 is wrapped up (Well, it might be true sometimes, but then we have tough taskmasters as well!!). This is mostly because the official release of Java 7 is scheduled on July 28, 2011, and we'd have already wrapped up 3.7 before that. The delay, in part, has also been caused due to the late availability of JSR-292 (Invoke Dynamic) and JSR-334 (Project Coin).

2. Eclipse folks are busy working overtime to make sure that Java 7 support is in place by the time we ship Eclipse 3.7.1. As per bug bug 288548- "The work for the Java 7 features is currently in progress in the 'BETA_JAVA7' branch and we will deliver separate updates for the stable builds in order to provide early access to the Java 7 features for interested parties."

3. Much of the compiler support is already in place, and some work needs to be done on the UI portion. To check the progress on BETA_JAVA7 branch, you can read through JDT Core java 7 wiki page. 

4. If you want to test Eclipse's java 7 support, or want to use Eclipse to try out the new java 7 stuff, you can follow the instructions given in the "What to do to set up the IDE" section of the JDT Core java 7 wiki page. We plan to have downloadable builds soon. You can see the list of open bugs against JDT/Core Java 7 support at any point in time here. To report new bugs, make sure you use the [1.7] tag.

Hope this helps!