Package org.apache.tapestry5.services.javascript

Examples of org.apache.tapestry5.services.javascript.JavaScriptSupport


        String expanded = "org/apache/tapestry5/foo/bar.pdf";

        Asset asset = mockAsset();
        SymbolSource source = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        JavaScriptSupport js = mockJavaScriptSupport();

        train_expandSymbols(source, path, expanded);

        train_getAsset(assetSource, null, expanded, null, asset);

        js.importJavaScriptLibrary(asset);

        replay();

        RenderSupport support = new RenderSupportImpl(source, assetSource, js);
View Full Code Here


    @Test
    public void add_stylesheet_link_by_asset()
    {
        String media = "print";
        JavaScriptSupport javascriptSupport = mockJavaScriptSupport();
        Asset asset = mockAsset("foo.css");

        javascriptSupport.importStylesheet(new StylesheetLink("foo.css", new StylesheetOptions(media)));

        replay();

        RenderSupport support = new RenderSupportImpl(null, null, javascriptSupport);
View Full Code Here

    @Test
    public void add_stylesheet_link_by_url()
    {
        String media = "print";
        JavaScriptSupport javascriptSupport = mockJavaScriptSupport();

        javascriptSupport.importStylesheet(new StylesheetLink(ASSET_URL, new StylesheetOptions(media)));

        replay();

        RenderSupport support = new RenderSupportImpl(null, null, javascriptSupport);
View Full Code Here

    }

    @Test
    public void add_multiple_string_init_parameters()
    {
        JavaScriptSupport js = mockJavaScriptSupport();

        JSONObject spec = new JSONObject().put("foo", new JSONArray().put(new JSONArray("fred", "barney")));

        js.addScript("Tapestry.init(%s);", spec);

        replay();

        RenderSupportImpl support = new RenderSupportImpl(null, null, js);
View Full Code Here

    @Test
    public void addInit_passes_through_to_JavaScriptSupport()
    {
        JSONObject parameter = new JSONObject("clientid", "fred");

        JavaScriptSupport js = mockJavaScriptSupport();

        js.addInitializerCall("setup", parameter);

        replay();

        RenderSupportImpl support = new RenderSupportImpl(null, null, js);
View Full Code Here

    }

    @Test
    public void autofocus_pass_thru_to_javascriptsupport()
    {
        JavaScriptSupport js = mockJavaScriptSupport();

        js.autofocus(FieldFocusPriority.OVERRIDE, "fred");

        replay();

        RenderSupportImpl support = new RenderSupportImpl(null, null, js);
View Full Code Here

        MarkupRendererFilter renderSupport = new MarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                RenderSupportImpl support = new RenderSupportImpl(symbolSource, assetSource, javascriptSupport);

                environment.push(RenderSupport.class, support);

                renderer.renderMarkup(writer);

                environment.pop(RenderSupport.class);
            }
        };

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

                linker.addStylesheetLink(new StylesheetLink(defaultStylesheet.toClientURL()));

                renderer.renderMarkup(writer);
            }
        };

        MarkupRendererFilter clientBehaviorSupport = new MarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                ClientBehaviorSupportImpl clientBehaviorSupport = new ClientBehaviorSupportImpl(javascriptSupport,
                        environment);

                environment.push(ClientBehaviorSupport.class, clientBehaviorSupport);
View Full Code Here

        PartialMarkupRendererFilter renderSupport = new PartialMarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, JSONObject reply, PartialMarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                RenderSupportImpl support = new RenderSupportImpl(symbolSource, assetSource, javascriptSupport);

                environment.push(RenderSupport.class, support);

                renderer.renderMarkup(writer, reply);

                environment.pop(RenderSupport.class);
            }
        };

        PartialMarkupRendererFilter clientBehaviorSupport = new PartialMarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, JSONObject reply, PartialMarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                ClientBehaviorSupportImpl support = new ClientBehaviorSupportImpl(javascriptSupport, environment);

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

        MarkupRendererFilter renderSupport = new MarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                RenderSupportImpl support = new RenderSupportImpl(symbolSource, assetSource, javascriptSupport);

                environment.push(RenderSupport.class, support);

                renderer.renderMarkup(writer);

                environment.pop(RenderSupport.class);
            }
        };

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

                linker.addStylesheetLink(new StylesheetLink(defaultStylesheet.toClientURL()));

                renderer.renderMarkup(writer);
            }
        };

        MarkupRendererFilter clientBehaviorSupport = new MarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                ClientBehaviorSupportImpl clientBehaviorSupport = new ClientBehaviorSupportImpl(javascriptSupport,
                        environment);

                environment.push(ClientBehaviorSupport.class, clientBehaviorSupport);
View Full Code Here

        PartialMarkupRendererFilter renderSupport = new PartialMarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, JSONObject reply, PartialMarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                RenderSupportImpl support = new RenderSupportImpl(symbolSource, assetSource, javascriptSupport);

                environment.push(RenderSupport.class, support);

                renderer.renderMarkup(writer, reply);

                environment.pop(RenderSupport.class);
            }
        };

        PartialMarkupRendererFilter clientBehaviorSupport = new PartialMarkupRendererFilter()
        {
            public void renderMarkup(MarkupWriter writer, JSONObject reply, PartialMarkupRenderer renderer)
            {
                JavaScriptSupport javascriptSupport = environment.peekRequired(JavaScriptSupport.class);

                ClientBehaviorSupportImpl support = new ClientBehaviorSupportImpl(javascriptSupport, environment);

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

TOP

Related Classes of org.apache.tapestry5.services.javascript.JavaScriptSupport

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.