Eclipse

De WikiMar
Dreceres ràpides: navegació, cerca

Search

  • CTRL + H

Search Dialog

  • CTRL + J

Incremental search. Similar to the search in firefox. It shows you results as you type. Don't be surprised, if you hit this combination, nothing happens - at the first glance. Just start typing and eclipse will move your cursor to the first ocurence.


  • CTRL+SHIFT+G

Find References of the selected text. When it is used?

  • F3 or CTRL+G ?

Open Declaration. When is it declared? Drills down to the declaration of the type, method, or variable the cursor is on. This works much like a browser hyperlink.


  • CTRL+SHIFT+T

Open Type. Imagine, that you need to have a look at the Foo class. But, where is the Foo class? Is it in the Boo project and in the foo.bar package? Or somewhere else? With this shortcut, you don't need to know. Just press it, type Foo and you are in.

  • 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+L

Go to Line Go to a specific line number.

  • Ctrl + Q

Go to the last edit location

  • ALT + Left/Right Arrow

Move to the last location you edited. Imagine you just created a class Foo, and now you are working on a class Boo. Now, if you need to look at the Foo class, just press Alt+Left Arrow. Alt+Right Arrow brings you back to Boo.


Edit

  • ALT + Up/Down Arrow

Move the row (or the entire selection) up or down. Very useful when rearranging code. You can even select more rows and move them all. Notice, that it will be always correctly indented.

  • CTRL + I

Corrects indentation.

  • CTRL + SHIFT + F

Formats code. You can make a beautiful looking code out of a mess with this. It requires a bit of setup, but it is well worth it. You can find its settings under Window->Preferences->Java->Code style->Formatter


Run

  • CTRL + F11

Runs the application. What gets launched depends on your settings. It will either launch the last launched class (my preffered way) or it will launch currently selected resource (the default way). If you want to change its behavior read the previous post.


Help

  • Ctrl+Space

Content Assist. Context sensitive content completion suggestions while editing Java code.

  • CTRL + 1

Error assistant