Community
Participate
Working Groups
When running "Source", "Format" a snippet such as the following one will get formatted as follows. Original code ------------- JOptionPane.showMessageDialog(this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon); After formatting ---------------- JOptionPane.showMessageDialog( this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon); This is as it is now, Eclipse 2.1. With nested statements having parameters, this can become messy and hard to read. What I'd prefer (perhaps an option to toggle this could be put into the "Java"/"Code Formatter" prefs) is the following, which makes it a lot easier to read. JOptionPane.showMessageDialog(this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon); NB: The indentation happens with spaces starting from "JOptionPane". That way, no matter what you set your tab settings to, it will always look as nicely aligned as above. If it were indented with tabs, there'd be tabs and then spaces, as many as the String "JOptionPane.showMessageDialog(" is long. This obviously is a minor and nice-to-have issue, that's why I'm posting it as a feature request.
formatter lives in jcore
Additional formats for this are also possible: #1 JOptionPane.showMessageDialog( this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon); #2 JOptionPane.showMessageDialog( this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon); #3 JOptionPane.showMessageDialog( this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon ); #4 JOptionPane.showMessageDialog( this, msg.toString(), "About", JOptionPane.INFORMATION_MESSAGE, icon ); If a change is to be made, then some way to allow for different styles is needed.
This is currently under investigation within the new code formatter.
This is improved with the new formatter. Fixed and released in HEAD. Regression test added.
Verified.