Examples of ElementDetails


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

    public MenuItemRenderedContent render(OutputBuffer buffer, MenuItem item)
        throws RendererException {

        MenuLabel label = item.getLabel();
        MenuIcon icon = label.getIcon();
        ElementDetails elementDetails = icon.getElementDetails();
        Styles styles = null;
        if (elementDetails != null) {
            styles = elementDetails.getStyles();
        }

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;
        Element element = outputBuffer.addElement("plain-image");
        if (styles != null) {
View Full Code Here

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

        assertNull("The test object should be null", testObject);
        assertEquals("The parent and test objects should be the same",
                parentObject, testObject);

        // Test non-null values;
        ElementDetails elementDetails = testClass.getElementDetails();
        ((ConcreteElementDetails)elementDetails).setElementName(
                "Second Style Element");
        parentObject = (AbstractMenuEntry) createTestInstance(elementDetails);
        testClass.setContainer(parentObject);
        testObject = testClass.getContainer();
View Full Code Here

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

     * AbstractModelElement class.  It makes use of a simple test class
     * provided by {@link #createTestInstance createMutableStyleProperties()} to create
     * a concrete instance for testing purposes.
     */
    public void testGetElementDetails() throws Exception {
        ElementDetails elementDetails =
                createElementDetails(ELEMENT, TEST_STYLES);
        AbstractModelElement testClass = createTestInstance(elementDetails);

        ElementDetails testElementDetails = testClass.getElementDetails();
        assertNotNull("element details should not be null",
                testElementDetails);
        assertEquals("element details should be the same",
                elementDetails, testElementDetails);
    }
View Full Code Here

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

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;

        Element element = outputBuffer.openElement("span");

        ElementDetails elementDetails = item.getElementDetails();
        Styles styles = elementDetails.getStyles();
        if (styles != null) {
            element.setStyles(styles);
        }
        return true;
    }
View Full Code Here

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

     * @return          An initialised instance of ConcreteMenuLabel
     */
    public static ConcreteMenuLabel createMenuLabel(OutputBuffer textToUse) {
        String testIcon = "relative/URL/to/icon";

        ElementDetails elementDetails = MenuModelHelper.createElementDetails();
        ConcreteMenuText text = new ConcreteMenuText(elementDetails);
        ConcreteMenuIcon icon = new ConcreteMenuIcon(elementDetails);

        if (textToUse == null) {
            text.setText(ONE);
View Full Code Here

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

                assertEquals("onclick not as",
                             ON_CLICK,
                             label.getEventHandler(EventType.ON_CLICK).getScript());

                ElementDetails menuElementDetails = menu.getElementDetails();
                // if element details are not null, styles should be non null
                assertNotNull("Menu ElementDetails should not be null",
                        menuElementDetails);
                assertNotNull("Menu Styles should not be null",
                        menuElementDetails.getStyles());

                ElementDetails elementDetails = label.getElementDetails();
                assertNotNull("Label ElementDetails should not be null",
                        elementDetails);
                assertNotNull("Styles should not be null after " +
                        "LabelElement#elementStart",
                        elementDetails.getStyles());
            }
        });
    }
View Full Code Here

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

                (MenuItemGroup) PrivateAccessor.getField(menuModelBuilder,
                        "currentEntity");

        assertNotNull("MenuGroup should not be null", menuItemGroup);

        ElementDetails elementDetails = menuItemGroup.getElementDetails();
        assertNotNull("MenuItemGroup ElementDetails should not be null",
                elementDetails);

        assertNotNull("MenuItemGroup Styles should not be null after " +
                "elementStart", elementDetails.getStyles());
    }
View Full Code Here

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

     * Tests the getText method.  Because an instance of this class should
     * never be created without the text being set this method also tests
     * invalid configurations of the class as well as the get/set methods.
     */
    public void testGetText() {
        ElementDetails elementDetails = MenuModelHelper.createElementDetails();
        ConcreteMenuText text = new ConcreteMenuText(elementDetails);
        ConcreteMenuIcon icon = new ConcreteMenuIcon(elementDetails);

        MenuLabel label;
        text.setText(testText);
View Full Code Here

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

        label = createTestInstance(null, false);
        testIcon = label.getIcon();
        assertNull("Icon should be null", testIcon);

        // Test method
        ElementDetails elementDetails = MenuModelHelper.createElementDetails();
        MenuIcon icon = new ConcreteMenuIcon(elementDetails);

        ((ConcreteMenuLabel)label).setIcon(icon);
        testIcon = label.getIcon();
        assertNotNull("Icon should not be null", testIcon);
View Full Code Here

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

     * @param withIcon  Indicates whether an icon should or should not be set
     * @return An initialised instance of ConcreteMenuLabel
     */
    protected ConcreteMenuLabel createTestInstance(OutputBuffer textToUse,
                                                   boolean withIcon) {
        ElementDetails elementDetails = MenuModelHelper.createElementDetails();
        ConcreteMenuText text = new ConcreteMenuText(elementDetails);
        ConcreteMenuIcon icon = (withIcon ?
            new ConcreteMenuIcon(elementDetails) :
            null);

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.