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

Examples of com.volantis.mcs.protocols.menu.renderer.MenuRenderer


        // Create a test menu
        ConcreteMenu testMenu = new ConcreteMenu(elementDetails);

        // Test renderer returned
        MenuRenderer renderer = selector.selectMenuRenderer(testMenu);

        // Check the renderer exists.  JavaDoc on MenuRendererSelector
        // says it may not be null.
        assertNotNull("Should be a renderer here (1)", renderer);
View Full Code Here


        builder.endMenu();

        Menu menu = builder.getCompletedMenuModel();

        // Select the renderer to use for this menu.
        MenuRenderer renderer = selector.selectMenuRenderer(menu);

        // Make sure that it is of the appropriate type.
        assertTrue("Incorrect renderer returned: " + renderer,
                   renderer instanceof OpenwaveMenuRenderer);

        // Render the menu.
        renderer.render(menu);

        // Check the markup output.
        String expected
                = "<BLOCK style='mcs-menu-link-style: numeric-shortcut; white-space: nowrap'>"
                + "<select>"
View Full Code Here

    }

    public void testSelectMenuRenderer() throws Exception {

        final MenuRendererSelector selector = getTestMenuRendererSelector();
        MenuRenderer renderer =
                selector.selectMenuRenderer(
                        MenuModelHelper.createMenu(true, "Test Menu"));

        assertNotNull("Selected renderer must not be null", renderer);

        // Check the type is as it should be
        assertEquals("The class types should match",
                     renderer.getClass(), getSelectMenuRendererClass());
    }
View Full Code Here

                    logger.error("selector-rendering-error", "menu");
                    throw new PAPIException(exceptionLocalizer.format(
                            "missing-renderer-selector", "menu"));
                }

                MenuRenderer renderer =
                        rendererSelector.selectMenuRenderer(menu);

                final ShortcutProperties shortcutProperties =
                        menu.getShortcutProperties();
                if (null != shortcutProperties) {
                    // If the device cannot support mixed content in the body
                    // of a link, then update the shortcut properties so that
                    // span elements will not be used.
                    String supportsMixedContent = pageContext.
                            getDevicePolicyValue(DevicePolicyConstants.
                                    X_ELEMENT_A_SUPPORTS_MIXED_CONTENT);
                    if (DevicePolicyConstants.NO_SUPPORT_POLICY_VALUE.equals
                            (supportsMixedContent)) {
                        shortcutProperties.setSupportsSpan(false);
                    }

                    // If the device inserts line breaks before links, then
                    // shortcuts must appear in the active area or the layout
                    // will be incorrect (regardless of the value specified in
                    // the styles).
                    String insertsLineBreaks = pageContext.getDevicePolicyValue(
                            DevicePolicyConstants.X_ELEMENT_A_BREAKS_LINE);
                    if ("before".equals(insertsLineBreaks)) {
                        shortcutProperties.setActive(true);
                    }
                }

                // Process the menu
                renderer.render(menu);
            }
        } catch (BuilderException be) {
            logger.error("menu-building-error", be);
            throw new PAPIException(
                    exceptionLocalizer.format("menu-building-error"), be);
View Full Code Here

                    !menuInspector.isParentAutoIterating(menu)) {
                rendererVisit(item);
            }

            // Render the sub-menu in a separate renderer
            MenuRenderer renderer = rendererSelector.
                    selectMenuRenderer(menu);

            renderer.render(menu);

            // Sub-menus' content should not be visited here since they
            // are processed separately above

        }
View Full Code Here

                    new ShardLinkMenuModelBuilder(
                            getOutputBufferFactory());
            ShardLinkMenu menu = builder.buildShardLinkMenuModel(attributes);

            // Render the shard link menu.
            MenuRenderer menuRenderer = getShardLinkMenuModule().
                getMenuRendererSelector().selectMenuRenderer(menu);
            menuRenderer.render(menu);
        } catch (RendererException e) {
            throw new ProtocolException(e.getMessage(), e);
        }

        context.popOutputBuffer(dom);
View Full Code Here

                            new ShardLinkMenuModelBuilder(
                                    getOutputBufferFactory());
                    ShardLinkMenu menu = builder.buildShardLinkMenuModel(attributes);

                    // Render the shard link menu.
                    MenuRenderer menuRenderer = getShardLinkMenuModule().
                            getMenuRendererSelector().selectMenuRenderer(menu);
                    menuRenderer.render(menu);
                } catch (RendererException e) {
                    throw new ProtocolException(e.getMessage(), e);
                }

            }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.menu.renderer.MenuRenderer

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.