Examples of DocumentLinker


Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void initialize_calls_are_aggregated_within_priority()
    {
        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject spec1 = new JSONObject("clientId", "chuck");
        JSONObject spec2 = new JSONObject("clientId", "fred");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(spec1, spec2));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, stackSource, pathConstructor);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void init_with_string()
    {
        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray("chuck", "charley"));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, stackSource, pathConstructor);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void init_with_array()
    {
        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONArray chuck = new JSONArray("chuck", "yeager");
        JSONArray buzz = new JSONArray("buzz", "aldrin");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(chuck, buzz));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, stackSource, pathConstructor);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void default_for_init_string_is_normal_priority()
    {
        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray().put("chuck"));

        linker.setInitialization(InitializationPriority.NORMAL, aggregated);

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, stackSource, pathConstructor);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void default_for_init_array_is_normal_priority()
    {
        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONArray chuck = new JSONArray("chuck", "yeager");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(chuck));

        linker.setInitialization(InitializationPriority.NORMAL, aggregated);

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, stackSource, pathConstructor);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void import_stylesheet_as_asset()
    {
        DocumentLinker linker = mockDocumentLinker();
        Asset stylesheet = mockAsset("style.css");

        StylesheetLink link = new StylesheetLink("style.css");
        linker.addStylesheetLink(link);

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, null, null);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void duplicate_stylesheet_ignored_first_media_wins()
    {
        DocumentLinker linker = mockDocumentLinker();
        StylesheetOptions options = new StylesheetOptions("print");

        linker.addStylesheetLink(new StylesheetLink("style.css", options));

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, null, null);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

        MarkupRendererFilter javaScriptSupport = new MarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
            {
                DocumentLinker linker = environment.peekRequired(DocumentLinker.class);

                JavaScriptSupportImpl support = new JavaScriptSupportImpl(linker, javascriptStackSource,
                        javascriptStackPathConstructor, suppressCoreStylesheetsHook);

                environment.push(JavaScriptSupport.class, support);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

                {
                    // When suppressed, work just like normal rendering.
                    idAllocator = new IdAllocator();
                }

                DocumentLinker linker = environment.peekRequired(DocumentLinker.class);

                JavaScriptSupportImpl support = new JavaScriptSupportImpl(linker, javascriptStackSource,
                        javascriptStackPathConstructor, idAllocator, true, suppressCoreStylesheetsHook);

                environment.push(JavaScriptSupport.class, support);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.DocumentLinker

    }

    @Test
    public void partial_mode_add_script()
    {
        DocumentLinker linker = mockDocumentLinker();

        linker.setInitialization(InitializationPriority.NORMAL, new JSONObject(
                "{ 'evalScript' : [ 'doSomething();' ] }"));

        replay();

        JavaScriptSupportImpl jss = new JavaScriptSupportImpl(linker, null, null, new IdAllocator(), true);
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.