External Java Code Formatters for NetBeans

ArtifactId: externalcodeformatter    1.13.0  

Author: Fabian Bahle

License: Eclipse Public License, Version 2.0

Homepage: https://funfried.github.io/externalcodeformatter_for_netbeans/

2020-02-09     2020-07-01     78

Editing  


Download matrix

Plugin version NetBeans compatible
1.13.0 NB 11.0  

Intro

External (Eclipse and Google) Java Code Formatters Integration for NetBeans

Description

This plugin helps you to apply to a common code style in a team of Eclipse JDT, IntelliJ and NetBeans IDE users. Either you can use the Google Code Formatter or the Eclipse Java Code Formatter inside the NetBeans IDE, depending on whatever your co-workers use. The original formatting engine of Eclipse and the Google Code Formatter are embedded and allow you to format the source code the same way as e.g. your Eclipse co-workers do.

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 profiles for Eclipse formatter (since 1.6)
  • Code templates for @formatter:on/off for Eclipse formatter (since 1.9)
  • Supports Workspace Mechanic configuration file for Eclipse formatter (since 1.10)
  • Support configuration from .settings/org.eclipse.jdt.core.prefs (absolute and relative paths) for Eclipse formatter (since 1.10)
  • Support configuration of linefeed for Eclipse formatter (since 1.10)
  • Support configuration of source level for Eclipse formatter (since 1.10)
  • Support for macro invocation for Eclipse formatter (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)

global.png

project.png

Known issues:

  • Updating the breakpoints after formatting acts not exactly the same way as for the internal NetBeans formatter, but it's pretty close.
  • Guarded blocks are only supported when using the Eclipse Java Code Formatter, but not for the Google Java Code Formatter. There seems to be a bug in the Google Java Code Formatter which prevents this feature to work. Further details on this bug can be watched here

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 provided by this plugin.

Licensed under the Eclipse Public License, Version 2.0

This plugin uses third-party libraries, which are needed to provide its functionality, please check their licenses here

For more information go to http://funfried.github.io/externalcodeformatter_for_netbeans/ or https://github.com/funfried/externalcodeformatter_for_netbeans

Provide defects, request for enhancements and feedback at https://github.com/funfried/externalcodeformatter_for_netbeans/issues

btn_donate_SM.gif