| <!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 Oxygen (4.7) M6 News</title> |
| </head> |
| <body> |
| <h1>Eclipse Project Oxygen (4.7) M6 - New and Noteworthy</h1> |
| <p>Here are some of the more noteworthy things available in the Oxygen milestone build M6 |
| which is now available for <a href="http://download.eclipse.org/eclipse/downloads/#4.7_Stable_Builds" target="_top">download</a>. |
| <br/> |
| We also recommend to read the Tips and Tricks, either via <b>Help > 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> |
| <li><a href="#Equinox">Equinox</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="patch-diff-generic-editor-extension"> |
| <td class="title">Generic editor can now read patch and diff files</td> |
| <td class="content"> |
| An extension was provided to the generic editor so that it now can provide syntax highlighting for files with the <b>.patch</b> |
| or <b>.diff</b> extension. Right-click the file and choose <b>Open with > Generic Text Editor</b> to see the editor in action. |
| <p> |
| <img src="images/patch-diff-editor.png" alt="" /> |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="improved-exit-and-restart-dialog"> |
| <td class="title">Improved exit and restart dialogs</td> |
| <td class="content"> |
| The exit and restart dialogs now use verbs instead of OK/No/Yes, which makes the dialogs more direct and specific. |
| <p> |
| <img src="images/confirm-exit-dialog-small.png" alt="" /> |
| </p> |
| <p> |
| <img src="images/p2-restart-dialog-small.png" alt="" /> |
| </p> |
| </td> |
| </tr> |
| |
| |
| <tr> |
| <td colspan="2" class="section" id="JDT">JDT</td> |
| </tr> |
| |
| <tr id="hidpi-jdt-icons"> |
| <td class="title">HiDPI JDT icons</td> |
| <td class="content"> |
| Composite icons such as Java element icons with modifier overlays are now rendered in high resolution |
| in environments that support HiDPI images. |
| <p> |
| <img src="images/jdt-composite-images-hidpi.png" alt="" width="479" |
| style="image-rendering:-moz-crisp-edges;image-rendering:-o-crisp-edges;image-rendering:crisp-edges;"/> |
| </p> |
| <p><b>Update:</b> On <b>macOS</b>, a <a href="https://bugs.eclipse.org/513637">bug</a> was found when |
| running with a non-Retina display as main screen and a <b>Retina display as secondary screen</b>. |
| If you're affected, please update the Eclipse SDK to a recent I-build (such as I20170318-2000) from<br/> |
| <a href="http://download.eclipse.org/eclipse/updates/4.7-I-builds/">http://download.eclipse.org/eclipse/updates/4.7-I-builds/</a> |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="unlikely-argument-types"> |
| <td class="title">Warnings for unlikely argument types</td> |
| <td class="content"> |
| Many developers have learned the hard way, that certain uses of Java collections that pass the compiler's |
| type check, may still contain "type errors", resulting in unexpected runtime behaviour. |
| A new analysis has been added to the Eclipse compiler for Java that will detect the most common bugs in this area. |
| <p> |
| The common reason behind this problem is the fact that not all methods of those collection types make use of generics in the way one might expect. |
| As a result it is possible to create a <code>Set<Short></code>, whose <code>add(Short)</code> method will only accept arguments of type <code>Short</code>, |
| yet method <code>remove(Object)</code> will happily accept literally any argument, because the method's parameter has type <code>Object</code>. |
| </p> |
| <p> |
| Here is a code snippet that seems to add and remove the same element from the set, but at a closer look the <code>remove</code> call has no effect. |
| What is difficult to see for the naked eye is now flagged by a new warning: |
| </p> |
| <p> |
| <a href="images/unlikely1.txt"><img src="images/unlikely1-basic.png" alt="Warning on last line: Unlikely argument type int for remove(Object) on a Collection<Short>" /></a> |
| </p> |
| <p> |
| In a simple world, this would be all there is to say, but over time people have developed various code patterns |
| that rely on these overly general signatures. Consider the following use of subtyping: |
| </p> |
| <p> |
| <a href="images/unlikely2.txt"><img src="images/unlikely2-number-allowed.png" alt="" /></a> |
| </p> |
| <p> |
| Depending on your coding style this may or may not be accepted as a legitimate short hand for: |
| <br/><code style="margin-left:2em;">if (n instanceof Short) set.remove((Short) n);</code><br/> |
| To reduce the churn caused by the new analysis, we developed some heuristics that filter out cases where types are "sufficiently similar", |
| so the above goes unwarned. |
| </p> |
| <p> |
| As with any heuristic, there is no clear line. This implies that the compiler may show "unwanted" warnings, |
| or filter out invocations that are in fact bugs. For the former case, <code>@SuppressWarnings("unlikely-arg-type")</code> |
| will document the exception both for the user and for the compiler. For the latter case, we provide an option to tighten |
| the rules, namely to apply strict type compatibility checks instead of said heuristics. For this extra scrutiny you may enable |
| the sub-option <b>Perform strict analysis against the expected type</b> in <b>Preferences > Java > Compiler > Errors/Warnings > Potential programming problems</b>. |
| </p> |
| <p> |
| <img src="images/unlikely3-options.png" alt="Preference options" /> |
| </p> |
| <!-- |
| With this option enabled, above usage is flagged indeed (and the same for less obvious cases, which would be filtered out by the heuristics): |
| <p> |
| <a href="images/unlikely4.txt"><img src="images/unlikely4-number-strict.png" alt="" /></a> |
| </p> |
| --> |
| Similarly, a check with default severity "Info" is offered for unlikely invocations of <code>java.lang.Object.equals(Object)</code> and |
| <code>java.util.Objects.equals(Object,Object)</code>. |
| <p> |
| <a href="images/unlikely5.txt"><img src="images/unlikely5-equals.png" alt="Info on last line: Unlikely argument type for equals(): Name seems to be unrelated to String" /></a> |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="watchpoint-condition"> |
| <td class="title">Conditional watchpoint</td> |
| <td class="content"> |
| Like for line breakpoints, conditions can now also be added to <b>Watchpoints</b>, |
| where the old value of the field can be used as part of the condition. |
| <p> |
| <img src="images/watchpoint-condition.png" alt="" /> |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="formatter"> |
| <td class="title">Code formatter: new way to count comment width</td> |
| <td class="content"> |
| A new option has been added in the code formatter profile editor that makes the formatter |
| <b>count a comment's width from its starting position</b> instead of the beginning of the line. |
| This allows more space for comments in heavily indented blocks of code and for line comments |
| added to the right of some code, but at the same time keeps comments that start at the beginning |
| of the line from getting too wide and uncomfortable to read. |
| <p>You can change this setting in the <b>Comments</b> section, under the <b>Line width</b> group:</p> |
| <p><img src="images/formatter-comment-width-ui.png" alt="" /></p> |
| <p><a href="images/formatter-comment-width-preview.txt"><img src="images/formatter-comment-width-preview.png" alt="" /></a></p> |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2" class="section" id="PDE">PDE</td> |
| </tr> |
| |
| <tr id="p2-inf-editor"> |
| <td class="title">p2.inf files open in Properties editor</td> |
| <td class="content"> |
| The default editor associated with <code>p2.inf</code> files is now the <b>Properties File Editor</b>. |
| </td> |
| </tr> |
| |
| <tr id="quickfix-also-adds-import-statement"> |
| <td class="title"> Quick Fix to add bundle or package adds import statement</td> |
| <td class="content"> |
| The <b>Quick Fix</b> that adds an <code>Import-Package</code> or <code>Require-Bundle</code> dependency |
| in the <code>MANIFEST.MF</code> now also adds the relevant import statement for the unresolved type in the Java editor. |
| </td> |
| </tr> |
| |
| <tr id="option-for-field-addition-to-annotation"> |
| <td class="title">API Tools: option for field addition to an annotation</td> |
| <td class="content"> |
| On the <b>Plug-in Development > API Errors/Warnings</b> preference page in the <b>API Compatibility</b> tab, |
| there is a new option in the <b>Annotation</b> section to control the severity of a "field addition to annotation". |
| <p> |
| <img src="images/pde-field-addition-to-annotation.png" alt=""/> |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="ds-annotations"> |
| <td class="title">Declarative Services Annotations v1.3</td> |
| <td class="content"> |
| Version 1.3 of OSGi Declarative Services delivers a number of improvements, including |
| Component Property Types for strongly-typed configuration parameter handling, |
| Field Strategy for dependency injection, service/reference scoping, and others. |
| <p> |
| PDE now supports the enhanced annotations and new usage options. It generates component |
| properties from any Component Property Types that you may use in your component lifecycle |
| methods. It also creates reference entries from <code>@Reference</code> annotations |
| specified directly in <code>@Component</code> as well as annotated member fields. New |
| reference event method signatures are also supported. |
| </p> |
| <p> |
| <img src="images/ds-annotations.png" alt="" /> |
| </p> |
| <p> |
| To enable this feature, go to <b>Preferences</b> or <b>Project Properties > Plug-in Development > DS Annotations</b> |
| and check <b>Generate descriptors from annotated sources</b>. |
| </p> |
| </td> |
| </tr> |
| |
| <tr> |
| <td colspan="2" class="section" id="Platform-Dev">Platform Developers</td> |
| </tr> |
| |
| <tr id="hidpi-composite-images"> |
| <td class="title">CompositeImageDescriptor HiDPI-ready</td> |
| <td class="content"> |
| The <code>ImageDescriptor</code> and <code>CompositeImageDescriptor</code> classes in |
| <code>org.eclipse.jface.resource</code> are now fully ready for HiDPI images. In |
| Neon (4.6), only <code>ImageDescriptor#createFromURL(URL)</code> |
| <a href="../../4.6/platform_isv.php#high-dpi-icons">supported high-resolution images</a>. |
| <p> |
| Clients that use <code>DecorationOverlayIcon</code> will get HiDPI support for free. |
| Subclasses of <code>CompositeImageDescriptor</code> will have to update their implementation of |
| <code>#drawCompositeImage(int, int)</code> to use the new <code>#drawImage(ImageDataProvider, int, int)</code> |
| method to draw the elements of the composite image. |
| </p> |
| Old code: |
| <pre> |
| protected void drawCompositeImage(int width, int height) { |
| // draw overlay in top-right corner: |
| <b>ImageData</b> imageData = myImageDescriptor.<b>getImageData()</b>; |
| drawImage(imageData, width - imageData<b>.width</b>, 0); |
| } |
| </pre> |
| HiDPI-aware code: |
| <pre> |
| protected void drawCompositeImage(int width, int height) { |
| // draw overlay in top-right corner: |
| <b>CachedImageDataProvider</b> provider = |
| <b>createCachedImageDataProvider</b>(myImageDescriptor); |
| drawImage(provider, width - provider<b>.getWidth()</b>, 0); |
| } |
| </pre> |
| <p> |
| Hint: Use <code>CompositeImageDescriptor<span style="visibility:hidden">­</span>#createCachedImageDataProvider(<span style="visibility:hidden">­</span>Image<span style="visibility:hidden">­</span>/ImageDescriptor)</code> to create an |
| <code>ImageDataProvider</code>. To calculate the width and height of the image |
| that is about to be drawn, you can use |
| <code>CachedImageDataProvider<span style="visibility:hidden">­</span>#getWidth()/<span style="visibility:hidden">­</span>getHeight()</code>. These methods |
| already return values in SWT points, so that your code doesn't have to |
| deal with device-dependent pixel coordinates. |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="swt-table-header-styling"> |
| <td class="title">SWT Table header colors</td> |
| <td class="content"> |
| Support for custom table header foreground and background colors has been added on Windows and Linux (GTK3) platforms. |
| <p> |
| APIs for Table header foreground color:<br/> |
| <code>Table#getHeaderForeground()</code><br/> |
| <code>Table#setHeaderForeground(Color)</code><br/> |
| </p> |
| <p> |
| APIs for Table header background color:<br/> |
| <code>Table#getHeaderBackground()</code><br/> |
| <code>Table#setHeaderBackground(Color)</code><br/> |
| </p> |
| Screen-shot of an SWT Table with customized header on Linux (GTK3): |
| <p> |
| <img src="images/table-header-colors.png" alt="" /> |
| </p> |
| </td> |
| </tr> |
| |
| <tr id="accessibletablelistener-getcaption-deprecated"> |
| <td class="title">AccessibleTableListener<span style="visibility:hidden">­</span>#getCaption(..) deprecated</td> |
| <td class="content"> |
| The <code>AccessibleTableListener#getCaption(AccessibleTableEvent)</code> method corresponds to the |
| <code>IAccessibleTable2::caption</code> method, which has been deprecated by the IA2 accessibility specification |
| implemented by SWT Accessibility. Instead, an <code>IA2_RELATION_LABELED_BY</code> relation should be used to create a |
| relation between the table and its caption. |
| </td> |
| </tr> |
| |
| <tr id="accessibletablelistener-getsummary-deprecated"> |
| <td class="title">AccessibleTableListener<span style="visibility:hidden">­</span>#getSummary(..) deprecated</td> |
| <td class="content"> |
| The <code>AccessibleTableListener#getSummary(AccessibleTableEvent)</code> method corresponds to the |
| <code>IAccessibleTable2::summary</code> method, which has been deprecated by the IA2 accessibility specification |
| implemented by SWT Accessibility. Instead, an <code>IA2_RELATION_DESCRIBED_BY</code> relation should be used |
| to create a relation between the table and its summary. |
| </td> |
| </tr> |
| |
| <tr id="di-extension-separation"> |
| <td class="title">Separation of DI extension annotations and supplier</td> |
| <td class="content"> |
| The annotations specified in <code>org.eclipse.e4.core.di.extensions</code> and the corresponding <code>ExtendedObjectSupplier</code> implementations have been separated. |
| The annotations are still available in the <code>org.eclipse.e4.core.di.extensions</code> bundle. The <code>ExtendedObjectSupplier</code> implementations have beend moved |
| to the new <code>org.eclipse.e4.core.di.extensions.supplier</code> bundle. This makes it easier for platform adopters to change the default implementation by providing a |
| replacement for the supplier bundle. |
| <p> |
| For <b>plug-in based products</b> this means that the new <code>org.eclipse.e4.core.di.extensions.supplier</code> bundle needs to be added |
| the list of included plug-ins. <b>Feature based products</b> should not notice the split. |
| </p> |
| <p><b>Note:</b> As part of the re-organization, <code>org.eclipse.e4.core.di.extensions.EventUtils</code> (only intended to be used for internal testing), was moved to |
| <code>org.eclipse.e4.core.di.internal.extensions.util.EventUtils</code> in the new bundle.</p> |
| </td> |
| </tr> |
| |
| <tr id="di-extension-service"> |
| <td class="title">@Service annotation available in DI extensions</td> |
| <td class="content"> |
| The <code>@Service</code> annotation has been added to <code>org.eclipse.e4.core.di.extensions</code>. You can use this annotation to get OSGi services injected by supporting additional service specific features |
| like getting services with higher service ranking injected automatically, to get the list of services injected for the given type, and to filter for a specific filter by providing an OSGi |
| LDAP filter. |
| <pre>public class MyPart { |
| |
| // highest ranked service |
| |
| @Inject |
| @Service |
| MyOsgiService service; |
| |
| } |
| </pre> |
| <pre>public class MyPart { |
| |
| // all services sorted by ranking |
| |
| @Inject |
| @Service |
| List<MyOsgiService> service; |
| |
| }</pre> |
| |
| <pre>public class MyPart { |
| |
| // get the highest ranked service that has |
| // the component property connection=online set |
| |
| @Inject |
| @Service(filterExpression="(connection=online)") |
| MyOsgiService service; |
| |
| }</pre> |
| </td> |
| </tr> |
| <tr id="imperative-expressions"> |
| <td class="title">Imperative Expressions</td> |
| <td class="content"> |
| You can now define visible-when expressions for menu items and tool items in an Eclipse 4 fashion by using |
| <code>ImperativeExpression</code>s rather than <code>CoreExpression</code>s. |
| <p> |
| <img src="images/imperative-expression.png" alt="" /> |
| </p> |
| ImperativeExpressions reference a POJO class with a method being annotated with the new <code>@Evaluate</code> annotation. |
| |
| <pre>public class TestExpression { |
| @Evaluate |
| public boolean isVisible(EPartService partService, |
| @Optional @Named("myValueToBeChecked") String myValueToBeChecked) { |
| |
| return "expectedValue".equals(myValueToBeChecked) && |
| !partService.getDirtyParts().isEmpty(); |
| } |
| }</pre> |
| The tracking property causes to track the values which are injected so that the visible state will be evaluated on eclipse context changes, |
| e.g, when the "myValueToBeChecked" value in the context is changed, the visibility check will be run once more. |
| </td> |
| </tr> |
| |
| |
| <tr> |
| <td colspan="2" class="section" id="Equinox">Equinox</td> |
| </tr> |
| |
| <tr id="tracing-consolelog"> |
| <td class="title">Tracing honors -consoleLog</td> |
| <td class="content"> |
| When the <code>-consoleLog</code> runtime option is specified on the command line, the Eclipse debug tracing |
| framework will send trace messages to System.out too (typically back to the command shell, if any). |
| This is especially handy when debugging Eclipse from Eclipse with tracing enabled, so no extra trace file |
| needs to be opened to check tracing output, and tracing output appears together with all other debug output |
| in the Console view. |
| </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 Oxygen milestone builds:</p> |
| <ul> |
| <li><a href="https://www.eclipse.org/eclipse/news/4.7/M5/">News for Eclipse Oxygen milestone build M5</a></li> |
| <li><a href="https://www.eclipse.org/eclipse/news/4.7/M4/">News for Eclipse Oxygen milestone build M4</a></li> |
| <li><a href="https://www.eclipse.org/eclipse/news/4.7/M3/">News for Eclipse Oxygen milestone build M3</a></li> |
| <li><a href="https://www.eclipse.org/eclipse/news/4.7/M2/">News for Eclipse Oxygen milestone build M2</a></li> |
| <li><a href="https://www.eclipse.org/eclipse/news/4.7/M1/">News for Eclipse Oxygen milestone build M1</a></li> |
| </ul> |
| |
| </body> |
| </html> |