Search in sources :

Example 1 with LayoutDialect

use of nz.net.ultraq.thymeleaf.LayoutDialect in project irida by phac-nml.

the class IridaUIWebConfig method additionalDialects.

/**
 * This is to add additional Thymeleaf dialects.
 *
 * @return A Set of Thymeleaf dialects.
 */
private Set<IDialect> additionalDialects() {
    Set<IDialect> dialects = new HashSet<>();
    dialects.add(new SpringSecurityDialect());
    dialects.add(new LayoutDialect());
    dialects.add(new DataAttributeDialect());
    return dialects;
}
Also used : DataAttributeDialect(com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect) SpringSecurityDialect(org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect) IDialect(org.thymeleaf.dialect.IDialect) HashSet(java.util.HashSet) LayoutDialect(nz.net.ultraq.thymeleaf.LayoutDialect)

Example 2 with LayoutDialect

use of nz.net.ultraq.thymeleaf.LayoutDialect in project spring-boot by spring-projects.

the class ThymeleafAutoConfigurationTests method layoutDialectCanBeCustomized.

@Test
public void layoutDialectCanBeCustomized() throws Exception {
    this.context.register(LayoutDialectConfiguration.class);
    this.context.refresh();
    LayoutDialect layoutDialect = this.context.getBean(LayoutDialect.class);
    assertThat(ReflectionTestUtils.getField(layoutDialect, "sortingStrategy")).isInstanceOf(GroupingStrategy.class);
}
Also used : LayoutDialect(nz.net.ultraq.thymeleaf.LayoutDialect) Test(org.junit.Test)

Example 3 with LayoutDialect

use of nz.net.ultraq.thymeleaf.LayoutDialect in project tutorials by eugenp.

the class WebMVCConfig method templateEngine.

private TemplateEngine templateEngine(ITemplateResolver templateResolver) {
    SpringTemplateEngine engine = new SpringTemplateEngine();
    engine.addDialect(new LayoutDialect(new GroupingStrategy()));
    engine.addDialect(new Java8TimeDialect());
    engine.setTemplateResolver(templateResolver);
    engine.setTemplateEngineMessageSource(messageSource());
    return engine;
}
Also used : SpringTemplateEngine(org.thymeleaf.spring4.SpringTemplateEngine) GroupingStrategy(nz.net.ultraq.thymeleaf.decorators.strategies.GroupingStrategy) LayoutDialect(nz.net.ultraq.thymeleaf.LayoutDialect) Java8TimeDialect(org.thymeleaf.extras.java8time.dialect.Java8TimeDialect)

Aggregations

LayoutDialect (nz.net.ultraq.thymeleaf.LayoutDialect)3 DataAttributeDialect (com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect)1 HashSet (java.util.HashSet)1 GroupingStrategy (nz.net.ultraq.thymeleaf.decorators.strategies.GroupingStrategy)1 Test (org.junit.Test)1 IDialect (org.thymeleaf.dialect.IDialect)1 Java8TimeDialect (org.thymeleaf.extras.java8time.dialect.Java8TimeDialect)1 SpringSecurityDialect (org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect)1 SpringTemplateEngine (org.thymeleaf.spring4.SpringTemplateEngine)1