Package com.google.sitebricks.rendering.control

Examples of com.google.sitebricks.rendering.control.WidgetRegistry


  @Test(dataProvider = ANNOTATION_EXPRESSIONS)
  public final void readAWidgetWithVariousExpressions(String expression) {
    final Evaluator evaluator = new MvelEvaluator();

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);

    String templateValue = String.format("<html><#if %s><p>hello</p></#if></html>", expression);

    System.out.println( templateValue );
   
View Full Code Here


      }
    });

    final Evaluator evaluator = new MvelEvaluator();

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);


    Renderable widget =
        new FreemarkerTemplateCompiler()
            .compile(Object.class, template("<html><#if false><p>hello</p></#if></html>"));
View Full Code Here


  @Test
  public final void readHtmlWidget() {

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);

    Renderable widget =
        new FreemarkerTemplateCompiler()
            .compile(Object.class, template("<html><div class='${clazz}'>hello</div></html>"));
View Full Code Here


  @Test
  public final void readHtmlWidgetWithChildren() {

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);

    Renderable widget =
        new FreemarkerTemplateCompiler()
            .compile(Object.class, template("<!doctype html><html><body><div class='${clazz}'>hello <#if false><a href='/hi/${id}'>hideme</a></#if></div></body></html>"));
View Full Code Here

    assert "asodkoas".equals(Dom.extractKeyAndContent("@Thing(asodkoas)  kko")[1]) : "Extraction wrong: ";
  }

  @Test
  public final void readShowIfWidgetTrue() {
    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);

    final MvelEvaluatorCompiler compiler = new MvelEvaluatorCompiler(TestBackingType.class);
    Renderable widget =
        new HtmlTemplateCompiler(Object.class, compiler, registry, pageBook, metrics)
          .compile("<html>@ShowIf(true)<p>hello</p></html>");
View Full Code Here

  @Test(dataProvider = ANNOTATION_EXPRESSIONS)
  public final void readAWidgetWithVariousExpressions(String expression) {
    final Evaluator evaluator = new MvelEvaluator();

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);


    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(Object.class), registry, pageBook, metrics)
            .compile(String.format("<html>@ShowIf(%s)<p>hello</p></html>", expression));
View Full Code Here

      }
    });

    final Evaluator evaluator = new MvelEvaluator();

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);


    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(Object.class), registry, pageBook, metrics)
            .compile("<html>@ShowIf(false)<p>hello</p></html>");
View Full Code Here

        bind(HttpServletRequest.class).toProvider(mockRequestProviderForContext());
      }
    });


    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);


    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, pageBook, metrics)
            .compile("<html><div class='${clazz}'>hello <a href='/people/${id}'>${name}</a></div></html>");
View Full Code Here

    Parsing.setTypeConverter(converter);

    final PageBook pageBook = injector.getInstance(PageBook.class);


    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);


    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, pageBook, metrics)
            .compile("<html> <head>" +
View Full Code Here


  @Test
  public final void readHtmlWidget() {

    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);

    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, pageBook, metrics)
            .compile("<html><div class='${clazz}'>hello</div></html>");
View Full Code Here

TOP

Related Classes of com.google.sitebricks.rendering.control.WidgetRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.