Package org.apache.tapestry5.dom

Examples of org.apache.tapestry5.dom.Document.newRootElement()


    @Test
    public void pretty_print_initialization() throws Exception
    {
        Document document = new Document();

        Element head = document.newRootElement("html").element("head");

        head.element("meta");
        head.element("script");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", false);
View Full Code Here


    @Test
    public void other_initialization() throws Exception
    {
        Document document = new Document();

        Element head = document.newRootElement("html").element("head");

        head.element("meta");
        head.element("script");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);
View Full Code Here

    @Test
    public void ie_conditional_stylesheet() throws Exception
    {
        Document document = new Document();

        document.newRootElement("html");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addStylesheetLink(new StylesheetLink("everybody.css"));
        linker.addStylesheetLink(new StylesheetLink("just_ie.css", new StylesheetOptions().withCondition("IE")));
View Full Code Here

    @Test
    public void stylesheet_insertion_point() throws Exception
    {
        Document document = new Document();

        document.newRootElement("html");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.addStylesheetLink(new StylesheetLink("whatever.css"));
        linker.addStylesheetLink(new StylesheetLink("insertion-point.css", new StylesheetOptions().asAjaxInsertionPoint()));
View Full Code Here

    @Test
    public void exception_if_missing_html_root_element_and_javascript()
    {
        Document document = new Document();

        document.newRootElement("not-html").text("not an HTML document");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, true, "1.2.3");

        // Only checked if there's something to link.
View Full Code Here

    @Test
    public void logged_error_if_missing_html_element_and_css()
    {
        Document document = new Document();

        document.newRootElement("not-html").text("not an HTML document");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, true, "1.2.3");

        // Only checked if there's something to link.
View Full Code Here

    @Test
    public void add_script_links() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, true, "1.2.3");

        linker.addScriptLink("foo.js");
        linker.addScriptLink("bar/baz.js");
View Full Code Here

    @Test
    public void include_generator_meta() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("body").element("p").text("Ready to be marked with generator meta.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, false, "1.2.3");

        linker.updateDocument(document);
View Full Code Here

    @Test
    public void empty_document_with_scripts_at_top() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, true, "1.2.3");

        linker.addStylesheetLink("style.css", "print");
        linker.addScriptLink("foo.js");
View Full Code Here

    @Test
    public void add_script_links_at_top() throws Exception
    {
        Document document = new Document(new XMLMarkupModel());

        document.newRootElement("html").element("body").element("p").text("Ready to be updated with scripts at top.");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, true, "1.2.3");

        linker.addScriptLink("foo.js");
        linker.addScriptLink("bar/baz.js");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.