JavaStyle Plugin |
Introduction
Usage
Bugs
Properties
Change Log
License Information
JavaStyle reformats the current buffer, if it contains Java code.
This is done by using the PrettyPrinter from the JRefactory library by Chris Seguin (seguin@acm.org), available under http://users.snip.net/~aseguin/chrissoft.html.
You need at least JDK 1.1.6 and jEdit 3.0final.
Note: The JRefactory library is already contained in JavaStyle. There is no need to download it separately!
The code will be indented according to the indentation settings of the Java mode, ie. the options Indent width and Soft tabs. You can configure these options for the Java mode under Utilities->Global Options->Mode-specific.
You can change the style of the reformatted Java code with a myriad of options in the JavaStyle plugin options dialogs, available at Utilities->Global Options->Plugins->JavaStyle. The dialogs have rich and self-explaining online help. Have a look!
There are some other options available, but currently there is no fancy graphical configuration dialog for them available.
However, you can look at the file
$HOME/.jedit/javastyle/.Refactory/pretty.settingsfor a full set of configurable options. (Remark: $HOME denotes your home directory. On Windows, this will probably reside under C:\WINDOWS, C:\WINDOWS\JAVA or C:\WINNT\profiles. On Unix, you already know where your home is... ;)
Click here for a commented version of the property file.
Note, that you can edit this file with jEdit. Saved changes will be used immediately.
There are other files in the .Refactory directory -- please leave them untouched!
Attention! These software contains bugs. Use it at your own risk. I have no responsibility for whatever happens to your code, if you use this plugin on it. You may even loose all of your code!
-- That said, the number of known bugs in JavaStyle and the underlying JRefactory library is surprisingly small. They are listed below.
If you have found a bug in JavaStyle, please mail it to me. If you are technically skilled in issues of programming, and you get the vague impression that the bug is not in the plugin layer, but in the underlying PrettyPrinter library, please inform Chris Seguin, the author of the PrettyPrinter.
Remember, I provide only the plugin part of the PrettyPrinter, while Chris is responsible for the pretty printing itself.Dirk Möbius (dmoebius@gmx.net)
Starred comments at end of line get wrongly indented.public String[] names =These strings get indented twice as much as you would expect. Alas, there is no workaround for this problem yet.
"hello",
"world"
};
If you put a starred comment /* */ at the end of a line, it will get wrongly formatted. E.g., if you have this:String s = "hello"; /* this is a starred comment */it will get formatted like this:
System.out.println(s); // next lineString s = "hello";As a workaround, only use double slash comments (ie. single line comments) at the end of lines after code, like in the example above.
/* this is a starred comment */
System.out.println(s); // next line