blob: 72bcceb2113e56a6145956fd04e79d4800737e63 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<task id="tsrcedt015" xml:lang="en-us">
<title>Adding items to snippets drawers</title>
<keywords><indexterm keyref="tsrcedt015|2|snippetitemsaddingtodrawers" status="changed">snippets<indexterm>drawers</indexterm></indexterm>
<context> To add new items to an existing snippets drawer:</context>
<step><cmd>Do one of the following choices:</cmd><info><table colsep="0" frame="topbot">
<tgroup cols="2"><colspec colname="col1" colwidth="72*"/><colspec colname="col2"
<entry colname="col1" valign="top">To start with this:</entry>
<entry colname="col2" valign="top">Do this:</entry>
<entry colname="col1">An empty item that you can edit</entry>
<entry colname="col2">Right-click anywhere in an existing drawer, select <uicontrol>Customize</uicontrol>,
and click <menucascade><uicontrol>New</uicontrol><uicontrol>New Item</uicontrol>
<entry colname="col1">Existing text pasted into a new item in an existing
<entry colname="col2">Copy or cut text to the clipboard. In the Snippets view,
right-click anywhere in an existing drawer and click <uicontrol>Paste</uicontrol>.</entry>
<entry colname="col1">Existing text pasted into a new item in a new or existing
<entry colname="col2">Select the text, right-click, click <uicontrol>Add to
Snippets</uicontrol>, specify the name of the drawer in the Snippets view
to which you want to add the item, and click <uicontrol>OK</uicontrol>.</entry>
</table></info><stepresult>A <wintitle>Customize Palette</wintitle> window
<step><cmd>Type a name for the new item, and, optionally, provide a description.</cmd>
<stepresult>The value that you type in the <uicontrol>Name</uicontrol> field
will appear next to the item's icon in the Snippets view.</stepresult></step>
<step><cmd>To include in the <uicontrol>Template Pattern</uicontrol> field
a variable that you have already defined, click <uicontrol>Insert Variable
Placeholder</uicontrol>. </cmd><info>A variable placeholder is a marker that,
when tagging is inserted into the active file, will be replaced by the value
that is entered into the <uicontrol>Insert Template:</uicontrol><varname>Item_name</varname> dialog
at insertion time. Clicking the <uicontrol>Insert Variable Placeholder</uicontrol> button
or typing Ctrl+Space activates a pop-up in the text area that prompts you
with the correct sequences to create a marker for the variable.</info><stepxmp>For
example, if you create two variables named <varname>uri</varname> and <varname>prefix</varname>,
and create variable placeholders for both, the template pattern might look
like this:<codeblock>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %></codeblock></stepxmp>
<step><cmd>Click <uicontrol>OK</uicontrol>.</cmd></step>
<result>The new item will be added to the list of items in the appropriate
<linkpool type="concept">
<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
<linkpool type="task">
<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or