External Java Code Formatters for NetBeans

GroupId: de.funfried.netbeans.plugins
ArtifactId: externalcodeformatter
Author:Fabian Bahle
License:Eclipse Public License, Version 2.0
Homepage:https://funfried.github.io/externalcodeformatter_for_netbeans/

2020-02-09     2022-09-07     73,834

Editing  


Download matrix

Plugin version NetBeans compatible
1.13.0 NB 13   NB 12.0   NB 11.0  
1.14.0 NB 13   NB 12.0   NB 11.0 - Verified  
1.14.1 NB 13   NB 12.0  
1.14.2 NB 13   NB 12.0  
1.14.3 NB 13   NB 12.0  
1.14.4 NB 13   NB 12.0  
1.14.5 NB 13   NB 12.0  
1.15.0 NB 13   NB 12.0  
1.15.1 NB 15 - Verification pending   NB 14 - Verification pending   NB 13 - Verified   NB 12.0 - Verified  

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, IntelliJ and NetBeans IDE users. You can use several external code formatters inside the NetBeans IDE, depending on whatever your co-workers use. The original formatting engine of Eclipse, the Google Code Formatter, the Spring Java Formatter and others are embedded and allow you to format the source code the same way as e.g. your co-workers do with their Eclipse IDE.

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 external formatter configuration for all projects and/or project specific configurations
  • Can show the used formatter in a NetBeans notification (Disabled by default)
  • Eclipse formatter (profiles, custom linefeeds, custom source levels, macro invocation, remote and Workspace Mechanic configurations as well as .settings/org.eclipse.jdt.core.prefs (absolute and relative paths), ...)
  • Code templates for @formatter:on/off (not supported by all formatters, but e.g. Eclipse formatter, Spring formatter, ...)
  • 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), not supported by the Google Java Code Formatter
  • Includes many well-known Java formatters like the Google code formatter, the Spring Java formatter, Eclipse Java formatter and more
  • Includes also non-Java formatters like XML formatters (revelc.net and Jsoup) as well as the Jackson JSON formatter and even an SQL formatter (manticore JSQLFormatter; special thanks to Andreas Reichel for the contribution)

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 not supported 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.

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

Donate via PayPal

Become a patron

Buy me a virtual drink

Say Thanks