Maintaining Text Templates

To make it easier for your development team or teams to adhere to your development standards, Jade enables you to define or modify text templates for all of your Jade:

To add or change your default text template options

  1. In the Preferences or Jade Installation Preferences dialog, click the Text Templates sheet.

    The Method folder is then displayed, enabling you to define or modify the template that is included in the method source when a method is created.

    You can specify the variable elements listed in the following table for all Jade methods, classes, class constants, properties, methods, and interfaces that are defined after the template definition.

    Element Syntax   Description
    Name <entity-type>Name: #<entity-type>Name Name of the created entity
    Date Date created: #date Current system date in the format of your locale
    Developer Created by: #userId ID of the user who defined the entity
    Patch number Patch Number: #patchNumber Current patch number or blank, if none

    When you create an entity, these elements are expanded to include the entity name, the user code of the user who added the entity, the date that it was created, and the current patch number of the user or blank if there is no current patch number.

    To ensure that your methods compile without syntax errors, you must enclose your variable template elements (that is, the entity type name, date, patch number, and user id) within stroke asterisk (/*) and asterisk stroke (*/) character strings.

    As the variable options are case-sensitive, ensure that you specify these exactly as shown in this table; that is, #<entity-type>Name (for example, #methodName), #date , #patchNumber, and #userId.

    You can specify other elements between the stroke asterisk (/*) and asterisk stroke (*/) character strings in a text template; for example, if you were to specify a Usage: element in a method template, developers could then enter free-format text to document the usage of the method.

    The following example shows the text template for a new Jade method.

    /*
    Date created: #date
    Created by:   #userId
    Method Name:  #methodName
    Patch Number: #patchNumber
    
    Usage:
    */
    vars
    
    begin
    
    end;

    As the editor pane displays only what was defined in your method template, the vars, begin, and end; statements in the above example were also specified in the template, following the asterisk stroke (*/) character strings.

    When adding a condition method using a template, the text template strips out the vars and epilog sections if they had been included in your template.

    The following example shows the text template output for a new property.

    ***************************
    Date created: 23 February 2018 Created by: Wilbur Property name: salePrice Patch Number: Usage: ***************************
  2. To define or modify a text template for a class, click the Class tab and then enter in the text box the text that your require for all classes; for example, your Jade class naming conventions.

    Alternatively, click the Property tab, Constant tab, or Interface tab, and then enter in the text box the text that your require for all properties, class constants, or interfaces, respectively.

All Jade classes, properties, class constants, methods, and interfaces that you then define in the current Jade development database have the elements specified in your template automatically displayed in the editor pane when you select the applicable Add or New… command from the corresponding Class or Primitive Types Browser menu (for example, the Add command from the Classes menu or the New Jade Method command from the Methods menu).