• Stars
    star
    132
  • Rank 274,205 (Top 6 %)
  • Language
    Groovy
  • License
    Apache License 2.0
  • Created almost 12 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Thymeleaf integration plugin for the Eclipse IDE

Thymeleaf - Eclipse Plugin module

Build Status Eclipse Marketplace

A plugin for the Eclipse IDE to add content assist features for the Thymeleaf standard dialect processors and expression utility objects, using the Eclipse Web Tools Platform HTML source editor.

Autocompletion demo

Minimum Requirements

  • Java 8
  • An Eclipse IDE based on 2019-06 or newer

    This plugin has been tested with the Enterprise and Java Web Developers bundle from the Eclipse installer and Spring Tool Suite 4.7.1. STS 4.8.0+ changed the HTML editor this plugin is built atop, so it isn't guaranteed to work in those versions. However, some people have reported it still works for them so your mileage may vary.

  • A Thymeleaf 3 project

Installation

This plugin is available on the Eclipse Marketplace. Searching for "thymeleaf" in the marketplace website or client from Eclipse will bring up this plugin for installation.

Alternatively, you can install this plugin using the update site URL: https://www.thymeleaf.org/eclipse-plugin-update-site/

Or, download a ZIP archive of the plugin from the releases pages.

Features

Content Assist

Content assist features are only available for dialects which have supplied special dialect metadata files in their JARs. thymeleaf, thymeleaf-spring, thymeleaf-extras-springsecurity, and thymeleaf-extras-tiles2 projects already have such files. Other dialects, however, are up to the discretion of their developers. If you're developing a Thymeleaf dialect and would like to take advantage of content assist for your own dialect, read the section on adding content assist for your dialect.

Once those help files are available, and that the JAR is in the classpath of the project, you can make content assist available in your HTML files through 1 of 2 ways:

1. Declaring the dialect namespace and prefix in your HTML files

This is the easiest method and you may have already done this to keep the XML validator happy:

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

2. Applying the Thymeleaf project nature to your project

This method will make content assist available to all of the HTML files in your project, and is ideal for when you've organized your code to have plenty of reusable HTML fragments without a common root element on which to put the XML namespace.

To add the Thymeleaf nature to your project: right-click a project >> Thymeleaf >> Add Thymeleaf Nature.

Using either method, you should now start getting content assist for any dialect whose namespace is explicitly declared in your HTML files (method 1), or for every dialect in your project's classpath (method 2). This applies to suggestions as you type, autocompletion of what you've entered so far if it matches only one result (both of these can be invoked manually using CTRL+SPACE), and help text when hovering the cursor over a Thymeleaf processor.

Adding content assist for your dialect

The content assist features are driven by metadata about a dialect, currently done using XML files, conforming to a schema that lives at https://www.thymeleaf.org/xsd/thymeleaf-extras-dialect-2.1.xsd.

When content assist is invoked, this plugin will look for XML files in the classpath of the current project whose XML namespace is http://www.thymeleaf.org/extras/dialect. If such a file is found, it is loaded and the information in it is used to form the content assist data that the Eclipse plugin uses.

Dialect developers can take advantage of this by including XML help files as part of their dialect JARs. All you need to do is create an XML file that conforms to the schema above, then bundle that XML file with your JAR.

Some notes on where you put that file in the JAR:

  • it cannot go in the default package
  • the directory it goes in must be a valid Java package name

These are just short-comings of the current dialect scanning method, which itself is built upon Eclipse's own lookup mechanisms.

More Repositories

1

thymeleaf

Thymeleaf is a modern server-side Java template engine for both web and standalone environments.
Java
2,776
star
2

thymeleaf-extras-springsecurity

Thymeleaf "extras" integration module for Spring Security 3.x and 4.x
Java
476
star
3

thymeleaf-spring

Thymeleaf integration module for Spring
Java
432
star
4

thymeleafexamples-gtvg

Good Thymes Virtual Grocery - Companion application for the "Using Thymeleaf" tutorial downloadable at the Thymeleaf website: http://www.thymeleaf.org/documentation.html
Java
290
star
5

thymeleafexamples-layouts

