Return to Vincent Partington's homepage
Go to Erwin Bolwidt's homepage

Java Package Formatter 1.0.1

When you want to format multiple Java source in Eclipse the only way is to open each and every file, right click in the editor window, select the "Format" option, and save the formatted file. This plugin allows you to select one or more packages in the Java Package Explorer and format all .java files in those packages. You can also choose to select just the specific Java source files you wich to format or even the whole source directory.

N.B.: This functionality comes standard in Eclipse 3.0 and up. I won't be creating any new versions, but these versions will be available for those stuck on an older version of Eclipse, e.g. those using IBM WebSphere Application Developer 4.0, 5.0 or 5.1.

This is a small update that fixes some I18N and documentation glitches and gets the naming conventions in line with those used by Erwin Bolwidt's File-Size Decorator plugin.

Installation

To install this plugin, follow these steps:

  1. Make sure you have Eclipse 2.0.0 or higher.
  2. Exit Eclipse.
  3. Download the ZIP file that contains the plugin.
  4. Extract the contents of the ZIP file into the plugins directory of your Eclipse installation.
  5. When the files have been extracted verify that the plugin configuration file can be found at ...\eclipse\plugins\org.klomp.eclipse.formatjava_1.0.1\plugin.xml.
  6. Start Eclipse.

Usage

To use the plugin, go to the Package Explorer (usually found in the Java Perspective) and select one or more of the following:

and press the right mouse button. Then select "Format .java files" from the popup menu that appears.

The selected packages and source folders will be scanned for Java source files. The Java source files and those selected by the user are then formatted. If any of those Java source files has already been opened in an editor window, the contents of that window are formatted. If the window had unsaved changes, the contents are not saved to disk.

License

This software is distributed under the terms of a BSD-style open source license. Please see the file LICENSE for details.

Download

Please select the version you wish to download:

Version Release date ZIP file (includes source code)
1.0.1 17 Jan 2003 org.klomp.eclipse.formatjava_1.0.1.zip
1.0.0 27 Dec 2002 formatjava-1.0.0.zip

Copyright (C) 2002-2005, Vincent Partington <vinny@klomp.org>, Last Updated: 16 Apr 2005.