Eclipse Project Photon (4.8) M3 - New and Noteworthy

Platform
Animated waiting cursor on macOS During long taking UI actions the cursor switches to a waiting cursor. On macOS this used to be a static black/white circle. From Eclipse Photon the macOS system's busy cursor is changed to a spinning blue ball (also called beach ball).

Import/export preferences from preference dialog Easily accessible buttons for opening the Import/Export preferences wizards have been added to the lower left corner of the Preferences dialog. The wizards are still accessible through the File > Import... and File > Export... wizards.

The DirectoryDialog now uses modern style The DirectoryDialog has been re-implemented to use modern native widget introduced in Windows Vista. The new look and feel is as illustrated below:

Regarding usage of newer DirectoryDialog on Windows: In the old DirectoryDialog, we used to have the option to set a text message to specify the purpose of the DirectoryDialog using DirectoryDialog#setMessage(String). This functionality is no more possible with the newer DirectoryDialog.

Hence, revisit the usage of DirectoryDialog.setMessage(String) in your projects, and if needed elaborate the Title field of DirectoryDialog using DirectoryDialog.setText(String) method.

Note: Recommend to use a minimal set of words in the Title field of DirectoryDialog and avoid making it look clumsy.

Report reference to missing nature as error marker On the Workspace preference page, there is now a new option to define the severity of an error marker to show on a project when it references a nature that is not available.

As a typical error markers, those are reported as decorator in the Project Explorer and as an entry in the Problems view.

Clients can associate marker resolution factories to these markers, whose type id is org.eclipse.core.resources.unknownNature.

Expanded Highlighting in Open Resource Dialog The Open Resource dialog now shows you how the search term matches the found resources by highlighting the names based on camel-case and pattern ( * and ? ) searches.

Undo/Redo Toolbar Buttons The main toolbar can now show Undo and Redo buttons.

The buttons are not available by default. They can be added via Window > Perspective > Customize Perspective...:

Export command id of key bindings to CSV On the Keys preference page the Export CSV action exports additionally the command id for key bindings.

Keys Preference Page

Exported CSV file

Close newly imported projects upon completion The import wizard offers you the option to close the newly imported projects upon completion of the import process. This might be beneficial if you're importing many projects and/or some projects have time-consuming builders configured. This affects the wizards reachable via File > Open Projects..., File > Import... > Existing Projects into Workspace and File > Import > Projects from Folder or Archive

Smart Import Wizard

JDT
Eclipse support for Java™ 9 Java™ 9 is here, and JDT fully supports it:
  • The Eclipse compiler for Java (ECJ) implements all the new Java 9 language enhancements
  • Updated significant features to support Java Modules, such as compiler, search and many editor features.

Note: It is not mandatory to run Eclipse with Java Runtime 9 to get the Java 9 support. However, a Java runtime 9 is required to be on a project's build path to compile a modular project against the system modules.

  • When a Java Runtime 9 is added to a project's build path, the system modules are listed under the System library in the package explorer:

  • An existing non-modular Java project can be quickly converted to a module by creating a module-info.java for that project. This feature can be availed once the project has been moved to compliance 9:

  • With Java 9 support, a library or a container can now be added to the module path as opposed to the classpath:

  • Once an entry has been added to a project's module path, its contents and encapsulation properties can further be modified by double-clicking on the Is modular node (or using the Edit button while Is modular is selected):

    • On the Contents tab individual modules inside a container like JRE System Library can be included or excluded by moving the module from left-to-right or vice versa. Modules shown in the lower right box are implicitly included, because they are required by one or more modules in the upper right box.

      Configuring the Contents of a module container

    • On the Details tab the encapsulation of given modules can be further influenced. The following example shows how module module.one can be made to export one of its packages to the module of the current Java project:

    • Toggling Defines one or more modules (see above screenshot) lets you specify whether a given regular (non-modular) jar file or project should be considered as an "automatic module". As a consequence of changes here, the entry will move to the Modulepath or Classpath accordingly.
  • Java search now includes a new search scope - Module:

  • When a Java Runtime 9 is added to a project's build path, the launch configurations are created with "Dependencies" tab and not the old "Classpath" tab.

    User can change the JRE of launch configuration and on the confirmation, the tab changes from "Classpath" to "Dependencies" or vice versa.

    If Java project is modular and module is described in module_info.java, most of the dependencies will be defined in the Modular Entries.

    If Java project is not modular, most of the dependencies will be defined in the Classpath Entries.

  • A new quick fix is offered on import statements to fix issues that are reported due to missing module dependency

    This QuickFix is applicable if the project is a Java9 project and has a module-info.java.

    The quick fix can be invoked from the editor:

    Before the quickFix is applied the module-info file looks as below

    After the quickfix is invoked, module-info.java will be updated to include requires 'MODULE_NAME'

  • A new quick fix is available when you have an unresolved type in a Java file. If the unresolved type can be found in a java9 module, a quick fix will be available to add an import type entry to your file reporting the error and add the required module dependency to module-info.java file.

    This QuickFix is applicable if the project is a Java9 project and has a module-info.java file.

    The quick fix can be invoked from the editor:

    Before the quickFix is applied, the module-info file looks as below

    After the quickfix is invoked, module-info.java will be updated to include requires 'MODULE_NAME'

    After the quickFix is applied, the required import statement is added to the file reporting error

  • A new quick fix is available when you have an unresolved type on service provider in a provides directive in module-info.java file. If the unresolved type can not be found in the current module, a quick fix will be available to create a new class or an interface in the current module.

    This QuickFix is applicable if the project is a Java9 project and has a module-info.java file.

    The quick fix can be invoked from the editor:

    When the service is a class, the quick fix is proposed for creating a class.

    When the service is an interface or an annotation, two quick fixes are proposed for creating a class or an interface.

