Essential
Shortcuts
The list of shortcuts in
Eclipse is fairly long yet readily available. In fact starting with Eclipse 3.1
the full list of shortcuts can be displayed from anywhere via Ctrl+Shift+L.
Nevertheless, call it information fatigue or simply a matter of style, deserving
shortcuts frequently remain overlooked.
Below is a list of those
shortcuts I find essential. What I mean by that is if you don't use them then
you probably need additional time to execute essential everyday tasks and are
not very comfortable navigating around.
So without further ado here
is the list:
Ctrl+Shift+T
|
Find Java Type
|
Start typing the name and
the list gets smaller. Try typing the capital letters of the class only (e.g.
type "CME" to find "ConcurrentModificationException")
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+Shift+R
|
Find Resource
|
Use this to look for XML
files, text files, or files of any other type. which are in your workspace.
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+E
|
Open Editor Drop-Down
|
Presents a popup window
listing currently opened files. Start typing to limit the list or simply use
the down arrow key.
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+O
|
Quick Outline
|
Use this to find a method
or a member variable in a class. Start typing to limit the choices. Press
Ctrl+O a second time to include inherited methods.
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+Space
|
Content Assist
|
Context sensitive content
completion suggestions while editing Java code.
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+Shift+Space
|
Context Information
|
If typing a method call
with several parameters use this to show the applicable parameter types. The
current parameter where the cursor is will be shown in bold.
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+Shift+O
|
Organize Imports
|
After typing a class name
use this shortcut to insert an import statement. This works if multiple class
names haven't been imported too.
|
||||||||||||||||||||||||||||||||||||||||||
F3
|
Open Declaration
|
Drills down to the
declaration of the type, method, or variable the cursor is on. This works
much like a browser hyperlink.
|
||||||||||||||||||||||||||||||||||||||||||
Alt+Left
|
Backward History
|
This works like a
browser's Back button.
|
||||||||||||||||||||||||||||||||||||||||||
Alt+Right
|
Forward History
|
This works like a
browser's Forward button
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+L
|
Go to Line
|
Go to a specific line
number.
|
||||||||||||||||||||||||||||||||||||||||||
F4
|
Open Type Hierarchy
|
Show the type hierarchy
(downward tree) or the supertype hierarchy (upward tree).
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+Alt+H
Ctrl+Shift+F
|
Open Call Hierarchy
|
Show where a method is
called from. In the Call Hierarchy view keep expanding the tree to continue
tracing the call chain.
Auto align the code
|
||||||||||||||||||||||||||||||||||||||||||
Ctrl+H
|
Open Search Dialog
|
Opens a search dialog
with extensive search options for Java packages, types, methods, and fields.
|
||||||||||||||||||||||||||||||||||||||||||
Alt+Shift+R
|
Rename - Refactoring
|
Use this to rename type,
method, or field. All existing references will be refactored as well.
|
||||||||||||||||||||||||||||||||||||||||||
Alt+Shift+L
|
Extract Local Variable
|
Use this to create a
local variable from the selected expression. This is useful for breaking up
larger expressions to avoid long lines.
|
||||||||||||||||||||||||||||||||||||||||||
Alt+Shift+M
|
Extract Method
|
Use this to extract a new
method from existing code. The parameter list and return type will be
automatically created.
|
A few things to keep in
mind as you try the above shortcuts. If a shortcut doesn't have the described
effect check if one of these is the cause of your problem:
·
Do you have an older version of Eclipse? Check the Help section to
confirm the shortcut is available.
·
Is the shortcut applicable to the context (perspective) you're in?
For example Ctrl+Shift+T (Open Type) is applicable in the Java perspective but
not in the Resource perspective. You can find out where each shortcut is
applicable by pressing Ctrl+Shift+L or by checking the Help section.
·
Is the shortcut already taken by another application? If so the
other application will probably come to the foreground when you use the
shortcut.
·
Is the shortcut defined twice in Eclipse? This can happen on
occasion if you install additional plugins with overlapping shortcuts or more
likely if you've tried to map shortcuts of your own. If there is conflict the
shortcut won't work. To check this go to the Preferences or press Ctrl+Shift+L
twice.
sahi h
ReplyDelete