None of the suggestions work for me yet. Note that the Force IDE opens the Apex class in the Apex editor. This editor does not appear in the list of contexts that you can associate with a key event. For example, this list contains contexts such as โediting in structured text,โ โediting in a Java source,โ etc.
Apex Editor does not contribute to the Source menu on the right-click menu. Thus, there is no way to get the ability to format.
I tried to open the apex class in Java. Now the "Source" option appears, the format option does nothing. (Therefore, no key event can do anything.)
The only thing I can find is ...
Select a file .... Open with ... Other ... find a Java editor. When the file is open ... select all the text .. right-click and select "Source" ... "Indent correctly."
This does not reformat, but eliminates the indentation problem.
Someday I hope that SFDC will make the code for the open source Force IDE. Then we, as a community, could create more tools for developers.
Bryan source share