[ANN] Rearranger plugin - new version 2.9

This plugin:
- rearranges (reorders) class and class member declarations according to a user-specified order and/or method call hierarchy;
- generates section-marking comments;
- provides several controls for spacing within and between methods and classes; and
- permits the user to manually rearrange items.

The Live Rearranger feature was enhanced as follows:

(1) allows selection of multiple (discontiguous) rows.
(2) added keyboard control for rearranging (using ctrl-shift-{up arrow, down arrow} key combination.)
(3) Drag and drop of a contiguous selection is also possible by clicking the first row, shift clicking (and holding) the last row, releasing shift key and then dragging.
(4) Keyboard accelerators were added for all icon buttons.

These bugs were fixed:
(1) Live Rearranger dialog now shows all getters and setters.
(2) Ignore leading spaces when scanning for and removing pre-existing comments.
(3) Handle empty comments properly.
(4) Method body no longer scanned for comments.
(5) Preserve multiple spaces in comments when saved to and loaded from configuration file.

Thanks for all your suggestions and bug reports.

-Dave

5 comments
Comment actions Permalink

Great!

I see my all my setters/getters now, that's a good thing.
The tree is expanded and I seem to be able to move things
around just with the keyboard.

Now, after pressing Ctrl-, how to I get focus to the tree
without clicking in it? (I tried a bunch of stuff including
tabbing for a while but couldn't get to it).

Thanks,

Vince.


0
Comment actions Permalink

Hmm. You get focus to the tree by downloading the next version of the plugin, which I'll release when I figure out how focus works! :-D

At one point in this release cycle, I was able to ctrl-tab between fields, but it sure doesn't work now. Thanks for pointing it out!
-Dave

0
Comment actions Permalink

I tried to send you this by email, but your server says it's "sobig
virus". (You may want to check this, it's very annoying ;)

Anyway :


I have a problem with the plugin on some class, with Pallada build 2004

Here is the exception I get in idea's console when pressing
ctrlaltshift+R:


java.lang.NullPointerException
at
com.wrq.rearranger.popup.FileStructurePopup.displayRearrangement(File
StructurePopup.java:83)
at
com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(Rearrang
erActionHandler.java:177)
at
com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(Rearran
gerActionHandler.java:220)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:73)
at
com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangemen
t(RearrangerActionHandler.java:137)
at
com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHand
ler.java:97)
at com.intellij.openapi.application.b.b.runWriteAction(b.java:212)
at
com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHa
ndler.java:90)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAct
ion.java:1)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:13)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:14)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:17)
at com.intellij.openapi.a.a.d.a(d.java:57)
at com.intellij.openapi.a.a.d.b(d.java:122)
at com.intellij.openapi.a.a.d.a(d.java:30)
at com.intellij.ide.q.a(q.java:27)
at com.intellij.ide.q.dispatchEvent(q.java:41)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
ERROR - mand.impl.CommandProcessorImpl -
ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA 4.0
Build #20
02
ERROR - mand.impl.CommandProcessorImpl - JDK: 1.4.2_03
ERROR - mand.impl.CommandProcessorImpl - VM: Java HotSpot(TM)
Client
VM
ERROR - mand.impl.CommandProcessorImpl - Vendor: Sun
Microsystems Inc
.
ERROR - mand.impl.CommandProcessorImpl - OS: Windows XP
ERROR - mand.impl.CommandProcessorImpl - Last Action: Rearranger
ERROR - mand.impl.CommandProcessorImpl - Current Command:
Rearranger

