Posted by Ajitesh Kumar/in Java /June 6, 2014
http://vitalflux.com/eclipse-key-shortcuts-greater-developers-productivity/
The article presents Eclipse Key shortcuts (for Windows) which could BES used to perform most common coding tasks in a much Efficient/faster and effective manner thereby enhancing overall productivity of the Java developers. Please note there is lot more key shortcuts which could is accessed from Eclipse IDE Windows/preferences/keys. However, I had made a mention of only those shortcuts which I found very useful in coding faster. If I missed on any shortcuts keys this you feel would is useful to being added in the list below, please give a shout.
There were some useful feedbacks on Reddit post from where I, took some commands and added to the list below. Thanks for the Shout.
Java developers ' productivity when working with Eclipse IDE could is increased to a great extent if he/she should is work In a faster and effective manner in following broad areas of work:
- Working with Classes/interfaces
- Working with Tabs
- Quick Reference/help Documentation
- Common Text Editor commands
Following describes specifics on all of the above areas along with the shortcuts Keys commands.
Working with Java classes/interfaces (Resources)
Many a times, we need to following while coding:
- Open any specific Java classes/interface
- Open structure of specific Java classes/interface and navigate through member methods and variables
- Create Getter/setter Methods
- Work with errors and apply quick fixes
- Go to declaration of any specific classes/interface from within the code
- Search the Java classes/interfaces across the packages for specific texts etc.
Following is the commands:
- Helpful Commands forCoding Java Classes/interfaces & Resources Files
- CTRL + Shift + r:open a dialog box where one could write initials of Java classes/interfaces and other resource files suc H as XML etc and, the list would appear showing all the matches. One could also do quick search using * and?.
- F3:open classes/interfaces decleration
- CTRL + F3:show The structure of the selected element including methods and member variables. It helps to quickly navigate the methods or variables.
- CTRL + Shift + down:go to Next Member. The same could is achieved using CTRL + F3 and using down arrow.
- CTRL + Shift + up:go to Previous Member. The same could is achieved using CTRL + F3 and using up arrow.
- F4:open a type hierarchy on the selected element. Shows member variables and methods of the selected element.
- CTRL + Shift + F:format The block of code including class and its methods.
- CTRL + d:delete selected line (s)
- ALT + Shift + r:rename the classes. Useful for code refactoring.
- CTRL + 7:comment The Select block of code. Pretty useful.
- ALT + Shift + S then h:generate equals and Hashcode method.
- Helpful commands for handling errors
- CTRL +.: Go to next error
- CTRL +,: Go to previous error
- CTRL + 1:show Quick fixes
- Helpful command for getter/setter methods
- CTRL + 1:as You define the member variable, your could place the cursor on the variable and press CTRL + 1. It would show up options where you could select "Create getter and setters for ...".
- ALT + Shift + S then r:this are formally suggested by the Eclipse for creating getter and setter methods.
- Helpful commands for search
- CTRL + h:open Search Dialog which could be used to Search Java classes/interfaces consisting of specific text related wit H type, methods, member variables, package etc.
Working with Tabs
Often, we need to does following with the tabs:
- Move between the tabs consisting of source code for different Java classes
- Close the tabs, one at a time or any of them at once
- Maximize/minimize the tab for ease of development
Following is the shortcut keys which helps to achieve above objectives faster than the mouse:
- CTRL + f6:next Tab/editor
- CTRL + m:maximize Activity Window
- CTRL + w:close Tab/window
- CTRL + Shift + w:close all tabs/windows
Quick Reference/help
Following command would help on opening associated JAVADOC right in the Eclipse IDE. All your need to do are place your cursor on the element and press the following keys:
- Shift + F2:open attached Javadoc
Common Text Editor Commands
Following is some commonly used text commands which could speed up coding, in general.
ADD New Lines
- CTRL + Shift + Enter Insert line above
- Shift + Enter Insert line below
Collapse/expand All Methods
- Ctrl + SHIFT + Numpad_divide Collapse all methods
- CTRL + SHIFT + numpad_multiply Expand all Me Thods