Eclipse Template Editor plugin
From Chunk Java Template Engine
(Difference between revisions)
Tom McClure (Talk | contribs) (→Installing the plugin) |
Tom McClure (Talk | contribs) |
||
Line 1: | Line 1: | ||
== Installing the plugin == | == Installing the plugin == | ||
- | # | + | # From the Eclipse "Help" menu, select "Install New Software..." |
- | # | + | # Enter http://www.x5software.com/chunk/tools (either in "Work with" or by adding a repository). |
- | # | + | # Check the box next to the "Chunk Templates" category and click "Next." |
- | + | # Agree to the license terms and hit "OK" if you see a warning about the plugin not being signed. | |
+ | # Finish and restart Eclipse. | ||
# In Eclipse Preferences, find settings panel for File Associations. Should be in | # In Eclipse Preferences, find settings panel for File Associations. Should be in | ||
#* General -> Editors -> File Associations | #* General -> Editors -> File Associations | ||
Line 12: | Line 13: | ||
#** "HTML Chunk Template Editor" | #** "HTML Chunk Template Editor" | ||
# Repeat step 5 for *.cxml (and whatever other extensions you wish to use for your templates). | # Repeat step 5 for *.cxml (and whatever other extensions you wish to use for your templates). | ||
- | # (Optional) Add "Chunk Template Editor" to the list of available editors for *.html files. I make it the default but of course this is up to you. | + | # (Optional) Add "Chunk Template Editor" to the list of available editors for *.html files. Personally I make it the default but of course this is up to you. |
Line 23: | Line 24: | ||
And from within your java code, right-click a template name anywhere in your code and select "Open Snippet" to jump to the definition. | And from within your java code, right-click a template name anywhere in your code and select "Open Snippet" to jump to the definition. | ||
+ | Known bug: if your project contains multiple templates with the same name it will just jump to the first filename match. | ||
=== UTF-8 === | === UTF-8 === |
Revision as of 04:36, 2 January 2015
Installing the plugin
- From the Eclipse "Help" menu, select "Install New Software..."
- Enter http://www.x5software.com/chunk/tools (either in "Work with" or by adding a repository).
- Check the box next to the "Chunk Templates" category and click "Next."
- Agree to the license terms and hit "OK" if you see a warning about the plugin not being signed.
- Finish and restart Eclipse.
- In Eclipse Preferences, find settings panel for File Associations. Should be in
- General -> Editors -> File Associations
- Click the Add... button and add *.chtml
- Select *.chtml and click the other "Add..." button down by the "Associated Editors" list below.
- From the list of "Internal Editors" (make sure "External Programs" is not checked), scroll down and select
- "HTML Chunk Template Editor"
- Repeat step 5 for *.cxml (and whatever other extensions you wish to use for your templates).
- (Optional) Add "Chunk Template Editor" to the list of available editors for *.html files. Personally I make it the default but of course this is up to you.
Hooray! Syntax highlighting! Outline view!
Bonus: Snippet Hyperlinks
Template references are hyperlinked! Cmd-click any template reference to jump to that snippet's definition.
And from within your java code, right-click a template name anywhere in your code and select "Open Snippet" to jump to the definition. Known bug: if your project contains multiple templates with the same name it will just jump to the first filename match.
UTF-8
The Chunk template engine, as of 1.5, assumes that your templates use charset UTF-8. If you use any accented or unusual characters in your templates, I strongly recommend to Eclipse users that you set your workspace default charset to UTF-8.
Eclipse -> Preferences -> General -> Workspace -> Text file encoding -> UTF-8