blob: bd58a0e2f78425c287c4f3dfe8ff707396189c9a [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html lang="en-us" xml:lang="en-us">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2008 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" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "" l gen true r (n 0 s 0 v 0 l 0) "" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Editing snippet items" />
<meta content="snippets, editing items" name="DC.subject" />
<meta content="snippets, editing items" 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="tsrcedt015.html" />
<meta scheme="URI" name="DC.Relation" content="tsrcedt016.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="tsrcedt022" 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>Editing snippet items</title>
<body id="tsrcedt022"><a name="tsrcedt022"><!-- --></a>
<h1 class="topictitle1">Editing snippet items</h1>
<div class="section"> 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>
<li class="stepexpand"><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="stepexpand"><span>Optionally, type a new name and a new description for the item.</span>
<li class="stepexpand"><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="stepexpand"><span>To edit an existing variable, type over the existing values.</span>
<li class="stepexpand"><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="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
<div class="section">The modified item will be added to the list of items in the appropriate
<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 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="tsrcedt015.html" title="">Adding items to snippets drawers</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