| Java, Eclipse and Web programming Tutorials |
Version 0.3
Copyright © 2009 Lars Vogel
29.07.2009
| Revision History | ||
|---|---|---|
| Revision 0.1 | 21.06.2009 | Lars Vogel |
| Created | ||
| Revision 0.2 | 22.06.2009 | Lars Vogel |
| Extended and reworked | ||
| Revision 0.3 | 26.07.2009 | Lars Vogel |
| Quick Access dialog | ||
| Revision 0.4 | 29.07.2009 | Lars Vogel |
| Shortcut for getting and setter | ||
Table of Contents
Please see Eclipse IDE for Java for an introduction to Eclipse.
Eclipse supports a lots of actions via keyboard shortcuts. The following lists the most common used shortcuts.
Table 1. Navigation
| Shortcut | Description |
|---|---|
| CTRL + SHIFT + R | Open / Search for resources, e.g. files |
| CTRL + SHIFT + T | Open / Search for Types |
| CTRL + T | Used on a method in an interface shows all implementing methods |
| STRG + O | In place outline view (displayed in editor), allows to search directly for elements in the selected file via type-ahead |
| ALT + LEFT ARROW KEY or ALT + RIGHT ARROW KEY | Go to prev/ next editor position in history |
| CTRL + Mouse-click on a variable | Go to declaration of this variable |
| CTRL + SHIFT + P | Go to matching bracket |
Table 2. Search
| Shortcut | Description |
|---|---|
| Ctrl + . | Go to previous / next problem |
| F3 on a variable | Goto Declaration of this variable |
| F4 on a variable | Show type hierarchy |
| Strg + J , Strg +k | Incremental search, find next |
| STRG + SHIFT + G | Search for reference in the workspace |
Table 4. Handling the editor
| Shortcut | Description |
|---|---|
| CTRL + 1 | Quickfix, dependend on cursor position |
| F12 | Focuses the editor (especially helpful if you working with Fast Views |
| Ctrl + M | Maximize Java editor |
| CTRL + Shift + F | Format source code |
| CTRL + Shift + O | Organize the imports / Will import the missing imports. |
| CTRL + Shift + S | Source generation related operations such as creating getter/setter |
| CTRL + Q | Last edited position |
Table 5. Arrow Keys
| Shortcut | Description |
|---|---|
| CTRL + Left | Move one element to the left |
| CTRL + Right | Move one element to the right |
| CTRL + ALT + Down | Copy line |
| ALT + Up / Down | Move line up / down |
| ALT + SHIFT Up / Down | Select the previous / next syntactical element |
| ALT + SHIFT Up / Down / Left / Right | Extending / Reducing the selection of the previous / next syntactical element |
| CTRL + Up / Down | Scroll up / down a line in the editor |
Table 6. Delete
| Shortcut | Description |
|---|---|
| Ctrl + D | Deletes line |
| STRG + SHIFT + DELE | Delete until end of line |
| Ctrl + DELE | Delete next element |
| Ctrl + BACKSPACE | Delete previous element |
CTRL+3 opens the Quick Access dialog. In the quick access dialog, you can type the name of any command, preference, wizard, view, perspective, etc.
Table 7.
| Shortcut | Description |
|---|---|
| Shift + F2 | Call the Javadoc for the selected type / class / method |
| Alt+Shift + N + Letter | Type shortcut for the command, e.g. njc to create a new Java class or npip to create a new Plugin project. |
| Alt + Shift + Z | Surround block with try and catch |
Thank you for practicing with this tutorial.
Please note that I maintain this website in my private time. If you like the information I'm providing please help me by donating.For questions and discussion around this article please use the www.vogella.de Google Group. Also if you note an error in this article please post the error and if possible the correction to the Group.
I believe the following is a very good guideline for asking questions in general and also for the Google group How To Ask Questions The Smart Way.
http://www.vogella.de/code/codeeclipse.html Source Code of Examples