Inserting code templates into code

Use code templates to include frequently used blocks of code in a program.

Procedure

  1. Click the location where you want the code block. If you know the first few letters of the code block, you can type them.
  2. Press Ctrl+Spacebar.
    The content assist window opens with language element suggestions.
  3. Press Ctrl+Spacebar again.
    Tip: You can toggle the content assist window between the default pane and template pane by pressing Ctrl+Spacebar repeatedly. If you close the content assist window and open it again without changing the cursor location, it reopens on the same pane.
  4. To see a preview of the template, click the template name.
    A text box opens showing the content of the template
  5. Double-click a template name to include it in the source file.