Rearranger

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.

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?

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)

Would be great to be able to rearrange before or after formatting code.

Keep up the good work!

Thank youChris

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!