blob: ac5ceee64c393353b41fc771a862a40499dbd2e0 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 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
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/ -->
<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Editing snippet items</title>
<body id="tsrcedt022"><a name="tsrcedt022"><!-- --></a>
<h1 class="topictitle1">Editing snippet items</h1>
<div><p>This documentation describes how to modify the template code that
is in an item in a drawer in the Snippets view.</p><div class="skipspace"> To modify an existing item in a Snippets drawer, complete the steps
listed below. If you have just completed the task <a href="tsrcedt015.html">Adding an item to a snippets drawer</a> and the <span class="wintitle">Customize
Palette</span> window is still open, you can skip steps 1 and 2.</div>
<ol><li class="skipspace"><span>In the Snippets view, right-click the name of the item that you
want to modify, and select <span class="uicontrol">Customize</span>.</span></li>
<li class="skipspace"><span>Optionally, type a new name and a new description for the item.</span></li>
<li class="skipspace"><span>To declare a variable, click <span class="uicontrol">New</span> and type
the variable's name, description, and default value.</span></li>
<li class="skipspace"><span>To edit an existing variable, type over the existing values.</span></li>
<li class="skipspace"><span>To edit the <span class="uicontrol">Template Pattern</span> field, type
into the field, cut and paste into the field, or, if you have defined one
or more variables, click the <span class="uicontrol">Insert Variable Placeholder</span> button,
and double-click the name of the variable that you want to insert.</span> For
example, if you have declare variables named <var class="varname">uri</var> and <var class="varname">prefix</var>,
clicking the button brings up a menu that contains those names. Double-clicking <var class="varname">uri</var> inserts <samp class="codeph">${uri}</samp>,
as in the following example:<pre>&lt;%@ taglib uri="${uri}" prefix="${prefix}" %&gt;</pre>
Later, when you insert the snippet into a file, <samp class="codeph">${uri}</samp> and <samp class="codeph">${prefix}</samp> are
each converted to the default value declared in the Variables table. Users
can replace the default values in the <span class="uicontrol">Insert Template:</span><var class="varname">Item_name</var> dialog
at insertion time.</li>
<li class="skipspace"><span>Click <span class="uicontrol">OK</span>.</span></li>
<div class="skipspace">The modified item will be added to the list of items in the appropriate
<div><p><b class="relconceptshd">Related concepts</b><br />
<a href="csrcedt001.html" title="This documentation gives an overview of the Snippets view.">Snippets view</a><br />
<p><b class="reltaskshd">Related tasks</b><br />
<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><br />
<a href="tsrcedt014.html" title="This documentation explains how to customize the Snippets view by adding a new drawer.">Adding snippets drawers</a><br />
<a href="tsrcedt015.html" title="This documentation describes how to add a new item to a drawer in the Snippets view.">Adding items to snippets drawers</a><br />
<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><br />