26 May 2011

Code templates

Intro
Code template is for example sop.
So, if you write: sop and you Press Ctrl+ Enter,
JDeveloper editor will replace it with System.out.println();

You can see the existing Code Templates under
Tools -- Preferences --Code Editor --- Code Templates

You can write sop in the Search box to quickly find sop

Write your own
Let's write a template for a think a developer performs frequently. A template for logger.debug();
Click +
Under Shortcut you add: logd . This is the string you want to type. 
Under Context you choose the "place" this template will be prompted. In this case Java.
Under Code tab the text that will replace the logd when pressing Ctrl+Enter, which will be logger.debug($end$);  The $end$ indicated where the cursor will be placed for you to write after inserting the logger.debug();. So, logger.debug(); will be inserted and you ll start to write after (.



No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...
There was an error in this gadget