[ANN] Rearranger plugin - new version 1.3 released

The Rearranger plugin rearranges (reorders) class and class member declarations according to a user-specified order.

New features in this release:

- Ability to keep getters and setters together
- Ability to sort overloaded methods (including constructors) by number of parameters
- global comment pattern; comments matching this pattern will be deleted before rearrangement
- comments can be generated for groups of extracted methods
- popup like ctrl-F12 file structure popup shows rearranged file structure, including nested extracted methods

Several bug fixes also:

- close box on field/method attribute dialog no longer causes NPE
- all attribute dialogs laid out fresh to optimize space
- handle cases where there are no outer classes (e.g. XML files)

Please let me know of any problems you have.

Still on the to-do list:
- grouping methods by interface they implement
- spacing controls (between classes, between methods; blank line or not before closing brace of class/method; etc)
- rearranging a selection

If I've forgotten anything or you have other suggestions, you know the drill... :)

Thanks,
-Dave

4 comments

Hi Dave,

The latest version looks nice.
As you can guess, the first thing I checked was the new file structure
popup.

Problem 1 : the parameters signatures takes too much space.
(see illustration below).






Problem 2:
Looking at the image above, I'm not so happy with its readability, but
it's hard to say why. I guess it's like code formatting: there is no
single best solution. It depends on the user.
I'm still convinced the html (through Velocity templates) solution would
be a better optin, letting the user fine tune the final look.
For example, in the problem mentionned above (too long param
signatures), I would just display the param names, and put their full
signatures in html tooltips.
With templates, I'd do it myself, step by step. Without templates, I'll
have to ask you to do it :), and you'll have to add options, and
dialogs, and ..

Anyway, congrats and thanks for your good work. You're serving the
community very well.

Alain


Alain



Attachment(s):
tooWideSignatures.png
0

Hi Alain,

I looked briefly at Velocity (never used it before). One thing that wasn't obvious to me was how it all hooks together. Let's say I did support Velocity; is it still possible for it to appear as a popup? Or is it going to appear in a browser? In other words I'm not sure what the mechanism is for me to stuff the XML into your template and still have it show up inside IDEA.

Or is that important to you?

Yes, I did a quick-and-dirty parameter display, just taking the entire parameter list from the file. (Actually I did that whole popup feature in a couple hours, but didn't spent much time testing it -- I knew I could count on you! :) It does look bad when there are multiple lines, for sure! I was modelling the dialog after the ctrl-F12 popup. If I were able to duplicate that popup's appearance, would that be sufficient?

-Dave

0

Dave

>I looked briefly at Velocity (never used it before). One thing that wasn't obvious to me was how it all hooks together. Let's say I did support Velocity; is it still possible for it to appear as a popup? Or is it going to appear in a browser?
>

You don't need a browser to view an html file in a java app. Ex: in the
CamouflagePlugin config ui, the last tabbed pane contains the
documention. It's a plain html file - stored in the plugin's jar -, that
I simply display in an editor pane.
(It's not the only way :
http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-toolbox_p.html)

In other words I'm not sure what the mechanism is for me to stuff the XML into your template and still have it show up inside IDEA.

>

That's the easy part : create a class and object to accomodate the info
you've extracted, and put it into the context ;


The less easy part it the template, that's to be modified by the user :
Velocity expects a file name.
Template template = Velocity.getTemplate("test.wm");
I'd use a temporary file, but it's because I'm lazy. An in-memory
solution would be cleaner, and faster.


>It does look bad when there are multiple lines, for sure! I was modelling the dialog after the ctrl-F12 popup. If I were able to duplicate that popup's appearance, would that be sufficient?

>

I'd rather see the parameters names, than their types. I guess some
would prefer to see the types :) there you are: more options to stuff
into the config dialog.


Alain

PS: If you wish, I can do a spike - next week - around my velocity
suggestion, and send you what I get.




0

Hi Alain,

Must be nice in Belgium, you can work on our Thanksgiving vacation day!

Sure, if you'd like to send me something to speed up the Velocity implementation, that'd be great. Nobody else has asked for it yet, so we're on the bleeding edge.

Would it be useful to store the velocity template in the Rearranger settings? (Or at least a file name?) That's easily done.

Yes, I'd forgotten that JEditorPane supports html display. This should work great.

-Dave

0

Please sign in to leave a comment.