Eclipse Project 4.5 M6 - New and Noteworthy

Here are some of the more noteworthy things available in the Mars milestone build M6 (2015-03-20) which is now available for download.
We also recommend to read the Tips and Tricks, either via Help > Tips and Tricks... or online for Platform, JDT, and PDE.

Platform
Mac OS X distribution now an Application Bundle For Mars M6, the Eclipse SDK for OS X is now distributed in a more standard "Mac App" format, instead of the "directory format" we have used in the past. See bug 431116 for background, current status, and pointers to remaining work planned.

CAUTION: Current Mac users can not use "update" to Mars M6. In fact, for M6, doing so will break your installation! You need to start with a fresh download.

In the event that you updated before reading this, and have ended up with a broken installation, see Issues related to Mac App installations for the steps to recover your installation, after getting a fresh download.

Default max heap size increased to 1024 MB To improve the "out of the box" user experience on today's modern hardware, the default maximum heap size (-Xmx VM argument) has been increased from 512M to 1024M. And the initial heap size (-Xms) has been increased from 40M to 256M.
Close Tabs to the Left/Right The context menu of editor and view tabs now offer Close Tabs to the Left and Close Tabs to the Right menu.

"Visible tabs shown on overflow" behavior decoupled from appearance theme In Eclipse 4.2, the non-"Classic" themes introduced a new strategy to select the editor tabs shown when there's not enough screen space to show all tabs. The new strategy shows a sliding window of tabs in their original opening sequence, cutting off tabs at the beginning and/or end of the full sequence.

In classic versions of Eclipse (before 4.2, and later with a "Classic" theme), the strategy was to show the most recently used tabs (MRU), i.e. the "working set" of tabs you're currently using.

The coupling of behavior with styling (themes) was found to be problematic, and the tab visibility has has been turned into a separate preference. See Preferences > General > Appearance > Show most recently used tabs.

By default, the option is disabled. Users of a "Classic" theme need to enable it manually to keep the behavior they're used to.

Plugin developers and Eclipse product owners can change via preferences whether the CSS theme or a user preference should control this option, and whether MRU should be enabled by default. The preferences are for the "org.eclipse.e4.ui.workbench.renderers.swt" plug-in, and the keys are:

  • "MRUControlledByCSS" (default is "false"),
  • "enableMRUDefault" (default is "false"),
  • "enableMRU" (default is "false").
New API: AbstractSelectionDialog org.eclipse.jface.dialogs.AbstractSelectionDialog is an enhanced version of the existing org.eclipse.ui.dialogs.SelectionDialog. It has been added to the org.eclipse.jface bundle, where it is also available for Eclipse 4 RCP applications.

The AbstractSelectionDialog API supports generics and varargs.

CSS support for new COLOR-TRANSPARENT constant The CSS engine now supports the COLOR-TRANSPARENT property. The implementation uses SWT's new SWT#COLOR_TRANSPARENT pseudo-color. COLOR-TRANSPARENT allowed to simplify the dark theme significantly.
APIs for high-DPI monitor support New APIs have been added to provide support for rendering high-resolution images on high-DPI monitors.

Two constructors have been added to the Image class. They accept image-provider callbacks that allow clients to supply resolution-dependent versions of images:

public interface ImageDataProvider {
	public ImageData getImageData (int zoom);
}
public interface ImageFileNameProvider {
	public String getImagePath (int zoom);
}

Depending on the user's monitor configuration, SWT will request images with the corresponding zoom level. Here's an example that displays 3 original images, followed by variants whose resolution changes depending your monitor's resolution: Snippet367.java.

Note that this is just the first step to support high-resolution images in SWT and Eclipse-based applications. Work is underway to adopt the new APIs in the platform. Furthermore, more work in SWT is required to properly support drawing into high-resolution images via GC.

API to choose security context in Browser#evaluate() A new API Browser#evaluate(String script, boolean trusted) has been added that allows the client to run Javascript code in the Chrome security context or in the normal security context for SWT.MOZILLA style browsers.
JDT
Shortcut for Skip All Breakpoints Ctrl+Alt+B has been added as the shortcut for Skip All Breakpoints.

ECJ requires 1.7 Java runtime JDT Core projects are now compiled at 1.7 compliance level. As a result, a Java Runtime of 1.7 or above is required to run the Eclipse compiler.
External annotations Annotation-based null analysis can now leverage externally defined annotations that are attached to a library.

Previously, annotation-based null analysis was significantly limited by the fact that many 3rd party libraries have no null annotations in their API. This implied that any errors caused at this interface could not be detected by the analysis, and even worse, implementors of library-defined interfaces could not use any intended contracts, because any null annotations in overriding methods were flagged as incompatible with the super version.

JDT now supports the concept of "external annotations". A user can specify null annotations in separate files and attach these to a given library. The compiler will take external null annotations into consideration for its null analysis.

Configuration:

Preferences > Java > Installed JREs > Edit

External annotations can be provided as a directory tree of individual text files or as a zip file. External annotations can be attached to a JRE (per workspace) and to arbitrary libraries (per project).

  • See below for creating external annotations using the new command Annotate
  • See the wiki for the full story.
Annotate command A new command Annotate is provided when browsing attached source code of a library using the class file editor.

Two pre-requisites must be met for using this command:

  • The project is configured to use annotation-based null analysis.
  • An existing workspace folder has been specified as the external annotation location for a given library.

Users may select any type in the signature of a library method or field, and invoke Annotate - either using the context menu, or by pressing Ctrl+1. Proposals will be offered for marking the selected type as @NonNull or @Nullable. All method parameters, return types and field types can be annotated. Additionally when Java 8 is used, details like type arguments and type bounds etc. can be annotated.

After selecting a proposal, the compiler will immediately leverage the new annotation for its null analysis.

Equinox
IAdaptable#getAdapter(Class) generified The org.eclipse.core.runtime.IAdaptable interface has been enhanced to return the requested type from its getAdapter method:
public <T> T getAdapter(Class <T> adapter);

Implementations of this method should also be updated. This has already been done for some platform APIs like org.eclipse.ui.part.WorkbenchPart. Callers and implementers of these APIs can see compile errors or warnings due to this binary-compatible change.

For more information, see bug 442021.

The above features are just the ones that are new since the previous milestone build. Summaries for earlier Mars milestone builds: