Adding and Managing Visual Web JSF Code Clips

See Also | Tutorials

Code clips are snippets of code in the   that you can use in your applications. You can insert a code clip into code that is open in an IDE source editor, such as the Java Editor or the JSP Editor. You can also add new code clips to the Palette from any editor. In addition, you can rename, edit, or delete code clips in the Palette.

The Code Clips palette has the following categories:

To use a clip in your code:

  1. Open your code in the Java Editor or the JSP Editor, depending on the type of code clip and where you want it to go.
  2. Drag the code clip from the Palette to the location where you want it in the source editor.

To add a clip to the Palette by dragging a selection:

  1. With the source file open in the Java or JSP editor, drag the cursor to select the code you want to make into a clip.
  2. Ctrl-Click in the selected area and drag the code to the Palette category where you want the clip to be listed.
  3. Right-click the new code clip in the Palette and choose Rename to give it an appropriate name.

To add a clip to the Palette by typing code:

  1. In the Code Clips view of the Palette, right-click the category where you want to add the clip and choose Create New Code Clip.
  2. In the Code Clips Editor, type the text.
  3. Click Save Changes.
  4. Right-click the new code clip in the Palette and choose Rename to give it an appropriate name.

To edit a clip:

  1. In the Palette, right-click the code clip and choose Edit Code Clip.
  2. In the Code Clips Editor, edit the text and click OK.

To delete a clip:

To add a category to the Code Clips view:

  1. Right-click any category and choose Create New Category.
  2. Enter the name of the new category in the New Palette Category dialog box, and then click OK.

To delete a category from the Code Clips view:

  1. Right-click the category you want to delete and choose Delete Category.
  2. When the delete confirmation dialog box appears, click Yes.
See Also
About Components
Component Tasks: Quick Reference
Tutorials

Legal Notices