Using Snippets in Eclipse

2,105 views
Skip to first unread message

dleber

unread,
Mar 3, 2007, 1:02:31 PM3/3/07
to wotips
Maybe I'm slow, but I've recently discovered Snippets in Eclipse and
I've been using them with the Component Editor and have found it
helpfull.

Invoke the Snippets view by selecting "Window Menu-> Show View ->
Others". In the Show View window, select "General -> Snippets" and
click OK.

Drag the view to where you want it in the perspective (I usually place
it below the Outline view)

Adding a snippet is as simple as control clicking in a chunck of text
and selecting "Add to Snippets" you will be given the oportunity to
edit the snippet, add it to a group, and specify replacement
variables.

I've created a WebObjects Snippets group and have the following:

webobject element
webobject container
webobject open
webobject close
WOComponent template

I'm sure you will come up with others.

dfr...@gmail.com

unread,
Mar 5, 2007, 7:10:00 AM3/5/07
to wotips
One can also use HTML Template for this task which can be accessed in
html editor with Ctrl+Space.

Eclipse - Window - Preferences - Web and XML - HTML Files - HTML
Templates

Example templates:

<webobject name="${cursor}"></webobject>
<webobject name="${cursor}" />

Reply all
Reply to author
Forward
0 new messages