Package com.volantis.mcs.protocols.menu.model

Examples of com.volantis.mcs.protocols.menu.model.Menu


    private void checkMenuItem(String href, String title)
            throws Exception {

        // Create the menu item.
        String text = "item text";
        Menu menu = createSimpleMenu(title, href, text);
        MenuItem item = (MenuItem) menu.get(0);
       
        // Render the menu item.
        OpenwaveOptionMenuItemRenderer renderer =
                new OpenwaveOptionMenuItemRenderer();
View Full Code Here


        builder.endMenuItem();

        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.
View Full Code Here

        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);
View Full Code Here

    public void testPlainImage()
        throws Exception {

        MenuItemRendererSelector selector = createSelector();

        Menu menu = createMenu(StylesBuilder.getCompleteStyles(
                "mcs-menu-image-style: plain; " +
                "mcs-menu-text-style: none"));

        MenuBuffer buffer = createMenuBuffer();

        MenuBufferLocator locator = createMenuBufferLocator(buffer);

        MenuItemRenderer renderer = selector.selectMenuItemRenderer(menu);
        assertNotNull("No renderer selected", renderer);

        renderer.render(locator, (MenuItem) menu.get(0));

        String string = toString(buffer);
        //System.out.println("String: " + string);
        assertEquals("Output does not match",
                     "<link" +
View Full Code Here

    public void testRolloverImage()
        throws Exception {

        MenuItemRendererSelector selector = createSelector();

        Menu menu = createMenu(StylesBuilder.getCompleteStyles(
                "mcs-menu-image-style: rollover; " +
                "mcs-menu-text-style: none"));

        MenuBuffer buffer = createMenuBuffer();

        MenuBufferLocator locator = createMenuBufferLocator(buffer);

        MenuItemRenderer renderer = selector.selectMenuItemRenderer(menu);
        assertNotNull("No renderer selected", renderer);

        renderer.render(locator, (MenuItem) menu.get(0));

        String string = toString(buffer);
        //System.out.println("String: " + string);
        assertEquals("Output does not match",
                     "<link" +
View Full Code Here

    public void testPlainText()
        throws Exception {

        MenuItemRendererSelector selector = createSelector();

        Menu menu = createMenu(StylesBuilder.getCompleteStyles(
                "mcs-menu-image-style: none; " +
                "mcs-menu-text-style: plain"));

        MenuBuffer buffer = createMenuBuffer();

        MenuBufferLocator locator = createMenuBufferLocator(buffer);

        MenuItemRenderer renderer = selector.selectMenuItemRenderer(menu);
        assertNotNull("No renderer selected", renderer);

        renderer.render(locator, (MenuItem) menu.get(0));

        String string = toString(buffer);
        //System.out.println("String: " + string);
        assertEquals("Output does not match",
                     "<link " +
View Full Code Here

    public void testGetMenu() {
        ConcreteMenuItem item = MenuModelHelper.createMenuItem(itemName);

        ConcreteMenu menu = MenuModelHelper.createMenu(false, null);

        Menu testMenu;

        // Testing no menu;
        testMenu = item.getMenu();
        assertNull("There should be no menu", testMenu);
View Full Code Here

     */
    public void testGetMenuBufferMainMenuAuto() throws Exception {
        MenuBufferLocator locator = createMenuBufferLocator();

        MenuModelBuilder builder = new ConcreteMenuModelBuilder();
        Menu menu;

        builder.startMenu();

        // Make the menu automatic allocate and ensure that the pane is
        // incompletely specified to ensure automatic iteration allocation
View Full Code Here

     */
    public void testGetMenuBufferMainMenuFullySpec() throws Exception {
        MenuBufferLocator locator = createMenuBufferLocator();

        MenuModelBuilder builder = new ConcreteMenuModelBuilder();
        Menu menu;

        builder.startMenu();

        // Make the menu automatic allocate and ensure that the pane is
        // fully specified to ensure no automatic iteration allocation
View Full Code Here

     */
    public void testGetMenuBufferMainMenuNoAuto() throws Exception {
        MenuBufferLocator locator = createMenuBufferLocator();

        MenuModelBuilder builder = new ConcreteMenuModelBuilder();
        Menu menu;

        builder.startMenu();

        // Make the menu manually allocate and ensure that the pane is
        // incompletely specified to ensure no automatic iteration allocation
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.menu.model.Menu

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.