Jump to content

Coding Enhancements

  • Please log in to reply
No replies to this topic

#1 buddybob


    Advanced Member

  • Members
  • PipPipPip
  • 452 posts
  • Gender:Male
  • Location:Bangalore
  • Interests:Java, Airplanes, Trance Music, Movies...blah blah

Posted 04 September 2011 - 02:31 PM

I had some suggestions towards making coding in JCreator more productive. A lot of them have shamelessly been inspired by JetBrains IntelliJ and ReSharper. Here they are:

  • Select word to respect camel/Pascal casing - so if I am at the start of the word FirstSecondThird and press Ctrl+W, it should select First only, I press Ctrl+W again, the selection should expand to FirstSecond and so on. This behavior can be made configurable in the Options dialog. If cursor was in the middle of Second, and I press Ctrl+W, it should select Second. I press Ctrl+W again, it should select FirstSecondThird.
  • Select Line should accept an arrow as well to define which lines to select above or below. So I am on line 2 and I press Ctrl+R+Down Arrow, it should select line 2. I press Ctrl+R+Down arrow again, it should expand to line 3 as well. Similarly if I press Ctrl+Shift+Up arrow it should select line 2, i press again, it should select line 1 and 2.
  • Deselect word/line - so if Ctrl+W selects a word, Ctrl+R selects a line, then they should be paired with Ctrl+Shift+W to deselect/shrink the word selection. Similarly Ctrl+Shift+R+Up/Down Arrow to deselect/shrink line selection
  • New short cuts for commenting line(s) - Ctrl+/ if line comments i.e. // must be used to toggle commenting the selected lines. Ctrl+Shift+/ if block comments i.e. /* to toggle commenting the lines.
  • Moving lines up or down or into and out of blocks - If I press Ctrl+Alt+Up arrow on a line, the line must move up. Similarly Ctrl+Alt+Down to move the line down. If a block occurs in the position above or below the direction of the movement, the selected lines must jump above or below that block. Pressing Ctrl+Alt+Right Arrow should move the line into the block immediately above or below the line. Similarly Ctrl+Alt+Left arrow must move the selected lines out of the block it is in. And depending on whether it was towards the beginning or end of that block, move it above or blow the block. The block movement should not happen between method/class blocks.
  • Moving class members up or down - If my cursor is on or between the name of a method/field/nested type/other class member then pressing Ctrl+Alt+Up must move the member above the member immediately above it. Similarly Ctrl+Alt+Down Arrow moves the member below the member immediately below it. This movement must be restricted within the enclosing class/enum/interface block.
  • Goto a Class/Interface/Enum/File/JavaDocs - Pressing Ctrl+T must bring up a little popup panel with a auto-complete text box where I can type the name or portion of the name of a class/interface/type within my project to navigate to it. The feature must support PascalCased names so if I type FST, it should match with FirstSecondThird. If I type First* it should match with any types which begin with First. Similarly *Third must match with types whose name ends with Third. The keyboard short-cut Ctrl+R must allow the user to navigate to a specific file in the project. The short-cut Ctrl+M must navigate to a member whose name matches the specified name criteria across all types within the project. If the name of the member matches a standard Java class/interface/enum, it should open to the JDK Help window to the JavaDoc of the specific class/interface/enum member.

I am sure these sound like a lot and as if its an attempt to build another ReSharper/IntelliJ tool, but I believe they will take the productivity of a programmer in JCreator very far.

Will post more as I think about them. Hope it helps! :smile:
Best Regards,
Ranganath Kini
Sun Certified Java Programmer