Rearranger plugin version 0.1

The plugin performs two rearrangement tasks:


Reordering is based on the configuration supplied by the user. (By default, no rearrangement takes place.) The user creates a list of entries, specifying various attributes of the fields, methods, and classes. These attributes include all the standard Java modifiers (public, private, protected, final, static, etc.) as well as some other criteria (method is constructor, getter/setter, etc.)

The plugin moves objects to the front of the file or class declaration in the order they appear in the list. So, for example, you could specify a list like:

and all public static void fields would be moved to the front of each class definition, followed by constructors and accessor/mutator methods. Everything else follows these, in the same relative order as in the original file.

See http://www.intellij.org/twiki/bin/view/Main/RearrangerPlugin for more detail and to obtain the plugin.

Please let me know if there are bugs or additional features you'd like. One thing I know does not work: detecting if a method is overridden or not. (It's not obvious how to do this in Psi, but I'm sure it's easy)

-Dave

0
Avatar
Permanently deleted user

Great!!!

May I add some enhancements:

1- a way to process selected classes/packages in the project viewer.
2- a way to add this cool feature in the Reformat plug in...

I get an exception while trying to edit an "ordering statement" (Aurora 944)

java.lang.ClassCastException
at
com.wrq.rearranger.configuration.SettingsPane$3.actionPerformed(SettingsPane
.java:165)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
...

"Dave Kriewall" <no_mail@jetbrains.com> a écrit dans le message de
news:10181756.1066164213354.JavaMail.itn@is.intellij.net...

The plugin performs two rearrangement tasks:

>

2) reordering the field, method, and inner classes within an outer class. ]]>
Reordering is based on the configuration supplied by the user. (By

default, no rearrangement takes place.) The user creates a list of entries,
specifying various attributes of the fields, methods, and classes. These
attributes include all the standard Java modifiers (public, private,
protected, final, static, etc.) as well as some other criteria (method is
constructor, getter/setter, etc.)
>

The plugin moves objects to the front of the file or class declaration in

the order they appear in the list. So, for example, you could specify a
list like:

constructor methods > getter/setter methods]]>
and all public static void fields would be moved to the front of each

class definition, followed by constructors and accessor/mutator methods.
Everything else follows these, in the same relative order as in the original
file.
>

See http://www.intellij.org/twiki/bin/view/Main/RearrangerPlugin for more

detail and to obtain the plugin.
>

Please let me know if there are bugs or additional features you'd like.

One thing I know does not work: detecting if a method is overridden or not.
(It's not obvious how to do this in Psi, but I'm sure it's easy)
>

-Dave




0
Avatar
Permanently deleted user

Regis,

Thanks for your suggestions and bug report.

Version 0.2 is uploaded, which fixes that ClassCastException. I'll take a look at adding project viewer support.

What do you mean, add this feature to the Reformat plugin? Would you like it to automatically run when you run the Reformat plugin?

I don't own the Reformat plugin, but Timur (who wrote it) added functionality so that other plugins could chain after it. I did this with the Tabifier plugin, and could also do this with Rearranger.

-Dave

0
Avatar
Permanently deleted user

Thanks for your suggestions and bug report.


You're welcome ;), thanks for your good job.

>

Version 0.2 is uploaded, which fixes that ClassCastException.


I'm already uploading it,

>I'll take a look at adding project viewer support.

It would be great.

>

What do you mean, add this feature to the Reformat plugin? Would you like

it to automatically run when you run the Reformat plugin?
>

I don't own the Reformat plugin, but Timur (who wrote it) added

functionality so that other plugins could chain after it. I did this with
the Tabifier plugin, and could also do this with Rearranger.

That's exactly what I mean.

>

-Dave



0
Avatar
Permanently deleted user

Regis,

check out version 0.3 -- it chains from the Reformat plugin.

I noticed that if you have both rearranger and tabifier, it seems unpredictable which will run first. Maybe that's not a problem for you.

Good luck,
-Dave

0
Avatar
Permanently deleted user

Thanks a lot, it's very cool.
We don't currently use tabifier.

Regis

"Dave Kriewall" <no_mail@jetbrains.com> a écrit dans le message de
news:8755588.1066659042457.JavaMail.itn@is.intellij.net...

Regis,

>

check out version 0.3 -- it chains from the Reformat plugin.

>

I noticed that if you have both rearranger and tabifier, it seems

unpredictable which will run first. Maybe that's not a problem for you.
>

Good luck,
-Dave



0
Avatar
Permanently deleted user

Why isn't this plugin in the Plugin Manager?

"Regis Le Brettevillois" <regis@libelis.com> wrote in message
news:bn0sbt$ams$1@is.intellij.net...

Thanks a lot, it's very cool.
We don't currently use tabifier.

>

Regis

>

"Dave Kriewall" <no_mail@jetbrains.com> a écrit dans le message de
news:8755588.1066659042457.JavaMail.itn@is.intellij.net...

Regis,

>

check out version 0.3 -- it chains from the Reformat plugin.

>

I noticed that if you have both rearranger and tabifier, it seems

unpredictable which will run first. Maybe that's not a problem for you.
>

Good luck,
-Dave

>
>


0
Avatar
Permanently deleted user

Plugin Manager knows about it now.
-Dave

0

请先登录再写评论。