What is External Code Formatters for NetBeans?

(Formerly known as Eclipse Java Code Formatter for NetBeans)

This is the project page of the NetBeans IDE plugin External Code Formatters for NetBeans. This plugin helps you to apply to a common code style in a team of Eclipse, IntelliJ and NetBeans IDE users. You can use several external code formatters inside the NetBeans IDE (see below), depending on whatever your co-workers use. The original formatting engine of Eclipse, the Google Code Formatter, the Spring Java Formatter or any other are embedded and allow you to format the source code the same way as e.g. your co-workers do with their Eclipse IDE.

Supported Formatters

Note

Please note that this plugin only provides support for formatting. Eclipse users may miss the application of save-actions like "adding @Override annotations" or "member sort order". Such AST-based transformations are not (yet) provided by this plugin.

Compatibility

Compatible with NetBeans 11.0+ and JDK 11+.

Current features

  • Makes use of the internal NetBeans formatting API, which makes it possible to reuse built-in features like the format on save action or format only selected lines, ... (since 1.13)
  • Global configuration and project specific configuration
  • Shows the used formatter in a notification (Disabled by default)
  • Supports Eclipse formatter profiles (since 1.6)
  • Code templates for @formatter:on/off (since 1.9)
  • Supports Workspace Mechanic configuration file (since 1.10)
  • Support configuration from .settings/org.eclipse.jdt.core.prefs (absolute and relative paths) (since 1.10)
  • Support configuration of linefeed (since 1.10)
  • Support for macro invocation (since 1.12)
  • Support for guarded documents (documents that are created by the NetBeans GUI builder, guarded blocks are skipped of course, but everything in between can be formatted), only for Eclipse Java Code Formatter (since 1.13)
  • Support for Google code formatter (since 1.13)
  • Support for Spring Java formatter (since 1.14)
  • Support for Eclipse Javascript formatter (since 1.14)
  • Support for revelc.net XML formatter (since 1.14)
  • Support for Jackson Json formatter (since 1.14)

History of this plugin