Google

Mar 25, 2014

Top 10 Eclipse short-cut keys every Java developer using eclipse IDE must know -- part 2

Top 10 Eclipse short-cut keys every Java developer using eclipse IDE must know - part1 covered the frequently used CTRL+ key. This will cover CTRL+SHIFT+key. If you can remember only 1 short-cut key, this post will show you which one to remember.

8. CTRL+g and CTRL+SHIFT+g

Often you need to find where a particular type or method is referenced so that you can analyze the impact of changing the referenced class or method. You also often need to find where a particular type or method is declared. Impact analysis vital in enhancing existing code base.

CTRL+G is to find declarations in workspace



Ctrl+Shift+G is to find references in workspace



9. CTRL+SHIFT+t and CTRL+SHIFT+r

Often you need to search for Java types like classes and interfaces or Java resources like spring context XML file, properties files, sql files, data files, etc. CTRL+SHIFT+t and CTRL+SHIFT+r allow you to search for types and resources respectively with wild card character like * and ?. If you do CTRL+SHIFT+r it gives you options at the bottom as to which editor you want to use to open the selected resource. You can also use these two short cuts contextually by highlighting type (E.g. class name like EclipseShortCutKeys) and then pressing the shortcut keys.

CTRL+SHIFT+t



CTRL+SHIFT+r



10. ALT+SHIFT+R

Refactoring code is a key aspect of writing quality code. For example, you might name a variable "currentTimeMillis" and use it in a number of places. But, later on decide that a better variable name would be "startCurrentTimeMillis". If you change at one spot, you want it to be propagated to all occurences of "currentTimeMillis". This works for changing method and class names as well. If you change a name of a declared method, you want all the classes that refrencing this method to change its values in the method invocations. This is achived by highligting a class, method, or a variable, and then pressing CTRL+SHIFT+R, and then change the name at the highlighted spot, and it will propagated to other locations and resources where it is used.



Do I have to remember these 10 eclipse shortcut keys? 

With practice and experience, you will remember these frequently used shortcut keys. Until then, if you have to just remember 1 shortcut key, then it is CTRL+SHIFT+L, which lists all the short-cut keys in a popup.

If you press CTRL+SHIFT+L once



If you press CTRL+SHIFT+L twice



Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home