24 comments

What build of IDEA is required. I tried 0.4 with 915, and got the following exception:


java.lang.NoSuchMethodError: com.intellij.psi.search.PsiSearchHelper.getAccessScope(Lcom/intellij/psi/PsiElement;)Lcom/intellij/psi/search/SearchScope;

at com.wrq.rearranger.RearrangerActionHandler$ClassEntry.parseOuterClass(RearrangerActionHandler.java:462)

at com.wrq.rearranger.RearrangerActionHandler.parseOuterLevel(RearrangerActionHandler.java:138)

at com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(RearrangerActionHandler.java:88)

at com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(RearrangerActionHandler.java:374)

at com.intellij.openapi.application.b.d.runWriteAction(d.java:184)

at com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHandler.java:68)

at org.intellij.psi.codeStyle.RearrangerUtility$1.psiElementReformatted(RearrangerUtility.java:43)

at org.intellij.psi.codeStyle.ReformatManager.fireReformatEvent(ReformatManager.java:29)

at tzambalayev.ideaplugins.reformat.ReformatHandler.fireReformatEvent(ReformatHandler.java:58)

at tzambalayev.ideaplugins.reformat.ReformatHandler.reformatFile(ReformatHandler.java:70)

at tzambalayev.ideaplugins.reformat.ReformatAndOptimizeHandler.executeWriteAction(ReformatAndOptimizeHandler.java:15)

at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java)

at com.intellij.openapi.application.b.d.runWriteAction(d.java:184)

at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(EditorWriteActionHandler.java:1)

at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java)

at com.intellij.openapi.command.b.b.executeCommand(b.java:8)

at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:9)

at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:20)

at com.intellij.openapi.a.b.e.a(e.java:23)

at com.intellij.openapi.a.b.e.b(e.java:130)

at com.intellij.openapi.a.b.e.a(e.java:152)

at com.intellij.ide.s.dispatchEvent(s.java:116)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

0

I built it with 944. Sometime between 929 and 944 they changed the PsiSearchHelper, which is needed to determine whether a method has been overridden or not.

Sorry,
-Dave

0

It's brilliant. Does exactly what I hoped it would do.

0

Hi,

On 2003/10/20 16:10, Dave Kriewall wrote:

The rearranger plugin rearranges (reorders) class definitions within
a Java file according to rules specified by the user.


Can/does the rearranger plug-in also sort the methods alphabetically?

Bas

0

Bas,

You are reading my mind! I began adding the ability to alphabetize yesterday. I have a few files that have enumerations e.g.

and alphabetizing is the most convenient way to arrange them.

Should have that done today or tomorrow.
-Dave

0

Awesome plugin! simply fantastic, can't wait for the alphabetizing.

0

Kind of ironically, rearranging the lines I have created doesn't seem to
work - I OK the dialog, then if I either go back in to the settings or
execute the rearrange the old order is shown/used.

Cheers,
Nathan.

0

Too right. It is pretty funny that a rearranger can't rearrange its own settings!

I'll fix that right away.

-Dave

0

On 2003/10/20 18:23, Dave Kriewall wrote:

You are reading my mind! I began adding the ability to alphabetize
yesterday. I have a few files that have enumerations e.g.

 public static final Atom CLASS = new Atom("CLASS"); ..]]>

and
alphabetizing is the most convenient way to arrange them.


Thanks so much, that would be great!

Should have that done today or tomorrow. -Dave


I can hardly wait. But I haven't read the forum for a day now, so it may
already be there:-)

Bas


0

Can you add a 'rearranger' for anonymous inner classes?

"Dave Kriewall" <no_mail@jetbrains.com> wrote in message
news:18998758.1066659042502.JavaMail.itn@is.intellij.net...

The rearranger plugin rearranges (reorders) class definitions within a

Java file according to rules specified by the user.
>

Version 0.4 fixes a problem identifying static and final variables.

>

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

>

-Dave



0


One more request: Get it up on the plugin site so that I can be notified of and download updates through the PluginManager.

Thanks.

--Dave Griffith

0

It's there now, and it's version 0.5. (I uploaded 0.4 first, then replaced it with 0.5.) But I don't know why my plugin of all of them has a status "Out of date." Almost all the rest have status of "Missing."
-Dave

0

I don't understand, sorry. Can you give me an example of rearrangement of an anonymous inner class?

It seems to me that an anonymous inner class makes sense only in the context of creating a reference to an anonymous object of that class. So it occurs in an expression, not a declaration. And I can't rearrange expressions, only declarations. (That would be taking work away from the compiler writers! :)

-Dave

0

