Eclipse tips

From QtClipse

Jump to: navigation, search

Shortcuts found from http://cs.winona.edu/cscap/javaspeak/eclipseShortcuts.htm.

Shortcuts

Alt+Shift+P Navigating to Matching braces:
Ctrl+O Navigating to different parts of the code: give you a small accessible window for navigating to different parts of the code.
Ctrl+, and Ctrl+. Finding the syntax errors in a code: takes you to the previous/next error. After reaching the error location, F2 will give you more information on the error in a small text area which is also accessible by JAWS.
Ctrl+F7 Switching to different views gives you the option in an accessible window to switch to different views
Ctrl+F6 Switching to different Editors: give you the option to switch between different editors.
Ctrl+F8 Switch to Different Perspectives: will give you the option to move to different perspectives.
F3 Tracing back runtime errors from console: Once you are on some error hyperlink, will take you to the corresponding source code.
Ctrl+shift+Arrow-up
Ctrl+shift+Arrow-down
Jumping from Method to Method:
F1 Reading the error messages on the top of the wizard dialog:
F1 Accessing help context messages:

Found from http://www.javaworld.com/javaworld/jw-08-2005/jw-0829-eclipse.html.

Ctrl-Shift-T Open type. Forget manually navigating through the source tree unless you're procrastinating.
Ctrl-Shift-R Open resource (looks for more than just Java files).
Alt-left arrow Go back in navigation history. Works like a Web browser's back button and comes in handy after jumping around using F3.
Alt-right arrow Go forward.
Ctrl-Q Go to last edit location. This key combination is also handy after you've been jumping around the code, especially if you've drilled down too deeply and have forgotten what you were doing.
Ctrl-Shift-G Find references in workspace. Prerequisite to most refactors. For methods, this key combination is basically the opposite of F3, allowing you to navigate backwards up a method stack to find a method's callers. A feature related to this is turning on occurrence marking. Go to Window, then Preferences, then Java, then Editor, then Mark Occurrences and select a few checkbox options. This highlights all occurrences in the code when you click an element designated for marking. I personally only use Mark Local Variables. Beware: Enabling too many highlights can slow Eclipse.
Ctrl-Shift-F Reformat code (according to code style settings). Our team agreed on a coding style, and we posted the Eclipse code style-rules files to our wiki. To do that, we sat together in Eclipse and went to Window, then Preferences, then Java, then Code Style, and configured Code Formatter, Code Templates, and Organize Imports. We used the Export function in each of these screens to generate the config files. We put these on the wiki and everyone imported them into their Eclipse.
Ctrl-O Quick outline. Within the editor, this key combination allows you to jump to a method or attribute by typing a few letters of the name.
Ctrl-/ Comment/uncomment a line. Can also work on many lines at a time.
Ctrl-Alt-Arrow down Copy highlighted line(s).
Alt-Arrow down Move line(s) down. Alt-Arrow up works as well

Links

Personal tools