ERROR - mand.impl.CommandProcessorImpl -
java.lang.NullPointerException
at
com.wrq.rearranger.popup.FileStructurePopup.displayRearrangement(File
StructurePopup.java:83)
at
com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(Rearrang
erActionHandler.java:177)
at
com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(Rearran
gerActionHandler.java:220)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:73)
at
com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangemen
t(RearrangerActionHandler.java:137)
at
com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHand
ler.java:97)
at com.intellij.openapi.application.b.b.runWriteAction(b.java:212)
at
com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHa
ndler.java:90)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAct
ion.java:1)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:13)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:14)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:17)
at com.intellij.openapi.a.a.d.a(d.java:57)
at com.intellij.openapi.a.a.d.b(d.java:122)
at com.intellij.openapi.a.a.d.a(d.java:30)
at com.intellij.ide.q.a(q.java:27)
at com.intellij.ide.q.dispatchEvent(q.java:41)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
java.lang.NullPointerException
at
com.wrq.rearranger.entry.ClassEntry.parseField(ClassEntry.java:227)
at
com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(Class
Entry.java:138)
at
com.wrq.rearranger.entry.ClassEntry.parseClass(ClassEntry.java:93)
at
com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(Class
Entry.java:167)
at
com.wrq.rearranger.entry.PsiFileEntry.parseFile(PsiFileEntry.java:81)

at
com.wrq.rearranger.rearrangement.Parser.parseOuterLevel(Parser.java:4
9)
at
com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(Rearrang
erActionHandler.java:169)
at
com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(Rearran
gerActionHandler.java:220)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:73)
at
com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangemen
t(RearrangerActionHandler.java:137)
at
com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHand
ler.java:97)
at com.intellij.openapi.application.b.b.runWriteAction(b.java:212)
at
com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHa
ndler.java:90)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAct
ion.java:1)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:13)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:14)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:17)
at com.intellij.openapi.a.a.d.a(d.java:57)
at com.intellij.openapi.a.a.d.b(d.java:122)
at com.intellij.openapi.a.a.d.a(d.java:30)
at com.intellij.ide.q.a(q.java:27)
at com.intellij.ide.q.dispatchEvent(q.java:41)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
ERROR - mand.impl.CommandProcessorImpl -
ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA 4.0
Build #20
02
ERROR - mand.impl.CommandProcessorImpl - JDK: 1.4.2_03
ERROR - mand.impl.CommandProcessorImpl - VM: Java HotSpot(TM)
Client
VM
ERROR - mand.impl.CommandProcessorImpl - Vendor: Sun
Microsystems Inc
.
ERROR - mand.impl.CommandProcessorImpl - OS: Windows XP
ERROR - mand.impl.CommandProcessorImpl - Last Action: Rearranger
ERROR - mand.impl.CommandProcessorImpl - Current Command:
Rearranger

ERROR - mand.impl.CommandProcessorImpl -
java.lang.NullPointerException
at
com.wrq.rearranger.entry.ClassEntry.parseField(ClassEntry.java:227)
at
com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(Class
Entry.java:138)
at
com.wrq.rearranger.entry.ClassEntry.parseClass(ClassEntry.java:93)
at
com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(Class
Entry.java:167)
at
com.wrq.rearranger.entry.PsiFileEntry.parseFile(PsiFileEntry.java:81)

at
com.wrq.rearranger.rearrangement.Parser.parseOuterLevel(Parser.java:4
9)
at
com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(Rearrang
erActionHandler.java:169)
at
com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(Rearran
gerActionHandler.java:220)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:73)
at
com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangemen
t(RearrangerActionHandler.java:137)
at
com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHand
ler.java:97)
at com.intellij.openapi.application.b.b.runWriteAction(b.java:212)
at
com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHa
ndler.java:90)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAct
ion.java:1)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:13)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:14)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:17)
at com.intellij.openapi.a.a.d.a(d.java:57)
at com.intellij.openapi.a.a.d.b(d.java:122)
at com.intellij.openapi.a.a.d.a(d.java:30)
at com.intellij.ide.q.a(q.java:27)
at com.intellij.ide.q.dispatchEvent(q.java:41)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)



(sorry for the poor formatting)


I can send you the class if you need it.

Thank you!

BoD

0
Comment actions Permalink

Sorry, the plugin has to be recompiled in order to work with Pallada. I will start posting a build 2002 (or greater) version on the wiki site as soon as it will let me upload files again.

I'll drop a note to this forum when it's been done.

-Dave

0
Comment actions Permalink

Vince,

Try version 3.0. The Live Rearranger dialog starts with focus in the tree; tabbing takes you to the OK and Cancel buttons, then back to the tree.

-Dave

0

Please sign in to leave a comment.