| <?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> |
| <head> |
| <link rel="stylesheet" type="text/css" href="../../com.ibm.help.doc/swg_info_common.css" /> |
| <title>Editing snippet items</title> |
| <script language="JavaScript"> |
| function popup_window( url, id, width, height ) |
| { |
| popup = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + ',left=,top=' ); |
| popup.focus(); |
| } |
| </script><script language="JavaScript" src="help/liveHelp.js"></script></head> |
| <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><%@ taglib uri="${uri}" prefix="${prefix}" %></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> |
| </ol> |
| <div class="skipspace">The modified item will be added to the list of items in the appropriate |
| drawer.</div> |
| </div> |
| <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> |
| <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 /> |
| </p> |
| </div><p> |
| (C) Copyright IBM Corporation 2000, 2005. All Rights Reserved. |
| </p> |
| </body> |
| </html> |