Package com.google.sitebricks.rendering.control

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



  @Test
  public final void readHtmlWidgetWithChildren() {

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

    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, pageBook, metrics)
            .compile("<!doctype html><html><body><div class='${clazz}'>hello @ShowIf(false)<a href='/hi/${id}'>hideme</a></div></body></html>");
View Full Code Here


        .getInstance(PageBook.class);

    book.at("/somewhere", MyEmbeddedPage.class).apply(Chains.terminal());


    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);
    registry.addEmbed("myfave");

    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, book, metrics)
            .compile("<xml><div class='content'>hello @MyFave(should=false)<a href='/hi/${id}'>hideme</a></div></xml>");
View Full Code Here

    });
    final PageBook book = injector      //hacky, where are you super-packages!
        .getInstance(PageBook.class);


    final WidgetRegistry registry = injector.getInstance(WidgetRegistry.class);
    registry.addEmbed("myfave");

    Renderable widget =
        new HtmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, pageBook, metrics)
            .compile("<html><div class='content'>hello @MyFave(should=false)<a href='/hi/${id}'>hideme</a></div></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 XmlTemplateCompiler(Object.class, compiler, registry, pageBook, metrics)
            .compile("<xml>@ShowIf(true)<p>hello</p></xml>");
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 XmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(Object.class), registry, pageBook, metrics)
            .compile(String.format("<xml>@ShowIf(%s)<p>hello</p></xml>", expression));
View Full Code Here

      }
    });

    final Evaluator evaluator = new MvelEvaluator();

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


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

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


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


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


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


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


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


  @Test
  public final void readXmlWidget() {

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

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


  @Test
  public final void readXmlWidgetWithChildren() {

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

    Renderable widget =
        new XmlTemplateCompiler(Object.class, new MvelEvaluatorCompiler(TestBackingType.class), registry, pageBook, metrics)
            .compile("<xml><div class='${clazz}'>hello @ShowIf(false)<a href='/hi/${id}'>hideme</a></div></xml>");
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.