Package com.volantis.mcs.protocols.menu.shared.renderer

Examples of com.volantis.mcs.protocols.menu.shared.renderer.TestDeprecatedImageOutput


                new ElementDetailsStub(), new ConcreteMenuLabel(
                        new ElementDetailsStub(), createMenuText(), icon));

        // Create the renderer we are to test.
        MenuItemComponentRenderer renderer = createImageMenuItemRenderer(
                new TestDeprecatedImageOutput(), false);

        // Do a render.
        String actual = getRenderOutputAsString(renderer, item);
        //System.out.println(actual);
View Full Code Here


                new TestRendererContext(assetResolverMock);
       
        TestDeprecatedOutputLocator outputLocator
                = new TestDeprecatedOutputLocator();
        DOMOutputBuffer buffer = context.getBuffer();
        TestDeprecatedImageOutput imageOutput
                = (TestDeprecatedImageOutput) outputLocator.getImageOutput();

        // Create the renderer to test, using the test objects created above.
        OpenwaveMenuItemRendererFactory rendererFactory =
                new OpenwaveMenuItemRendererFactory(context, outputLocator);
        final StylePropertyResolver stylePropertyResolver =
                new DefaultStylePropertyResolver(null, null);
        final DefaultMenuSeparatorRendererSelector rendererSelector =
                new DefaultMenuSeparatorRendererSelector(
                        new OpenwaveMenuSeparatorRendererFactory(),
                        context.getAssetResolver(),
                        stylePropertyResolver);
        DefaultMenuItemRendererSelector selector =
                new DefaultMenuItemRendererSelector(
                        rendererFactory, rendererSelector);

        MenuBufferFactory bufferFactory
                = new ConcreteMenuBufferFactory(SeparatorRenderer.NULL);

        DefaultMenuBufferLocator bufferLocator
                = new DefaultMenuBufferLocator(context.getOutputBufferResolver(),
                        bufferFactory);

        OpenwaveMenuRenderer menuRenderer =
                new OpenwaveMenuRenderer(selector, bufferLocator);

        // Build a simple menu model we can exercise the renderer with.
        Menu menu = createSimpleMenu(
                imageStyle, textStyle, orderStyle,
                menuTitle, itemTitle, itemHref, itemText, itemImageComponent);

        // Render the menu model out to the buffer.
        menuRenderer.render(menu);

        // Extract the output from the menu rendering as a string.
        String actual = styledDOMTester.render(buffer.getRoot());
        //System.out.println(actual);

        // Calculate the image part of the menu items rendered from the
        // related mariner menu style property setting, if any.
        String imageValue = null;
        if (imageStyle == null || imageStyle == MCSMenuImageStyleKeywords.NONE) {
            // No image.
        } else if (imageStyle == MCSMenuImageStyleKeywords.PLAIN
                || imageStyle == MCSMenuImageStyleKeywords.ROLLOVER) {
            imageValue = imageOutput.getLastRenderedText();
        } else {
            throw new IllegalStateException();
        }

        // Calculate the text part of the menu items rendered from the
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.menu.shared.renderer.TestDeprecatedImageOutput

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.