173 Rearranger Formatting 83 Dave Kriewall 4.5 62916 Dave Kriewall 2011-11-19 5.5

Rearranger

Compatible with  IntelliJ IDEA
19.11.2011
62 916
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.

Download plugin

Recent change notes

1) (Version 5.5) Recompiled for IDEA 11. Thanks to Denis Zhdanov at IJ for the necessary patches.
17.05.2016
Found compatibility issue with IDEA 2016 - it's impossible to configure rearrangement.
03.01.2012
Thanks to the author for helping me sort out my issue and for maintaining this plugin. Great work!
24.11.2011
The check box "Move Extracted methods below first usage" was messing me up, unchecked and everything is working as expected. Fantastic plugin, keep up the good work!
24.11.2011
Not sure if i'm running into a bug or just not using it appropriately. I have a moderately complex class and I'm trying to create an ordering as follows:

public static final field
public static field
public field
protected static final field
protected static field
protected field
...etc package, private

then again for methods, same pattern.

In each of these groups i'd like them to be sorted by type in the case for fields and name (alphabetically) in the case for methods.

After configuring the rules as above and hitting ctrl + alt + shift + R in my class, I still see protected methods occurring before public methods. Not sure what I'm doing wrong. I'm using v5.4, IntelliJ IDEA 10.5 Ultimate. The only thing I can think that might be throwing it off is that I typically use the final modifier for all my parameters, maybe that's confusing it?

21.09.2011
Defaults rules were too complicated with all the comments, etc. All I really wanted was grouping by static/instance/inner and sorted by visibility/name.

Fortunately, the rule editor was a breeze to use.

I love it!
12.07.2011
Very useful tool. Helps to apply standards and order quickly. Very useful when you write code with others.
31.05.2011
Be sure you're using version 5.4 with IDEA 10.5. The problem is fixed in that version.
Anonymous
30.05.2011
I have the same exception..

Error during dispatching of java.awt.event.KeyEvent[KEY_PRESSED,keyCode=82,keyText=R,keyChar=Undefined keyChar,modifiers=Ctrl+Alt+Maj,extModifiers=Ctrl+Alt+Maj,keyLocation=KEY_LOCATION_STANDARD,rawCode=82,primaryLevelUnicode=114,scancode=19] on frame0: com.intellij.psi.PsiClass.getLBrace()Lcom/intellij/psi/PsiJavaToken;
java.lang.NoSuchMethodError: com.intellij.psi.PsiClass.getLBrace()Lcom/intellij/psi/PsiJavaToken;
at com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(ClassEntry.java:200)
at com.wrq.rearranger.entry.PsiFileEntry.parseFile(PsiFileEntry.java:91)
at com.wrq.rearranger.rearrangement.Parser.parseOuterLevel(Parser.java:60)
at com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(RearrangerActionHandler.java:191)
at com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(RearrangerActionHandler.java:241)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:108)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:91)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:79)
at com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangement(RearrangerActionHandler.java:160)
at com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHandler.java:118)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:841)
at com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHandler.java:111)
at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:77)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:115)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:88)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:63)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:524)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:564)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:444)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:197)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:500)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:410)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Anonymous
20.05.2011
In 10.5 the following exception is thrown:

com.intellij.psi.PsiClass.getLBrace()Lcom/intellij/psi/PsiJavaToken;: com.intellij.psi.PsiClass.getLBrace()Lcom/intellij/psi/PsiJavaToken;
java.lang.NoSuchMethodError: com.intellij.psi.PsiClass.getLBrace()Lcom/intellij/psi/PsiJavaToken;
at com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(ClassEntry.java:200)
at com.wrq.rearranger.entry.PsiFileEntry.parseFile(PsiFileEntry.java:91)
at com.wrq.rearranger.rearrangement.Parser.parseOuterLevel(Parser.java:60)
at com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(RearrangerActionHandler.java:191)
at com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(RearrangerActionHandler.java:241)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:108)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:91)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:79)
at com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangement(RearrangerActionHandler.java:160)
at com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHandler.java:118)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:841)
at com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHandler.java:111)
at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:77)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:115)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:88)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:63)
at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:506)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:503)
at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:492)
at com.intellij.openapi.wm.impl.FocusManagerImpl.d(FocusManagerImpl.java:476)
at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:52)
at com.intellij.openapi.wm.impl.FocusManagerImpl$7.run(FocusManagerImpl.java:407)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:1431)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:390)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:386)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:60)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.a(ToolWindowManagerImpl.java:223)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.access$200(ToolWindowManagerImpl.java:82)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$2.run(ToolWindowManagerImpl.java:141)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:229)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:332)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:661)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:514)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:410)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
18.05.2011
Any chance that there will be an updated version for IDEA 10.5?
Anonymous
08.04.2011
It did work in IDEA 10 until 10.5 EAP (build 106.396). After checking out the source code and recompiling it in latest EAP it works again for me
22.03.2011
Wish it worked in IntelliJ 10
03.01.2011
Would be great to be able to rearrange before or after formatting code.

Keep up the good work!

Thank you
Chris
Anonymous
13.12.2010
Probably my favorite plugin.

Doesn\\\\\\\'t work in IntelliJ 10.
Anonymous
17.02.2010
I love your plugin -- it is one of only a handful that I use on a regular basis and I've turned many other developers onto it!

Unfortunately, despite your release notes, the latest build (7805) seems to not have been compiled with -target 1.5. To confirm, I used http://code.google.com/p/versioncheck/ and it shows the classes are version 50.0 (JDK6). Any chance you could rebuild it and verify that it will work on JDK5? Thanks so much!
Please  sign in  to leave a comment.