Eclipse Templates

31 December 2007

Eclipse Templates are used to make programming easier and simpler. Eclipse IDE provides many templates by default which can be used to save time. Also one can add more templates as required. In this post, I will briefly write about creating and using templates in Eclipse.

Open the preferences window in Eclipse. Under Java > Editor you will find Templates. Click it and you will see the available templates in the right had side window.

Templates

Using templates while coding is simple. Write the name of the template and then press Ctrl+Space and then finally Enter. You will get the required code.

For example, you use the template for loop, type for and then press Ctrl+Space, you will get a list of available templates with name “for”.

For Templates

Making own template is also very simple. For instance you want to create a template to declare an ArrayLype bounded by String:

ArrayList<String> arrayList = new ArrayList<String>();

Simple go to preferences window and add a new template under Java > Editor > Templates.

Play around and explore more.

del.icio.us:Eclipse Templates  digg:Eclipse Templates  spurl:Eclipse Templates  wists:Eclipse Templates  simpy:Eclipse Templates  newsvine:Eclipse Templates  blinklist:Eclipse Templates  furl:Eclipse Templates  reddit:Eclipse Templates  fark:Eclipse Templates  blogmarks:Eclipse Templates  Y!:Eclipse Templates  smarking:Eclipse Templates  magnolia:Eclipse Templates  segnalo:Eclipse Templates  gifttagging:Eclipse Templates

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Eclipse Templates

Leave a Reply