blob: e1195f90f8a99085c5403db0fa8b8fdce54a844c [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2005, v.4002-->
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
"..\dtd\task.dtd">
<task id="tsrcedt015" xml:lang="en-us">
<title>Adding items to snippets drawers</title>
<prolog><metadata>
<keywords><indexterm>snippet drawers<indexterm>adding items</indexterm></indexterm>
<indexterm>snippet items<indexterm>adding to drawers</indexterm></indexterm>
</keywords>
</metadata></prolog>
<taskbody>
<context> To add new items to an existing snippets drawer::</context>
<steps>
<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"
colwidth="127*"/>
<thead>
<row>
<entry colname="col1" valign="top">To start with this:</entry>
<entry colname="col2" valign="top">Do this:</entry>
</row>
</thead>
<tbody>
<row>
<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>
</menucascade>.</entry>
</row>
<row>
<entry colname="col1">Existing text pasted into a new item in an existing
drawer</entry>
<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>
</row>
<row>
<entry colname="col1">Existing text pasted into a new item in a new or existing
drawer</entry>
<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>
</row>
</tbody>
</tgroup>
</table></info><stepresult>A <wintitle>Customize Palette</wintitle> window
appears.</stepresult></step>
<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>
<step><cmd>Click <uicontrol>OK</uicontrol>.</cmd></step>
</steps>
<result>The new item will be added to the list of items in the appropriate
drawer.</result>
</taskbody>
<related-links>
<linkpool type="concept">
<link href="csrcedt001.dita"><linktext>Snippets view</linktext></link>
</linkpool>
<linkpool type="task">
<link href="tsrcedt026.dita"><linktext>Editing with snippets - overview</linktext>
</link>
<link href="tsrcedt014.dita"><linktext>Adding snippets drawers</linktext>
</link>
<link href="tsrcedt022.dita"><linktext>Editing snippet items</linktext></link>
<link href="tsrcedt016.dita"><linktext>Deleting or hiding snippet items or
drawers</linktext></link>
</linkpool>
</related-links>
</task>