-6

I was searching for a shortcut in Eclipse which would show the references of the selected Java class elsewhere. Presently I right click on the Java class and select References.

It would be great if I could be told the shortcut for this.

Is there a guide which I could refer to, to find out the most-used Eclipse shortcuts ?

Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91
Crazy4Java
  • 269
  • 2
  • 6
  • 13
  • Take a look at this: http://stackoverflow.com/questions/461743/is-there-anyway-to-modify-the-keyboard-shortcuts-in-eclipse – Vikdor Aug 21 '12 at 16:55

2 Answers2

2

Finding references in Eclipse is done by the CTRL + SHIFT + G keyboard shortcut. Just makes sure the mouse cursor is on the class and use the key combination. The same shortcut works for method or variables.

Dan D.
  • 32,246
  • 5
  • 63
  • 79
0

To find all References of selected item in Workspace : CTRL + SHIFT + G
To find all References of selected item in Current class : CTRL + U

Learning Eclipse Shortcuts

If you are starting out with Eclipse Shortcuts, I would suggest that it might not we worthwhile trying to learn them by just reading them.

Suggested strategy to remember shortcuts

Try this out :

  1. Identify the one activity/action that you do most often.
    Examples :
    Open Resource (CTRL + SHIFT + R) which allows you to search for and open a file in the workspace.
    Switch Between Tabs (CTRL + Page Up or Page Down )

  2. Once you have identified the oft-used activity above, USE IT as often as possible ( which shouldn't be difficult given the fact that we identified an oft-used action to start with)

  3. Repeat :)

Tip - Shortcut groups

It might be useful to remember shortcut Groups. Many a time you'll find that they are intuitive and easily lend themselves to memorization.

Example - The Execute Group of Shortcuts

Eclipse has this concept of multi-key shortcuts (something that I had not come across before Eclipse) which require you to press a sequence of Characters ( such as Alt + Shift + X) and then another Character after it. This allows the 'grouping' of related shortcuts.

For instance to Execute pretty much anything you first press ALT + SHIFT + X and then another character depending upon what you are executing. Thus, one would use the following combinations :
ALT + SHIFT + X, J : To execute the main method of a Java class
ALT + SHIFT + X, T : To run a Junit Test (this would run a specific test or all the test in the class depending upon the position of the cursor when this shortcut is pressed)

The above are easy to remember as Alt + Shift + X ecute, a J ava class or a JUnit T est.

Now the beauty of this is, once you are used to the above shortcuts you change X ecute to D ebug and just like that you have two new shortcuts to Run a Java class or JUnit test in debug mode.

Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91