The Template Tree Window

sTemplate Tree

Templates

The function templates define the structure of the functions and are used to build functions. Function templates don't belong to projects, but to the machine: every machine, local in the Matrex desktop or remote in a Matrex server, has a set of templates.
You can add or change function templates (also remove them). You can build your own library of templates and, if you like, share it with others.

Templates are composed by: It is only possible to add, update or delete templates on the local machine (in the Matrex desktop). The template tree window on remote machines is read-only and does not have a context menu. The reasons for this are:
When a template is complete and tested it can be copied to a server, together with the underlying code. If the code consists of a jar file, it has to be copied manually.

The locations (directories and jar files) for templates definitions, code and script languages can be defined using the files locations dialog.

The template tree window contains:

As with the other trees, if you know at least a part of the name-package of the template, just write it on the search bar on the top of the templates tree and either press�enter or click on the green arrow button. The first template matching the text in the search bar gets visualized and selected. Pressing again enter or clicking on the green arrow button selects the next matching template, and so on.

The tree's popup menu

Clicking with the right mouse button on an item in the Function templates tree, the popup menu to add, edit or delete templates appears.
In general the templates that are located under the sys root package are considered system template and cannot be edited or deleted, so for these templates some of the menu entries are disabled.
From this menu you can:

Add a template

The menu item New template opens the template editor, used to add templates.

Edit a template

Edit the selected item with the Edit Template menu. The template editor opens, with the entered input and output matrices definitions and parameter definitions in place. You can change them and save the template again. Disabled for system templates.

Remove a template

Remove the selected item with the Remove Template menu.
This is a very risky operation, because there can be functions in some projects that are built on that template and will not work again when the template is removed. Therefore it is requested to confirm.
Disabled for system templates.

Rename a template

Rename the selected item with the Rename Template menu. This is a very risky operation, because there can be functions in some projects that are built on that template and will not work again when the template changes its name. Therefore a confirmation is requested.
After you confirmed the choice, you can rename the template using the name-package dialog. The template is renamed, both in the template tree view and as file.

There is no view menu, because it does not make sense to view a template.
Disabled for system templates.

Add a template with the content of the selected template

Add a template that has initially the content of the selected template with the New Template From menu. This is useful if the template you want to create is very similar to an existing template. It opens the template editor , populating its fields with the content of the selected template.

The template tree top menu


Menu Template

The menu on the top of the template tree has the expand and collapse choices like the other trees, but it has two more choices:

Search a template

You can do a full text search on the templates descriptions. In the top menu select the Search menu and search the template with the template search dialog that appears.

Build an HTML page listing all templates

In the top menu select the Build HTML Page menu.
This will save an HTML page with all the templates, their description, matrices and parameter definitions in the file that you choose.