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

Examples of com.volantis.mcs.protocols.menu.shared.model.ConcreteMenuItem


     */
    public void testBasics() throws Exception {

        // Create the menu item to test.
        ConcreteElementDetails elementDetails = createTestElementDetails();
        ConcreteMenuItem item = new ConcreteMenuItem(
                elementDetails, new MenuLabelStub());
       
        // Create the renderer we are to test.
        DefaultSpanMenuItemRenderer renderer =
                new DefaultSpanMenuItemRenderer(
View Full Code Here


     */
    public void testMCSAttributesAnnotatedWithStyles() throws Exception {

        // Create the menu item to test.
        ConcreteElementDetails elementDetails = createTestElementDetails();
        ConcreteMenuItem item = new ConcreteMenuItem(
                elementDetails, new MenuLabelStub());

        // Create the renderer we are to test.
        DefaultSpanMenuItemRenderer renderer =
                new DefaultSpanMenuItemRenderer(
View Full Code Here

     * to the menu item
     * @param label The label to use to represent the menu item
     * @return A menu item
     */
    public MenuItem createTestMenuItem(ElementDetails elementDetails, MenuLabel label) {
        return new ConcreteMenuItem(elementDetails, label);
    }
View Full Code Here

        elementDetails.setStyles(StylesBuilder.getEmptyStyles());
        ConcreteMenuIcon icon = new ConcreteMenuIcon(elementDetails);
        ImageAssetReference imageRef =
                new TestNormalImageAssetReference("the normal url");
        icon.setNormalURL(imageRef);
        ConcreteMenuItem item = new ConcreteMenuItem(
                new ElementDetailsStub(), new ConcreteMenuLabel(
                        new ElementDetailsStub(), createMenuText(),
                        icon));

        // Create the renderer we are to test.
View Full Code Here

    public void testNone() throws Exception {

        // Create the menu item to test.
        ConcreteMenuIcon icon = new ConcreteMenuIcon(new ElementDetailsStub());
        icon.setNormalURL(new TestEmptyImageAssetReference());
        ConcreteMenuItem item = new ConcreteMenuItem(
                new ElementDetailsStub(), new ConcreteMenuLabel(
                        new ElementDetailsStub(), createMenuText(),
                        icon));

        // Create the renderer we are to test.
View Full Code Here

     * or null otherwise.
     *
     * @return the current entity or null if not of the required class
     */
    private ConcreteMenuItem getCurrentMenuItem() {
        ConcreteMenuItem current = null;

        if (currentEntity instanceof ConcreteMenuItem) {
            current = (ConcreteMenuItem) currentEntity;
        }

View Full Code Here

        ConcreteMenu parentMenu = getCurrentMenu();

        // May appear in menus or menu groups.
        // @todo later could use an interface common to the two target classes
        if (parentMenu != null) {
            ConcreteMenuItem item = new ConcreteMenuItem(
                    new ConcreteElementDetails(),
                    new ConcreteMenuLabel(
                            null,
                            new ConcreteMenuText()));
            parentMenu.add(item);
            push(item);
        } else {
            ConcreteMenuItemGroup parentGroup = getCurrentMenuItemGroup();

            if (parentGroup != null) {
                ConcreteMenuItem item = new ConcreteMenuItem(
                        new ConcreteElementDetails(),
                        new ConcreteMenuLabel(
                                null,
                                new ConcreteMenuText()));
                parentGroup.add(item);
View Full Code Here

        }
    }

    // javadoc inherited
    public void endMenuItem() throws BuilderException {
        ConcreteMenuItem item = getCurrentMenuItem();
        if (item != null) {
            checkItem(item);

            pop();
        } else {
View Full Code Here

                    new ConcreteElementDetails(), new ConcreteMenuText());

            parentMenu.setLabel(label);
            push(label);
        } else {
            ConcreteMenuItem item = getCurrentMenuItem();

            if (item != null) {
                push(item.getLabel());
            } else {
                reportBadParent(MenuLabel.class);
            }
        }
    }
View Full Code Here

        return success;
    }

    // javadoc inherited
    public void setPrompt(TextAssetReference prompt) throws BuilderException {
        ConcreteMenuItem item = getCurrentMenuItem();

        // Applicable to menus and menu items
        if (item != null) {
            try {
                item.setPrompt(prompt);
            } catch (Exception e) {
                throw new BuilderException(e);
            }
        } else {
            ConcreteMenu menu = getCurrentMenu();
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.menu.shared.model.ConcreteMenuItem

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.