Configure tags to include and exclude in JUnit launch configuration You can provide tags to be included in or excluded from a test run in the Configure Tags dialog of JUnit launch configuration:

TestReporter entries displayed in Console view In JUnit Jupiter, a method parameter of type TestReporter can be used to publish additional data about the current test run which can be viewed in the Console view:

Quick Fix to add @NonNullByDefault to packages A new quick fix is offered to fix issues that are reported when the Missing '@NonNullByDefault' annotation on package warning is enabled.

If the package already has a package-info.java, the quick fix can be invoked from the editor:

Otherwise, the quickfix must be invoked from the problems view, and will create a package-info.java with the required annotation:

When invoked from the problems view, both variations of the quick fix can fix the problem for multiple packages simultaneously.

Escape non-ASCII characters when pasting into a string literal The Java > Editor > Typing > Escape text when pasting into a string literal preference option now has a suboption Use Unicode escape syntax for non-ASCII characters:

When enabled, characters outside the visible ASCII range will be replaced by unicode escape sequences when pasted into a string:

Advanced source lookup implementation More precise "advanced" source lookup implementation, particularly useful when debugging applications that load classes dynamically at runtime. New org.eclipse.jdt.launching.workspaceProjectDescribers extension point can be used to enable advanced source lookup for projects with non-default layout, like PDE Plug-In projects. New org.eclipse.jdt.launching.sourceContainerResolvers can be used to download sources jar files from remote artifact repositories, like Maven Central or Eclipse P2.

Advanced source lookup affects debug launches only and can be enabled or disabled with Java > Debug > Enable advanced source lookup preference option:

PDE
New option to control PDE compiler warning There is an option to control the PDE compiler issue "Bundles with a Service-Component should set the Bundle-ActivationPolicy to lazy." By default, this is set to warning.
Support for environment argument tags in generic editor For the target files, highlighting and auto-complete are supported for environment argument tags in Generic Text Editor and the Target Editor Source tab.
PDE detects and configure folders as projects during import When using the import wizard from File > Open Projects from Filesystem... or File > Import... > General > Projects from Folder or Archive, PDE detects folders that can be turned into PDE projects (ie folders which contain a META-INF/MANIFEST.MF or a feature.xml) and configure them accordingly.

Note that folders already configured as Eclipse projects (already containing a .project file) will be imported "as it" and won't be reconfigured by PDE.

Platform Developers
Throttler UI updates in tight loops can degrade a system's performance, and users are also not capable to read information that fast. In such cases class org.eclipse.jface.util.Throttler can now be used to limit the rate updates on the UI thread with a specified time while executing the task wrapped in a Runnable.

An example for a use case are updates to a progress monitor, like in EGit's Import Project wizard. This wizard scans a directory and report any found file to the progress (actually a org.eclipse.jface.wizard.ProgressMonitorPart). This happens so fast that it can't be read, but overall it degrades the wizard's performance.

Usage example:
public class ProgressMonitorPart extends Composite implements
        IProgressMonitorWithBlocking {
    [...]
    private Throttler throttledUpdate;
    [...]
    throttledUpdate = new Throttler(fLabel.getDisplay(), Duration.ofMillis(100), this::updateLabel);
    [...]
    protected void queueUpdateLabel() {
       throttledUpdate.throttledExec();
    }
      
Default debug hover contribution on Generic Editor The Debug framework contributes to the Generic Editor when the hover represented by an ITextSelection can be adapted to an IVariable. So in order to take advantage of debug details on Hover in the Generic Editor, you can simply use the org.eclipse.core.runtime.adpaters extension point and define an IAdapterFactory from ITextSelection to IVariable to enable this feature.

If the current selection cannot be adapted (all adapter factories return null), the contribution to Generic Editor is ignored.

The JDT project already contributes such an adapter.

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