By default, the hotkeys: CTRL + SHIFT + Y changes to lowercase. CTRL + SHIFT + X changes to UPPERCASE.
Variable names that consist of a single character may be uppercase. In general, even single-character variable names should be lowercase. However, in some situations, mathematical notation uses uppercase letters. In such situations, uppercase variable names may be used.
Highlight and right click on the variable you want to rename. Navigate to Refactor and select Rename.... Type in your new variable name and press Enter.
APA's rules for variables are as follows (p. 99): Do not capitalize effects or variables unless they appear with multiplication signs.
Windows
After you press Alt+Shift+R as mentioned by kostja, you can select the text you want to change, then
Mac OS
There is no intelligence in this. It just blindly changes the case on the selected characters.
note: This tip comes from eclipse help. If you need to find it, click Help, Search, then type "uppercase". You'll find a page with lots of shortcuts.
What I find useful is column select using Alt+Shift+A and select a column of letters. Then use Ctrl+Shift+Y or Ctrl+Shift+X to lower case or uppercase letters.
This works for eclipse on windows.
There are a number of problems:
fooBar -> FooBar and vice-versa are unlikely to occur unless someone has been ignoring the Java style guidelines. (I rarely encounter such code, and when I do my initial reaction is to write off the code as beyond salvage.)
fooBar -> FOO_BAR and vice-versa are plausible, but pretty unusual.
foobar -> fooBar is also plausible, but it is problematic. It would entail Eclipse figuring out where the intended word boundaries are in a sequence of characters, and that is hard to get right.
If you look at these, they are all either unlikely to be needed much, or too hard to do properly. Hence, it doesn't surprise me that they are not supported by the standard Eclipse codebase.
Pressing Alt+Shift+R gives you all the power to refactor your variable name to your liking. AFAIK, there is no tool or shortcut that does just the capitalizing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With