You can reuse code snippets by setting up and using code
templates in Streams Studio. You can create code templates, edit existing
code templates, export, or import code templates, or customize the
default code templates that are included in Streams Studio.
Procedure
- From the menu, click .
- In the Preferences window, expand and click Templates to display
the Templates window.
- To import an existing template:
- Click Import and browse to the
directory that contains code templates that you want to import.
- Select the XML file that contains the code template
definitions, and click OK.
- To export an existing template:
- In the Templates window, select
the templates that you want to export, and click Export.
- Optional: In the Export Templates window,
enter the file name to store the exported templates.
- Browse to the directory where you want to save the template,
and click OK.
- To create a new template:
- In the Templates window, click New.
- In the Name field, enter a name
for the template.
- From the Context list, select
the context for the new template.
- Optional: In the Description field,
enter a description for the template.
- In the Pattern field, enter the
code snippet, and click OK.
- To edit an existing template:
- In the Templates window, select
a code template that you want to modify, and click Edit.
- In the Edit Template window, you
can change the name, context, or description of the template.
- In the Pattern field, you can
modify the code snippet, and click OK.