blob: 54a8abc3fb3f8561df4aadbc7b5cd3c00e5dd1aa [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" title="main" media="screen" />
<title>Eclipse Project Neon (4.6) M6 News</title>
</head>
<body>
<h1>Eclipse Project Neon (4.6) M6 - New and Noteworthy</h1>
<p>Here are some of the more noteworthy things available in the Neon milestone build M6
which is now available for <a href="http://download.eclipse.org/eclipse/downloads/#4.6_Stable_Build" target="_top">download</a>.
<br/>
We also recommend to read the Tips and Tricks, either via <b>Help &gt; Tips and Tricks...</b> or online for
<a href="http://help.eclipse.org/topic/org.eclipse.platform.doc.user/tips/platform_tips.html">Platform</a>,
<a href="http://help.eclipse.org/topic/org.eclipse.jdt.doc.user/tips/jdt_tips.html">JDT</a>, and
<a href="http://help.eclipse.org/topic/org.eclipse.pde.doc.user/tips/pde_tips.htm">PDE</a>.
</p>
<ul>
<li><a href="#Platform">Platform</a></li>
<li><a href="#JDT">JDT</a></li>
<li><a href="#PDE">PDE</a></li>
<li><a href="#Platform-Dev">Platform Developers</a></li>
</ul>
<table class="news">
<colgroup>
<col class="title" />
<col />
</colgroup>
<tr>
<td colspan="2" class="section" id="Platform">Platform</td>
</tr>
<tr id="swt-autoscale">
<td class="title">SWT provides resolution-based auto-scaling</td>
<td class="content">
SWT now automatically scales images on high-DPI monitors on Windows and Linux, similar to the Mac's Retina support on OS X.
In the absence of high-resolution images, SWT will auto-scale the available images to ensure that SWT-based applications like Eclipse
are scaled proportionately to the resolution of the monitor.
<p>
<img src="images/swt-high-dpi.png" alt="Screenshot with tiny icons 'Before' and a normal appearance 'After'" />
</p>
<p>
This feature can be disabled on Windows and GTK by setting this VM argument to <code>false</code>
in eclipse.ini or on the command line after <code>-vmargs</code>:
</p>
<p>
<b>-Dswt.enable.autoScale=false</b>
</p>
<p>
Auto-scaling cannot be disabled on the Mac as it is provided by the OS.
</p>
<p>
Caveats: We're aware that some scaled images look bad at scale factors less than 200%. This will be improved in M7.
Furthermore, we're working on support for high-DPI images in Platform UI, so that plug-in providers
can add high-DPI icons without doing any code changes.
</p>
</td>
</tr>
<tr id="solstice-welcome-theme">
<td class="title">New Welcome theme 'Solstice'</td>
<td class="content">
The Welcome/Intro introduces a new <em>Solstice</em> theme
providing a new modern appearance. The Welcome also
introduces a new quadrant-based root page, <tt>qroot</tt>,
which supports a new command-driven section defined through
the <tt>org.eclipse.ui.intro.quicklinks</tt> extension point.
These <em>quicklinks</em> are intended to be populated by
product owners.
<p>
<img src="images/eclipse-welcome-solstice.png" alt="" />
</p>
</td>
</tr>
<tr id="welcome-launchbar">
<td class="title">Welcome Launchbar restored</td>
<td class="content">
In Eclipse 3.x, the <b>Go to Workbench</b> button
on the Welcome page would minimize the Welcome page to the window
status bar. This behavior has been restored for Eclipse 4.6.
<p>
<img src="images/eclipse-welcome-launchbar.png" alt="" />
</p>
</td>
</tr>
<tr id="word-selection-default-value">
<td class="title">'word_selection' and 'line_selection' template variable with default values</td>
<td class="content">
The 'word_selection' and 'line_selection' variables, supported in editor and code templates, now allow you to specify a default value to use if the current text selection is empty.
</td>
</tr>
<tr>
<td colspan="2" class="section" id="JDT">JDT</td>
</tr>
<tr id="open-from-clipboard-shortcut">
<td class="title">Ctrl+Shift+V invokes Open from Clipboard</td>
<td class="content">
<b>Ctrl+Shift+V</b> has been assigned to invoke
<b><a href="http://archive.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/eclipse-news-part2.html#JavaEditor">Open from Clipboard</a></b>.
<p>
On GTK+ this key binding was previously assigned to the <b>Display</b> command as a workaround for <b>Ctrl+Shift+D</b> not working.
</p>
</td>
</tr>
<tr id="remove-redundant-type-arguments">
<td class="title">Clean Up to remove redundant type arguments</td>
<td class="content">
A new option to remove redundant type arguments has been added under the "Unnecessary Code" group of the Clean Up profile.
<p>
<img src="images/remove-redundant-type-arguments.png" alt="" />
</p>
</td>
</tr>
<tr id="null-analysis-generics">
<td class="title">Improved null analysis with generics</td>
<td class="content">
The interplay of null annotations and generics has been improved in several regards.
<p>
The basic concepts had already been documented in the
<a href="http://help.eclipse.org/topic/org.eclipse.jdt.doc.user/tasks/task-using_null_type_annotations.htm%3Fcp=1_3_9_1_0%23generics">online help</a>,
but not all that was documented was actually checked by JDT's null analysis. With the changes outlined below,
null analysis based on type annotations is even more capable than previous versions.
</p>
<p id="null-analysis-generics-1"><b>(1)</b> The <b>first batch of contributed improvements</b> implements what we call "pessimistic analysis for free type variables",
which affects <em>implementors</em> of generic types.
</p>
<p><a href="images/MyGenericImpl.java.txt"><img src="images/pessimistic-analysis.png" alt=""/></a></p>
<p>In order to allow clients to instantiate such a generic class with either a <code>@NonNull</code> or a <code>@Nullable</code> type
as substitution for the "free type variable" <code>&lt;T></code>, the implementation of that class must account for the worst in both directions:
</p>
<ul>
<li>To anticipate a <code>@NonNull</code> type, each field typed to a free type variable must be initialized with a non-null value, and
passing <code>null</code> where <code>T</code> is expected is illegal</li>
<li>To anticipate a <code>@Nullable</code> type, each dereference must be preceded by a null check.</li>
</ul>
<p>
At the bottom of each problem hover, you will find a link to the corresponding configuration option,
should you like to change the severity of this diagnostic. Note that configurability is mainly
given for smooth migration from previous JDT version; conceptually, problems detected by pessimistic
analysis should be treated as errors, because they invalidate the null-guarantees given by a generic type.
</p>
<img src="images/configure-pessimistic-analysis.png" alt="configuration options for new diagnostics"/>
<p id="null-analysis-generics-2"><b>(2)</b> The <b>second improvement</b> concerns <em>consumption</em> of generic types from a library, more specifically:
invocations of library methods whose return type is given by a free type variable.<br/>
If the library type is instantiated with a <code>@NonNull</code> type as the type argument,
we generally want to interpret the mentioned return type as non-null, too.
This is problematic only for some "legacy" methods, which may return <code>null</code> without declaring so.
The most prominent example is <code>java.util.Map.get(K)</code> (see also the news entry on
<a href="https://www.eclipse.org/eclipse/news/4.5/jdt.php#external-annotations">external annotations</a>,
which also demonstrates the clean solution to this issue).
</p>
<p>The analysis cannot see whether absence of a null annotation for such a return type is intentional
(in the above sense of "free type variables"), or an omission that should be fixed.
For that reason a new warning has been implemented to alert about this situation.
</p>
<a href="images/Client.java.txt"><img src="images/unsafe-nonnull-interpretation.png" alt=""/></a>
<p>In the above example, both fields <code>list</code> and <code>map</code> provide <code>@NonNull String</code> as a
type argument, hence the return types of both <code>get</code> methods are interpreted as non-null.
For <code>List</code> this is desired, for <code>Map</code> it is a bug.
</p>
<p>The dilemma can be resolved by adding a (possibly empty) external annotation file (<code>.eea</code>)
to each affected library class. By using an empty annotation file, the user signals that all types
in this class should be interpreted verbatim (like in the <code>List</code> case - use with care).
In the other case, the missing <code>@Nullable</code> annotation should be added as an external annotation
(like in the <code>Map</code> case).
</p>
<p>In a project that is not yet configured to use external annotations for the library in question,
the warning is demoted to level "information". Generally, the severity of this problem is configured
using the option right below the one mentioned above, titled <b>Unsafe '@NonNull' interpretation
of free type variable from library</b>.</p>
<p id="null-analysis-generics-3"><b>(3)</b> <b>Finally</b>, a small utility class, <code>org.eclipse.jdt.annotation.Checks</code>,
has been included in the bundle <code>org.eclipse.jdt.annotation_2.1.0</code>
containing helper methods for typical idioms for improving and documenting null safety.</p>
</td>
</tr>
<tr id="formatter">
<td class="title">New options in code formatter</td>
<td class="content">
A few new options have been added in the formatter profile editor.
<p><b>(1)</b> In the <b>Line Wrapping</b> section, you can control the wrapping policy of <b>'for' loop headers</b>.</p>
<p><img src="images/formatter-wrap-for.png" alt="" /></p>
<p><b>(2)</b> The <b>Align fields in columns</b> feature in the <b>Indentation</b> section can now be configured to
<b>recognize groups separated by empty lines</b> and align them independently.</p>
<p><img src="images/formatter-align-groups.png" alt="" /></p>
<p><b>(3)</b> In the <b>New lines</b> section, you can control if new lines should be
added <b>after annotations on enum constants</b>.</p>
<p><img src="images/formatter-enum-constants.png" alt="" /></p>
</td>
</tr>
<tr>
<td colspan="2" class="section" id="PDE">PDE</td>
</tr>
<tr id="ds-annotations">
<td class="title">Support for OSGi Declarative Services Annotations</td>
<td class="content">
OSGi Declarative Services provide a powerful mechanism for developing complex, service-oriented
applications. With proper tooling, annotations, which were added to Declarative Services
in version 1.2, make it easy to generate and maintain the required component descriptor files.
<p>
When enabled, PDE automatically generates and updates Declarative Services component
descriptor files from appropriately annotated Java source. This is done without requiring
any additional builder to be configured in your project.
</p>
<p>
When you annotate your component implementation classes with <code>@Component</code>, and any
reference bind methods with <code>@Reference</code>, PDE will validate your annotations
and generate the corresponding component descriptor files. Any errors discovered during validation
are highlighted and reported.
</p>
<p>
<img src="images/ds-annotations.png" alt="" />
</p>
<p>
In addition, PDE will also maintain the project's MANIFEST.MF and build.properties file
-- generated component descriptor files are automatically added to the manifest
and included in the build.
</p>
<p>
To enable this feature, go to <b>Preferences</b> or <b>Project Properties &gt; Plug-in Development &gt; DS Annotations</b>
and check <b>Generate descriptors from annotated sources</b>.
</p>
</td>
</tr>
<tr id="ds-annotations-template">
<td class="title">Updated OSGi Declarative Services Example</td>
<td class="content">
The OSGi Declarative Services Example now uses annotations.
<p>
Instead of creating a Component Definition file for each component class and adding it
to the manifest and build.properties, the wizard creates component classes annotated with
the appropriate DS annotations, which are then used by PDE to automatically generate
the corresponding component descriptor files.
</p>
</td>
</tr>
<tr id="pde-image-browser-pagination">
<td class="title">Pagination control in Plug-in Image Browser</td>
<td class="content">
In the <b>Plug-in Image Browser</b>, at the end of the view, there are pagination controls
to move to the next page of images.
<p>
<img src="images/pde-plugin-image-browser-pagination.png" alt="" />
</p>
</td>
</tr>
<tr id="pde-debug-option-help">
<td class="title">Tooltips for options in Tracing dialog </td>
<td class="content">
In the <b>Tracing </b> tab of Eclipse launch configuration, the options now have tooltips which display
more information about that option.
<p>
<img src="images/pde-tracing-options-help.png" alt="" />
</p>
The information gets extracted from comments in the declaring bundle's .options file.
</td>
</tr>
<tr>
<td colspan="2" class="section" id="Platform-Dev">Platform Developers</td>
</tr>
<tr id="high-dpi-api">
<td class="title">APIs for high-DPI monitor support</td>
<td class="content">
Platform-independent high-DPI support has been added to the Win32 and GTK ports.
In the past, only the font size was adjusted on those two platforms, which lead to an inconsistent
appearance of SWT applications across different platforms.
<p>
To shield existing clients from resolution differences, SWT now uses the Cocoa model on all three platforms.
Existing SWT APIs keep using the well-known coordinate system in SWT points. In high-DPI environments,
these SWT points are transparently scaled to native pixels.
</p><p>
To create DPI-aware <code>org.eclipse.swt.graphics.Image</code>s, use these constructors
that have already been provided in the <a href="https://www.eclipse.org/eclipse/news/4.5/M6/#high-dpi">Mars release</a>:
</p>
<ul>
<li><code>Image(Device, ImageFileNameProvider)</code></li>
<li><code>Image(Device, ImageDataProvider)</code></li>
</ul>
Two new APIs have been added in <code>Image</code> to give you direct access to the pixel data on high-DPI monitors.
<ul>
<li><code>Image#getImageDataAtCurrentZoom()</code>:
Returns an <code>ImageData</code> that contains the full-resolution pixel data at the current OS zoom level</li>
<li><code>Image#getBoundsInPixels()</code>:
Returns the image dimensions in pixels at the current OS zoom level</li>
</ul>
</td>
</tr>
<tr id="swt-requires-java7">
<td class="title">SWT requires 1.7 Java runtime</td>
<td class="content">
The SWT projects are now compiled at 1.7 compliance level. As a result, a Java runtime of
1.7 or above is required to run SWT applications.
</td>
</tr>
<tr id="link-api">
<td class="title">API to set Link color</td>
<td class="content">
A new API <code>org.eclipse.swt.widgets.Link#setLinkForeground(Color)</code> has been added
that allows you to set the
foreground color of the hyperlink text in a Link widget.
<p>
The corresponding getter <code>Link#getLinkForeground()</code> has been added which returns
the foreground color of the hyperlink text in the Link widget.
</p>
<p>
For an example, see <a href="http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet182.java">Snippet182</a>.
</p>
</td>
</tr>
<tr id="javax-annotation-package-dependency">
<td class="title">Imports of the <code>javax.annotation</code> package no longer require a minimum version</td>
<td class="content">
Plug-ins are no longer required to specify a minimum package version when importing the <code>javax.annotation</code> package.
The Eclipse runtime will resolve all components to the same version (JVM or provided by the Eclipse Platform).
<p>
This avoids a common error in Eclipse RCP implementations in which <code>@PostConstruct</code>
was resolved to different classes in the bundle classpath.
This change is backwards compatible, i.e., a dependency with a minimum version still works correctly.
</p>
</td>
</tr>
<tr id="create-method-computed-value">
<td class="title">New factory method for data binding's ComputedValue</td>
<td class="content">
An <code>org.eclipse.core.databinding.observable.value.ComputedValue</code> can compute custom values from other tracked getters inside its <code>calculate</code> method.
<p>Before this change, you had to create a subclass of <code>ComputedValue</code>, but the new <code>create</code> method, which expects a <code>Supplier&lt;T&gt;</code>
allows you to create an instance of <code>ComputedValue</code> by using a lambda expression.</p>
<p>Examples:
</p>
<pre>IObservableValue&lt;Integer&gt; listSizeObservable =
ComputedValue.create(() -> observableList.size());</pre>
or
<pre>IObservableValue&lt;String&gt; fullNameObservable =
ComputedValue.create(() -> personFirstNameObservable.getValue() + " "
+ personLastNameObservable.getValue());</pre>
<p>
More details about tracked getters can be found in the <code>org.eclipse.core.databinding.observable.ObservableTracker</code>'s
<code>getterCalled(IObservable)</code> method. Almost every <code>IObservable</code>'s get methods are tracked getters.
</p>
</td>
</tr>
<tr id="mpart-runtime-closeable-change">
<td class="title">Change closeable attribute of MPart at runtime</td>
<td class="content">
Calling the <code>setCloseable</code> method on an <code>org.eclipse.e4.ui.model.application.ui.basic.MPart</code> instance will
now change the visibility of the close button for the corresponding part.
<p>
<img src="images/mpart-closeable.png" alt="" />
</p>
</td>
</tr>
<tr id="e4-app-shutdown-started">
<td class="title">Shutdown started event for Eclipse 4 RCP applications</td>
<td class="content">
When Eclipse 4 RCP applications are about to shut down, the
<code>org.eclipse.e4.ui.workbench.UIEvents.UILifeCycle.APP_SHUTDOWN_STARTED</code> event will be fired now.
Previously, this only worked for Eclipse RCP applications running in the compatibility mode,
and in mixed mode applications which use both Eclipse 3 and 4 APIs.
</td>
</tr>
<tr>
<td colspan="2"/>
</tr>
</table>
<p>The above features are just the ones that are new since the previous milestone
build. Summaries for earlier Neon milestone builds:</p>
<ul>
<li><a href="https://www.eclipse.org/eclipse/news/4.6/M5/">News for Eclipse Neon milestone build M5</a></li>
<li><a href="https://www.eclipse.org/eclipse/news/4.6/M4/">News for Eclipse Neon milestone build M4</a></li>
<li><a href="https://www.eclipse.org/eclipse/news/4.6/M3/">News for Eclipse Neon milestone build M3</a></li>
<li><a href="https://www.eclipse.org/eclipse/news/4.6/M2/">News for Eclipse Neon milestone build M2</a></li>
<li><a href="https://www.eclipse.org/eclipse/news/4.6/M1/">News for Eclipse Neon milestone build M1</a></li>
</ul>
</body>
</html>