New Features in the Eclipse IDE
The Eclipse IDE 2021-06 (4.20) was just released, so it’s a good time to highlight some of the major improvements that have been added to the software over the past year.
If there are particular improvements you’re interested in, use the links below to jump to that section of the article:
- Eclipse Java development tools (JDT) improvements
- Standard widget toolkit (SWT) improvements
- Theme improvements
- Plug-in development environment improvements
Eclipse JDT Improvements
There are a number of major improvements in the Eclipse JDT, including better code completion, new cleanups and quick fixes, support for new Java versions, and debugger enhancements.
We’ll start with code completion. The Java Editor now supports substring and subword matches for types when performing code completion. This is helpful for developers who can remember the subwords of a class name, but not the full name.
When completing a method call, the Java Editor now inserts the best-guessed parameters from available variables and parameters, rather than simply inserting the method parameter names.
In addition, more than 60 cleanups and quick fixes have been added since the 2020-06 IDE release. To help find them, the Java Cleanup configuration page has been reorganized and three new tabs were added:
- Java feature (Java language features)
- Source fixing (cleanups that fix incorrect code, but may change execution)
We also want to highlight two improvements to tooling support for new Java versions:
Quick fixes on permitted types. You can add sealed, non-sealed, or final modifiers on permitted type declarations, as applicable, using the new Quick Fixes (Ctrl+1) command. Here’s an example for a permitted class declaration:
And, here’s an example for a permitted interface declaration:
Quick fix to create a permitted type declaration. You can also use the Quick Fixes (Ctrl+1) command to create a new permitted class or interface declaration:
For further inheritance control, the created type declares the sealed type as its supertype and can be declared as final, non-sealed, or sealed with the available quick fixes.
The Eclipse JDT debugger also provides a number of new features, including the ability to inspect and evaluate expressions with anonymous class instances to improve evaluations.
The JDT debugger also now provides a checkbox option to show which variable caused a NullPointerException (NPE) in traceback. The option is enabled by default for Java programs opened with Java 14 or higher and disabled for programs opened in earlier Java versions.
There’s also a new option called Show Type Names in the Variables and Expressions views to show the type names rather than the declared type. To enable Show Type Names in the Variables view, column mode must be disabled using the View Menu > Layout > Show Columns menu option.
In the Breakpoints view, you can disable all breakpoints using the new Disable All context menu option.
In addition, a new Toggle Tracepoint context-menu entry has been added to the Java Editor line ruler. Each of the Toggle Tracepoint options has a new icon and is now available for Java class files as well as for Java source files.
And finally, hovering over a chain of variables now shows the variable under hover.
There are five main improvements to look for in the SWT:
As of the Eclipse IDE 2020-06 (4.16) release, the SWT no longer required colors to be disposed. Starting with the 2020-09 (4.17) release, new constructors that don’t require a device when creating colors are available.
In addition, we’ve added a new org.eclipse.swt.graphics.Resource.setNonDisposeHandler API that tracks SWT resources that were not properly disposed of. The API accepts a custom Consumer<Error> callback to receive detected errors. Alternatively, the org.eclipse.swt.graphics.Resource.reportNonDisposed system property can be set to true. In this case, the SWT reports these errors to stderr with no need to modify the application code.
A new API for maximum Shell size
You can now specify the maximum size of the SWT Shell, using setMaximumSize(width, height) or setMaximumSize(point). The shell is resized if it's currently larger than the specified size. You can also use getMaximumSize() to query the currently set maximum size.
Support for Microsoft Edge browser
On Windows 10, the Browser widget supports a new back-end based on the Microsoft Edge WebView2 component. Use the SWT.EDGE style constant to enable it.
Note that this integration is experimental and is not a drop-in replacement for the older Internet Explorer back-end. Features are missing, and there are significant differences in behavior. There are also some known issues when running the Eclipse IDE with Microsoft Edge as the default browser.
Support for Mac Arm64
The SWT libraries for Mac Arm64 (AArch64) architecture are available for testing. Note that an Arm64 Java virtual machine (JVM) is required to run the libraries. Also note that the Eclipse IDE and SWT for Mac x86_64 architectures can already run on Apple silicon chips using the Rosetta translation process on an x86_64 JVM.
The Eclipse IDE 2021-06 release also includes a number of theme improvements. For example, a new “System” theme is available on the Appearance preference page on all platforms. This theme is built using system colors, which means it integrates well into any OS and OS theme. The screenshot below shows the System theme under a Gimp Toolkit (GTK) theme such as Adwaita.
The GTK light theme has also been updated to better align with the default GTK3 Adwaita theme.
In the dark theme, there’s now a selection highlighter.
We’ve also tweaked the Windows 10 dark theme, adding SWT support for a dark-themed menu and a dark themed progress bar.
And finally, SWT supports an improved combo in the dark theme under Windows 10.
Shifting over to macOS light theme improvements, we’ve updated the theme to match the latest macOS design.
There are three new features to highlight in the plug-in development environment.
First, any Processing Development Environment (PDE) compiler issues can now be set to Info so you can see issues without setting them to Error or Warning. This is similar to the option that’s already available in the Eclipse JDT.
Second, there is now an error message for a missing bundle in the API baseline. The message can be enabled using the Preferences > Plug-in Development > API Baselines menu option, and the default severity level is Warning.
Third, API tools now provide a warning if there is a redundant increase in the service segment or minor version.
Learn More and Download the Eclipse IDE
To learn more about these and other improvements in the Eclipse IDE and download the latest version, visit the Eclipse IDE webpage.
About the Author
More from this Edition
Discover the open source projects used in the autonomous driving technology developed for the Indy Autonomous Challenge.
Michael Pöhnl talks about the Eclipse iceoryx 1.0.0 (Almond) release and the software’s integration in the Robot Operating System (ROS) 2 and other frameworks.