- rearranges (reorders) class and class member declarations according to a user-specified order and/or method call hierarchy;
- generates section-marking comments; and
- provides several controls for spacing within and between methods and classes.
Version 2.1 adds the following features:
1) A default configuration is loaded when plugin is first installed. An additional "Configuration" pane allows the user to clear the configuration, reload the default configuration, load the configuration from a file, or save it to a file. (Like other settings changes, 'Cancel' will discard these changes.)
If you don't like the default configuration provided, it could be replaced in the plugin.jar file. File structure of the configuration is just the
element of the IDEA configuration file, although you can also load a configuration from such a file; enclosing <![CDATA[ element is ignored.
2) Live Rearranger feature providing manual rearrangement capability. It is activated from the Edit menu, or with default keystroke Ctrl-comma. This pops up a window containing a tree view of the file structure (file, classes, class contents such as fields, methods, and inner classes.) You can drag and drop elements at the same level (with the same parent); this causes them to be reordered.
Close the popup window by clicking outside or with any keystroke. If you hold Ctrl-comma until the dialog appears, perform at least one rearrangement, and then release Ctrl-comma, the dialog will close; if you release Ctrl-comma at any point before a rearrangement is made, the dialog will remain open.
Three features are not yet implemented:
- automatic expansion of the node containing the current cursor location
- simplification of the tree by removing top-level nodes with only one child (e.g., if the file contains only one class, that class will not be shown in the tree, only its children.)
Thanks to Keith Lea for the request & design details.
- "force ]]> lines" spacing options now properly saved and restored. You should recheck your settings.
- Force Spacing logic improved to handle nested anonymous classes. Special cases provided for last method of class (ignore "Force Spacing After Method Close Brace") and for last class in file (place one newline character after the final brace.)
- Fixed exception in spacing logic. Thanks to Bas Leijdekkers for the report.
I have uploaded this to the plugin manager site but not to the wiki site. (Going out of town for several days; will do it when I get back.)
Please let me know if you have any problems or requests.
- Additional planned plugin features:
1) ability to rearrange entire directories from the project tree.
2) Rearrange a selection, not entire file.
3) Progress bar.