Code Templates Preferences

Code templates are code fragments that can be inserted at the current editing position. Oxygen XML Developer comes with a set of built-in templates for CSS, LESS, Schematron, XSL, XQuery, and XML Schema document types. You can also define your own code templates and share them with your colleagues using the template export and import functions.

To configure Code Templates, open the Preferences dialog box and go to Editor > Templates > Code Templates.

This preferences page contains a list of all the available code templates (both built-in and custom created ones) and a code preview area. You can disable any code template by deselecting it.

The following actions are available:

New
Opens the Code template dialog box that allows you to define a new code template. You can define the following fields:
  • Name - The name of the code template.
  • Description - The description of the code template that will appear in the Code Templates preferences page and in the tooltip message when selecting it from the Content Completion Assistant. HTML markup can be used for better rendering.
  • Associate with - You can choose to set the code template to be associated with a specific type of editor or for all editor types.
  • Shortcut key - Allows you to configure a shortcut key that can be used to insert the code template. The + character separates keys. If the Enable platform-independent shortcut keys checkbox is enabled, the shortcut is platform-independent and the following modifiers are used:
    • M1 represents the Command key on MacOS X, and the Ctrl key on other platforms.
    • M2 represents the Shift key.
    • M3 represents the Option key on MacOS X, and the Alt key on other platforms.
    • M4 represents the Ctrl key on MacOS X, and is undefined on other platforms.
  • Content - Text box where you define the content that is used when the code template is inserted.
Edit
Opens the Code template dialog box and allows you to edit an existing code template. You can edit the following fields:
  • Description - The description of the code template that will appear in the Code Templates preferences page and in the tooltip message when selecting it from the Content Completion Assistant. HTML markup can be used for better rendering.
  • Shortcut key - Allows you to configure a shortcut key that can be used to insert the code template. The + character separates keys. If the Enable platform-independent shortcut keys checkbox is enabled, the shortcut is platform-independent and the following modifiers are used:
    • M1 represents the Command key on MacOS X, and the Ctrl key on other platforms.
    • M2 represents the Shift key.
    • M3 represents the Option key on MacOS X, and the Alt key on other platforms.
    • M4 represents the Ctrl key on MacOS X, and is undefined on other platforms.
  • Content - Text box where you define the content that is used when the code template is inserted.
Duplicate
Creates a duplicate of the currently selected code template.
Delete
Deletes the currently selected code template. This action is disabled for the built-in code templates.
Export
Exports a file with code templates.
Import
Imports a file with code templates that was created by the Export action.
You can use the following editor variables when you define a code template in the Content text box:
Related information
Parent topic: Templates Preferences Previous topic: Templates Preferences Next topic: Document Templates Preferences