15

I mean stuff like typing "iter" and getting a "for" loop with a choice of what variable to iterate on , typing "soutv" to generate a "System.out.println" with the "variable=" already in ...

Thanks !

akapulko2020
  • 1,079
  • 2
  • 22
  • 36

4 Answers4

25

It is called Templates and it's found under,

Window → Preferences → Java → Editor → Templates

enter image description here

The "soutv" template does not exist ("sysout" does, and it's similar), but it's easy to add. I used this pattern:

System.out.println("variable=" + ${cursor}${});
aioobe
  • 413,195
  • 112
  • 811
  • 826
4

For 'soutv' particularly, I found the following pattern worked well in Eclipse:

System.out.println("${var} = ${cursor}" + ${var});

As others have mentioned, you can add this template by navigating to Window > Preferences > Java > Editor > Templates and clicking New.

The equivalent of 'iter' seems to be 'for' in Eclipse.

Katie J. Ots
  • 873
  • 9
  • 13
4

Check under

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

Reference:

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
0

They are called Templates.

Go to Preferences > Java > Editor > Templates to see a list of pre-defined templates.

For example, sysout is:

System.out.println(${word_selection}${});${cursor}

You can also create your own.

dogbane
  • 266,786
  • 75
  • 396
  • 414