Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the different eclipse shortcuts available?

Tags:

java

eclipse

I wanted to know the different eclipse shortcuts available like when we wanted to write this

System.out.println(); then we simply write syso and hit ctrl+space then we get System.out.println();.I do not want shortcuts like for copy ctrl+c or to cut ctrl +X

screenshot of templates

enter image description here

like image 709
SpringLearner Avatar asked Dec 26 '22 20:12

SpringLearner


2 Answers

These are called "editor templates", and you can see the full list in

Window --> Preferences --> Java --> Editor --> Templates

You can also create your own there, with various placeholders, e.g. I have one isequalto defined like this:

${:importStatic(org.fest.assertions.api.Assertions.assertThat)}assertThat(${actual}).isEqualTo(${expected});

This will automatically add a static import and add cursor positions that can be navigated to with TAB. This can be invoked by typing isequalto (or just ise) and ctrl+SPACE.

For a try/catch bock, just type try and ctrl+SPACE.

like image 155
herman Avatar answered Dec 28 '22 10:12

herman


What you're looking for are not shortcuts, but Templates.

Open Window -> Preferences -> Java -> Editor -> Templates and you'll see the full list.

You can even add your own templates.

like image 25
Joachim Sauer Avatar answered Dec 28 '22 08:12

Joachim Sauer