Sunday, June 13, 2010

New Features in Eclipse 3.6 (Helios)

There are many interesting features coming up in Eclipse 3.6 code named as Helios . Below, I will discuss about some of these features which I came across.

Java/Plugin Development:
  1. Reports missing @Override notation if a method overrides a superclass method and has the notation missing. This only works for 1.6 code. Previously, we only had warnings when we added @Override but did not override a superclass method, but now this works the other way also. This would be helpful in removing the possibility of accidentally overriding a method.
  2. Variables view now has a new column (accessible by Layout->Select Column) to display the instance count of the variable.
  3. Package names in Java views can be customized by setting rules in Preferences->Java->Appearance->Abbreviate package names preference. For example, org.eclipse.ui can be mapped to {UI} etc.,
  4. Users can see source of UI contributions using ALT +SHIFT +F3 in IDE. This is very similar to what PluginSpy used to provide, but now this functionality is provided by the platform. This also means that our Eclipse RCP application can expose this functionality to end users.
  5. -consoleLog program argument is now added to launch configuration of Eclipse applications by default. This argument prints errors in Console view that normally go to ErrorLog to console. This would be very useful to debug Eclipse RCP applications.
  6. Console view now has option to open as OSGi console. This console is useful for plugin developers and can be used to interact with OSGi framework.
  7. "Add Artifact to Target Platform" dialog allows users to search a set of repositories for dependencies and add them to target platform.
  8. Resolving dependencies (similar to above point) is also available via quick fix, when there is a missing imported package.
  9. It is now possible to export contents of target platform to destination directory. You can get to this wizard by doing File->Export->Plug-in development->Target definition.
TaskItem:
  1. Clients can now set an overlay image to Taskitem using TaskItem#setOverlayImage(Image).
  2. Clients can now set an overlay text to TaskItem using TaskItem#setOverlayText(String). Setting overlay image and text can be useful. For ex, this can be used to indicate the result of an operation which user kicked off in the application.
  3. Clients can now set the progress of an operation to TaskItem using TaskItem#setProgressState(int).
  4. Example for the above functionality can be seen in this snippet.
  5. Clients can now set the menu to application TaskItem using TaskItem#setMenu(Menu).
  6. Jobs progress can also be shown in Platform task bar. See this bug for more info on the API.
Eclipse Help :
  1. Help UI footer can be customized by using the preference org.eclipse.help.base/footer.
  2. Help topics can now by sorted using sort attribute in toc and topic elements.
  3. Table of contents and help contents editors now report XML errors.
  4. Table of contents and help contents editors has spell check functionality.
  5. New extension points introduced to allow addition of buttons and frames to Help UI.
  6. "See" entries can now be added to Help index. i.e when user searches for a word, the results would appear and along with it "See" entries can also be displayed to direct users to related topics.
Install Wizard:
  1. Install wizard is now grouped by license. This means we no longer have to select each item and accept the license.
  2. We can now do compare in installation history i.e we can select any two installations from history and compare them by clicking on the compare button.
Intro page:
  1. Intro page can now have news feeds from multiple RSS news readers using EclipseRSSViewer.
Local History:
  1. Users can now disable local history cleanup. This might help in faster shutdown since local history cleanup need not be done, but local history size would keep growing indefinitely.
Release Schedule:
  1. All 7 milestone releases and release candidates are done.
  2. Final release expected on June 23rd.
The features mentioned here are just a small subset of the features coming up in new release. I just mentioned few which I came across and was of interest of me. This post gives detailed notes on what is added in each of the milestone releases.

Saturday, June 12, 2010

Changing Eclipse RCP application workspace

We are developing an Eclipse RCP application and we wanted the default location of workspace to be under user's home directory and not under current directory (which is the default). By googling, I found that I can use -data program argument. But, when I put that option in .ini file it did not work. Some posts said that I should put the path argument after data in double quotes for it to work. But, that is not true either.

Finally, it turned out that I should specify the path in the next line after -data. Specifying the path in next line is the key here. So, in your application .ini file, it should look like:

-data
C:\MyAppWorkspace

Also, make sure that this (or any other program argument) appear before vm arguments.

But, we did not want to hardcode the path and instead wanted to point it to users home directory. For this, you could use:

-data
@user.home/MyAppWorkspace

This program argument can also be supplied as command line parameter. For example, eclipse.exe -data @user.home/MyAppWorkspace would work. Also, this could be supplied in the shortcut target in windows, if the application needs to be launched using double click.

In your RCP application, you can just specify these program arguments in "Launching" tab in your application .product editor. When you export your product, it will put the appropriate entry in your application .ini file.