X

Geertjan's Blog

  • October 31, 2013

Eclipse Java Code Formatter in NetBeans Plugin Manager

Geertjan Wielenga
Product Manager

Great news for Eclipse refugees everywhere. Benno Markiewicz forked the Eclipse formatter plugin that I blogged about sometime ago (here and here)... and he fixed many bugs, while also adding new features. It's a handy plugin when you're (a) switching from Eclipse to NetBeans and want to continue using your old formatting rules and (b) working in a polyglot IDE team, i.e., now the formatting rules defined in Eclipse can be imported into NetBeans IDE and everyone will happily be able to conform to the same set of formatting standards.

And now you can get it directly from Tools | Plugins in NetBeans IDE 7.4:

News from Benno on the plugin, received from him today:

Features are as follows: 

  • Global configuration and project specific configuration. 
  • On save action, which is disabled by default.
  • Show the used formatter as a notification, which is enabled by default. 

Finally, Benno testifies to the usefulness, stability, and reliability of the plugin:

I use the Eclipse formatter provided by this plugin every day at work. Before I commit, I format the sources.
It works and that's it. I am pleased with it.

Here's where the Eclipse formatter is defined globally in Tools | Options:

And here is per-project configuration, i.e., use the Project Properties dialog of any project to override the global settings: 

Interested to hear from anyone who tries the plugin and has any feedback of any kind! 

Join the discussion

Comments ( 3 )
  • Jan Thursday, October 31, 2013

    Using it all the time, works great!


  • guest Thursday, March 27, 2014

    Hi,

    The plugin is mostly working but I have two issues:

    1. In the Source menu I see two items "Format with Eclipse Formatter" and "Format". I thought the idea was once set up and enabled, the regular format would just use the Eclipse formatter. But in practice the regular "Format" seems to use its own rules different from "Format with Eclipse Formatter" . Is this as expected or am I doing something wrong?

    2. "Format With Eclipse Formatter" always reformats the whole file even if I have selected some text and want just that part formatted. Again is this expected behavior or something only I am getting.

    Thanks for the great work.


  • guest Tuesday, May 20, 2014

    > 2. "Format With Eclipse Formatter" always reformats the whole file even if I have selected some text and want just that part formatted. Again is this expected behavior or something only I am getting.

    This feature has been added in version 1.7 of the plugin. Please update the plugin.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.