Wednesday, 17 February 2010

JDev 11gPS1 – text editor enhancements

I note in the last 11gPS1 release of JDev (well, at least I didn't see it in any earlier releases) that the text editor has a few additional facilities available under the Source menu:

Of particular note there are now entries to Trim Trailing Whitespace, and Convert Leading Tabs to Spaces, which for me have always been important text editor feature, as both of them make editing source code easier beyond their application. Some of these features such as the Macro playback options have been available for a longtime in JDev as revealed by looking through the Shortcut Keys options under Tools -> Preferences. However the point is they now get a menu option!

As a side note, some of the Source menu features can be applied automatically when saving a file. This option is accessible via the Tools -> Preferences -> Code Editor -> Save Actions options:

The Save Actions facility was available in earlier releases of JDev, well, at least where I could test it on my local machine.


Jean-Philippe Melanson said...

This is a productivity booster as I always Organize imports and do a Reformat after coding to enforce our code style.
Thanks Chris!

Brian Duff said...

It looks like (at least some of) these commands are in the wonderful category of editor commands that have been implemented in JDeveloper for years, but without any kind of menu item to invoke them (they were only available via the keyboard, and in several cases didn't have default keyboard shortcuts assigned, so you had to visit the Accelerators page in preferences to assign one before using them).

We used to frequently get questions like, "why doesn't JDeveloper have a command to upper case my selection?", and we'd say, "er... it does, it's just obscurely hidden away in accelerators and you need to map a shortcut to it".

Nice that they finally added menu items for these :)

Timo said...

Be careful with the 'Reformat' save action. I had a few cases where this action messed up my jspx/jsp code.
This is on my list which needs checking and filing a bug report, if I can pin it to a reproducible test case.