That column in the plugin manager dialog refers to the status of the plugin
on your local machine, not in the plugins.intellij.net repository. "Out of
date" means you have an older version of the plugin installed than what is
currently available from the repository; "Missing" means you don't have the
plugin installed. There was another thread on this elsewhere in this group,
where Stanislav said he'd change them into something less confusing in the
next release.

HTH,
Vil.

Dave Kriewall wrote:

It's there now, and it's version 0.5. (I uploaded 0.4 first, then replaced it with 0.5.) But I don't know why my plugin of all of them has a status "Out of date." Almost all the rest have status of "Missing."
-Dave


--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

0

You're probably right. It would be hard to tell the difference between
static final Comparator stringCmpAsc = new Comparator()
{
public int compare(Object o1, Object o2)
{
Vector v1 = (Vector) o1;
Vector v2 = (Vector) o2;
UserBean u1 = (UserBean) v1.elementAt(0);
UserBean u2 = (UserBean) v2.elementAt(0);
String s1 = u1.getLastName() + u1.getFirstName();
String s2 = u2.getLastName() + u2.getFirstName();
return s1.compareTo(s2);
}
};

and

static final Long id = new Long(100);

<no_mail@jetbrains.com> wrote in message
news:9013798.1066797047317.JavaMail.itn@is.intellij.net...

I don't understand, sorry. Can you give me an example of rearrangement of

an anonymous inner class?
>

It seems to me that an anonymous inner class makes sense only in the

context of creating a reference to an anonymous object of that class. So it
occurs in an expression, not a declaration. And I can't rearrange
expressions, only declarations. (That would be taking work away from the
compiler writers! :)
>

-Dave



0

No, I could tell pretty easily using Psi whether a field is initialized with an anonymous inner class or not. Are you saying you want the ability to select & group fields that are initialized in that way?

-Dave

0

Yes please. I don't like having those mixed in with my 'normal' fields.

"Dave Kriewall" <no_mail@jetbrains.com> wrote in message
news:5002175.1066844458615.JavaMail.itn@is.intellij.net...

No, I could tell pretty easily using Psi whether a field is initialized

with an anonymous inner class or not. Are you saying you want the ability
to select & group fields that are initialized in that way?
>

-Dave



0

Question: How do I get your plugin to work with the reformat plugin?

"Dave Kriewall" <no_mail@jetbrains.com> wrote in message
news:5002175.1066844458615.JavaMail.itn@is.intellij.net...

No, I could tell pretty easily using Psi whether a field is initialized

with an anonymous inner class or not. Are you saying you want the ability
to select & group fields that are initialized in that way?
>

-Dave



0

If you have both Reformat and Rearranger installed, then after you invoke Reformat with a Ctrl-Alt-R or Ctrl-Alt-L (or whatever keystroke you have mapped), the Rearranger is supposed to run automatically.

-Dave

0

That's too simple ;) I looked all over for that setting and all I needed to
do was run it. Duh.

Another request: Along with the 'Alphabetized' setting, have an 'By Type'
setting so that all Strings, ints, etc... are grouped together. Could also
do method return types. Not sure how useful that would be though.

"Dave Kriewall" <no_mail@jetbrains.com> wrote in message
news:12267855.1066853673034.JavaMail.itn@is.intellij.net...

If you have both Reformat and Rearranger installed, then after you invoke

Reformat with a Ctrl-Alt-R or Ctrl-Alt-L (or whatever keystroke you have
mapped), the Rearranger is supposed to run automatically.
>

-Dave



0

Brad,

give the 0.6 version a try. I added the ability to determine if a field is initialized to an instance of an anonymous class.

-Dave

0

Is there a way to have the method "matches"/"does not match" use a regex or glob/wildcard? (Or have I overlooked how this is done?)

I want a way to specify all the methods that start with "ejb" (i.e., ejbCreate(), etc.) get put at the end of the file.

0

Is there a way to have the method "matches"/"does not
match" use a regex or glob/wildcard? (Or have I
overlooked how this is done?)

I want a way to specify all the methods that start
with "ejb" (i.e., ejbCreate(), etc.) get put at the
end of the file.


I'm an idiot; it's working. Sorry for the bandwidth. (I had specified "ejb" and I'm pretty sure that didn't work; I changed it to "ejb.*" and that DOES work.)

0

No problem. The regular expression is matched against the entire method name. So "ejb" wouldn't match "ejbCreate" because nothing would match "Create". I suppose there's an implied "" (start of line) and "$" (end of line) around the supplied pattern.

I think if you just use "ejb.*" it will also work. No need to supply the caret.

-Dave

0

Please sign in to leave a comment.