4

When I enter an inner type using fast complete feature of eclipse, it uses some template to generate it.

What I get is seen at left side, what I want is shown at right side of picture. Problem Description Picture

What I want is to remove empty line and auto-generated method stub thing, how can I manage this?

dogbane
  • 266,786
  • 75
  • 396
  • 414
guness
  • 6,336
  • 7
  • 59
  • 88

1 Answers1

1
  • Removing TODO: WindowPreferencesJavaCode StyleCode Templates.

    (Remove // ${todo} Auto-generated method stub from Method body inside Code tree).

  • Removing empty lines: WindowPreferencesJavaFormatterEditBlank LinesBefore First Declaration = 0.

You'll see many options there and you can set it as you wish.

Maroun
  • 94,125
  • 30
  • 188
  • 241
  • I think you can just remove the newline in the Class body code template instead of editing the White Space preferences. – Danny Feb 19 '13 at 14:39
  • Indeed. But that holds only for classes, if he wants to customize it as he want, he has more flexibility in the `Blank Lines` tab. – Maroun Feb 19 '13 at 14:42
  • I managed to remove TODO, but stuck at first line, which body should I remove? – guness Feb 19 '13 at 14:43
  • @bluebrain See the second point in my answer, there you should be able to manage new lines (whether should or not they be there) – Maroun Feb 19 '13 at 14:44
  • ok, I fount it, ty. btw formatter is "Window → Preferences → Java → Code Style" in my eclipse – guness Feb 19 '13 at 14:51
  • I understand that the second option will fix. But how do I format only the anonymous inner class? – JohnH Dec 19 '13 at 14:01