Layouts - Companion application for the "Thymeleaf Layouts" article at the Thymeleaf website: http://www.thymeleaf.org/documentation.html http://www.thymeleaf.org
Java
245
star
6

thymeleafexamples-stsm

Spring Thyme Seedstarter Manager - Companion application for the "Thymeleaf + Spring 3" tutorial downloadable at the Thymeleaf website: http://www.thymeleaf.org/documentation.html
Java
184
star
7

thymeleafexamples-petclinic

Spring PetClinic + Thymeleaf- Companion application for the "Bringing Thymeleaf and Natural Templates to the Spring PetClinic" article at the Thymeleaf website: http://www.thymeleaf.org/doc/articles/petclinic.html
Java
154
star
8

thymeleafexamples-springmail

SpringMail - Companion application for the "Rich HTML email in Spring with Thymeleaf" article at the Thymeleaf website: http://www.thymeleaf.org/doc/articles/springmail.html
Java
112
star
9

thymeleaf-extras-java8time

Thymeleaf "extras" dialect for formatting and creating Java 8 Time API objects
Java
107
star
10

thymeleaf-testing

Thymeleaf testing infrastructure
Java
77
star
11

thymeleafexamples-springsecurity

SpringSecurity - Companion application for the "Login and error pages using Thymeleaf and Spring Security" article at the Thymeleaf website: http://www.thymeleaf.org/springsecurity.html
Java
66
star
12

thymeleaf-itutorial

Thymeleaf interactive tutorial
HTML
45
star
13

thymeleaf-docs

Thymeleaf documentation
CSS
44
star
14

thymeleaf-extras-tiles2

Thymeleaf integration with Apache Tiles 2.x
Java
35
star
15

thymeleafsandbox-biglist-reactive

Sandbox application testing the render of large amounts of markup using Thymeleaf with Spring Web Reactive
Java
32
star
16

thymeleaf-tests

Thymeleaf test suite
Java
30
star
17

thymeleaf-dist

Thymeleaf artifacts for distribution files, documentation and website management
HTML
26
star
18

thymeleafexamples-extrathyme

ExtraThyme - Companion application for the "Extending Thymeleaf" tutorial downloadable at the Thymeleaf website: http://www.thymeleaf.org/documentation.html
Java
24
star
19

thymeleaf-extras-conditionalcomments

Thymeleaf "extras" dialect for correctly processing IE conditional comments (for Thymeleaf 2.x)
Java
20
star
20

thymeleafexamples-thvsjsp

Thymeleaf vs JSP - Companion application for the "Spring MVC view layer: Thymeleaf vs. JSP" article at the Thymeleaf website: http://www.thymeleaf.org/thvsjsp.html
Java
17
star
21

thymeleaf.github.io

Thymeleaf website
HTML
14
star
22

thymeleafsandbox-sse-webflux

SSE (Server-Sent Events) example application using Spring 5.0, Spring WebFlux and Spring Boot 2.0 Edit Add topics
Java
14
star
23

thymeleafsandbox-stsm-reactive

Version of the STSM example application using Spring 5.0, Spring Web Reactive and Spring Boot 2.0
Java
8
star
24

thymeleafexamples-sayhello

Say Hello! - Companion application for the "Say Hello! Extending Thymeleaf in 5 minutes" article at the Thymeleaf website: http://www.thymeleaf.org/sayhelloextendingthymeleaf5minutes.html
Java
8
star
25

thymeleaf-tools

Misc tools for helping thymeleaf development
Java
5
star
26

thymeleafsandbox-springsecurity-mvc

Java
4
star
27

thymeleafsandbox-stsm-mvc

Java
3
star
28

thymeleaf-benchmarks

Thymeleaf Development Benchmarks
Java
3
star
29

thymeleafsandbox-springsecurity-reactive

Java
2
star
30

thymeleafsandbox-biglist-mvc

Sandbox application testing the render of large amounts of markup using Thymeleaf with Spring Web MVC
Java
2
star
31

thymeleafsandbox-springjsp

Spring + JSP sandbox application. Only for internal development use by the Thymeleaf team.
Java
1
star