Mass Format in NetBeans IDE 7.2

Prior to the upcoming 7.2 release, the Source | Format menu item would be disabled, unless the currently selected window was an editor document.

In 7.2, you can select any of these:

  • project node
  • Source Packages node
  • package node
  • folder node

And you can also select multiple nodes, from various kinds, of the above. You'll then see that Source | Format is enabled and functions as you might expect:

When the action is invoked everything within the selected nodes is formatted as defined by the rules defined in the Options window.

Related issue: https://www.netbeans.org/bugzilla/show_bug.cgi?id=67397

Comments:

Will this format java sources, xml, jsp/jsf at the same time?

Posted by alex on May 11, 2012 at 06:43 AM PDT #

Yes, uploading a movie to YouTube right now to illustrate this and will then paste it inside this blog!

Posted by Geertjan on May 11, 2012 at 07:25 AM PDT #

Nice. I've been waiting for this feature since version 6

Posted by rio on May 11, 2012 at 07:40 AM PDT #

is there a similar feature for the "fix imports" and for the @Override annotations?

Posted by ric on May 13, 2012 at 12:57 AM PDT #

@ric:
You can use the Inspect and Transform feature, available from version 7.1

Right click on a package > Refactor > Inspect and Transform, then use the "Organize Imports" & "Add @Override Annotation" option

http://imagebin.org/212310

Posted by rio on May 13, 2012 at 10:21 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today