Examples of StylesheetLink


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

    }

    public void importStylesheet(Asset stylesheet)
    {
        assert stylesheet != null;
        importStylesheet(new StylesheetLink(stylesheet));
    }
View Full Code Here

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

    private void trainForCoreStack(DocumentLinker linker, JavaScriptStackSource stackSource,
            JavaScriptStackPathConstructor pathConstructor)
    {
        JavaScriptStack stack = mockJavaScriptStack();

        StylesheetLink stylesheetLink = new StylesheetLink("style.css");

        expect(stackSource.getStack(InternalConstants.CORE_STACK_NAME)).andReturn(stack);
        expect(pathConstructor.constructPathsForJavaScriptStack(InternalConstants.CORE_STACK_NAME)).andReturn(
                CollectionFactory.newList("stack1.js", "stack2.js"));
        expect(stack.getStylesheets()).andReturn(CollectionFactory.newList(stylesheetLink));
View Full Code Here

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

        trainForCoreStack(linker, stackSource, pathConstructor);

        JavaScriptStack stack = mockJavaScriptStack();

        StylesheetLink stylesheetLink = new StylesheetLink("stack.css");

        expect(stackSource.getStack("custom")).andReturn(stack);
        expect(pathConstructor.constructPathsForJavaScriptStack("custom")).andReturn(
                CollectionFactory.newList("stack.js"));
        expect(stack.getStylesheets()).andReturn(CollectionFactory.newList(stylesheetLink));
View Full Code Here

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

        trainForCoreStack(linker, stackSource, pathConstructor);

        JavaScriptStack child = mockJavaScriptStack();
        JavaScriptStack parent = mockJavaScriptStack();

        StylesheetLink parentStylesheetLink = new StylesheetLink("parent.css");

        StylesheetLink childStylesheetLink = new StylesheetLink("child.css");

        expect(stackSource.getStack("child")).andReturn(child);

        expect(child.getStacks()).andReturn(Arrays.asList("parent"));
View Full Code Here

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

    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.services.javascript.StylesheetLink

    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);

        jss.importStylesheet(new StylesheetLink("style.css", options));
        jss.importStylesheet(new StylesheetLink("style.css", new StylesheetOptions("hologram")));

        jss.commit();

        verify();
    }
View Full Code Here

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

    @Test
    public void stylesheet_link()
    {
        PartialMarkupDocumentLinker linker = new PartialMarkupDocumentLinker();

        linker.addStylesheetLink(new StylesheetLink("foo.css", new StylesheetOptions("print")));
        linker.addStylesheetLink(new StylesheetLink("bar.css"));

        JSONObject reply = new JSONObject();

        linker.commit(reply);
View Full Code Here

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

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

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

                renderer.renderMarkup(writer);
            }
        };
View Full Code Here

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

    {
        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

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

    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
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.