0

when we use eclipse

inside the class we type

"main"

then hit CTRL+ENTER

and suddenly whole definition of the main is written in the class file in eclipse editor

suppose i have a method

void myAwesomeMethod(String string)
    {
        System.out.println("===>>>Sstring is "+string);
    }

i want to create some short cut like say CTRL+SHIFT+P

which will type this whole method in my editor

how can one do it ??

or is there any library or plugin to do it in a better way ??

  • Do you really need ctrl+shift+p key combination? if not eclipse has editor templates for these situations like main method using ctrl+space then enter. take a look http://stackoverflow.com/questions/11518784/keybinding-keys-to-insert-custom-code-eclipse – İlker Korkut Dec 09 '14 at 22:29
  • yeah yeah I wanted the template stuff only , thanks a lot – Hussain Akhtar Wahid 'Ghouri' Dec 09 '14 at 22:35

1 Answers1

0

Have a look at Eclipse Editor templates, for instance here.

edi
  • 3,112
  • 21
  • 16