blob: 2c928aa4386d99a71c62dda99f8d92278837f920 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Adding items to snippets drawers" />
<meta content="snippet drawers, adding items to, snippet items, adding to drawers" name="DC.subject" />
<meta content="snippet drawers, adding items to, snippet items, adding to drawers" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="csrcedt001.html" />
<meta scheme="URI" name="DC.Relation" content="tsrcedt026.html" />
<meta scheme="URI" name="DC.Relation" content="tsrcedt014.html" />
<meta scheme="URI" name="DC.Relation" content="tsrcedt022.html" />
<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="tsrcedt015" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Adding items to snippets drawers</title>
</head>
<body id="tsrcedt015"><a name="tsrcedt015"><!-- --></a>
<h1 class="topictitle1">Adding items to snippets drawers</h1>
<div>
<div class="section"> To add new items to an existing snippets drawer::</div>
<ol>
<li class="stepexpand"><span>Do one of the following choices:</span>
<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="hsides" border="1" rules="rows">
<thead align="left">
<tr>
<th valign="top" width="36.18090452261307%" id="N10079">To start with this:</th>
<th valign="top" width="63.81909547738693%" id="N10081">Do this:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" width="36.18090452261307%" headers="N10079 ">An empty item that you can edit</td>
<td valign="top" width="63.81909547738693%" headers="N10081 ">Right-click anywhere in an existing drawer, select <span class="uicontrol">Customize</span>,
and click <span class="menucascade"><span class="uicontrol">New</span> &gt; <span class="uicontrol">New Item</span>
</span>.</td>
</tr>
<tr>
<td valign="top" width="36.18090452261307%" headers="N10079 ">Existing text pasted into a new item in an existing
drawer</td>
<td valign="top" width="63.81909547738693%" headers="N10081 ">Copy or cut text to the clipboard. In the Snippets view,
right-click anywhere in an existing drawer and click <span class="uicontrol">Paste</span>.</td>
</tr>
<tr>
<td valign="top" width="36.18090452261307%" headers="N10079 ">Existing text pasted into a new item in a new or existing
drawer</td>
<td valign="top" width="63.81909547738693%" headers="N10081 ">Select the text, right-click, click <span class="uicontrol">Add to
Snippets</span>, specify the name of the drawer in the Snippets view
to which you want to add the item, and click <span class="uicontrol">OK</span>.</td>
</tr>
</tbody>
</table>
</div>
A <span class="wintitle">Customize Palette</span> window
appears.</li>
<li class="stepexpand"><span>Type a name for the new item, and, optionally, provide a description.</span>
The value that you type in the <span class="uicontrol">Name</span> field
will appear next to the item's icon in the Snippets view.</li>
<li class="stepexpand"><span>To include in the <span class="uicontrol">Template Pattern</span> field
a variable that you have already defined, click <span class="uicontrol">Insert Variable
Placeholder</span>. </span> 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 <span class="uicontrol">Insert Template:</span><var class="varname">Item_name</var> dialog
at insertion time. Clicking the <span class="uicontrol">Insert Variable Placeholder</span> 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. For
example, if you create two variables named <var class="varname">uri</var> and <var class="varname">prefix</var>,
and create variable placeholders for both, the template pattern might look
like this:<pre>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %&gt;</pre>
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
</ol>
<div class="section">The new item will be added to the list of items in the appropriate
drawer.</div>
</div>
<div><div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="csrcedt001.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags.">Snippets view</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="tsrcedt026.html" title="The Snippets view lets you catalog and organize reusable programming objects, such as HTML tagging, JavaScript, and JSP code, along with files and custom JSP tags. The view can be extended based on additional objects that you define and include.">Editing with snippets - overview</a></div>
<div><a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a></div>
<div><a href="tsrcedt022.html" title="">Editing snippet items</a></div>
<div><a href="tsrcedt016.html" title="This documentation describes how to delete or hide drawers and items in the Snippets view.">Deleting or hiding snippet items or
drawers</a></div>
</div>
</div>
</body>
</html>