Common Shortcuts
There are several shortcuts in Eclipse that are useful for speeding up development time. They are listed below in no particular order:
Table 3.1 General Studio Shortcuts
Shortcut |
Explanation |
Ctrl + Shift + R |
Opens a dialog that allows you to search for any file in the workspace. |
Ctrl + Shift + T |
Opens a dialog that allows you to search for any Java type (class or interface) in the workspace. |
Alt + D then S |
For applicable file types, this will submit the file to the server. For example, if an MPT is the current tab, this shortcut will submit the MPT to the server. |
Ctrl + H |
Opens a search dialog to find text in the workspace (or under a selected folder in the Package Explorer ). |
Ctrl + M |
Maximizes the current Eclipse panel (or restores it if it's already maximized). |
Ctrl + W |
Closes the current tab. |
Ctrl + Shift + W |
Closes all open tabs. |
Table 3.2 Java Editor Shortcuts
Shortcut |
Explanation |
Alt + Left, Alt + Right |
Traverses the navigation history, which is created by things like changing tabs and navigating through Java classes. For example, if you Ctrl + Click a method call to open the method definition in another Java file, pressing Alt + Left will go back to the method call. |
Ctrl + Space |
Brings up a list of autocomplete results depending on the context. For example, within a class definition, this will bring up a list of methods to implement, and within a method implementation it will bring up a list of fields and methods to call. |
Ctrl + Alt + H |
When the cursor is on a method or class name, this will open a search for the Call Hierarchy for instances where the method (or class constructor) is being called within the code. |
Ctrl + I |
Corrects indentation for the current line or a selected code block. |
Ctrl + Shift + O |
Organizes imports. It adds any missing imports and removes unused imports. |
Table 3.3 General Editor Shortcuts
Shortcut |
Explanation |
Ctrl + K, Ctrl + Shift + K |
This will perform the last executed search for the next (or previous) text match. If any text is highlighted, the shortcut will start a new search for the highlighted text. |
Ctrl + D |
Delete the current line of code. |