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("rollover-image");
View Full Code Here

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

                result == PAPIElement.PROCESS_ELEMENT_BODY);

        final MenuItem menuItem = (MenuItem) PrivateAccessor.getField(
                menuModelBuilder, "currentEntity");

        ElementDetails elementDetails = menuItem.getElementDetails();
        assertNotNull("MenuItem ElementDetails should not be null",
                elementDetails);

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

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

            // javadoc inherited
            public void verify() throws Exception {
                ModelElement modelElement = (ModelElement)getCurrentEntity();

                ElementDetails elementDetails =
                        modelElement.getElementDetails();

                assertEquals((Object)elementName,
                             elementDetails.getElementName());
                assertEquals((Object)id,
                             elementDetails.getId());
                assertEquals(styles,
                             elementDetails.getStyles());
            }

            // javadoc inherited
            public boolean supportedOn(Class clazz) {
                return ModelElement.class.isAssignableFrom(clazz);
View Full Code Here

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

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

        MenuLabel label = item.getLabel();
        MenuText text = label.getText();
        ElementDetails elementDetails = text.getElementDetails();
        Styles styles = null;
        if (elementDetails != null) {
            styles = elementDetails.getStyles();
        }

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

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

        assertNotNull("Menu should not be null", menu);
        assertEquals("PAPI and Protocol pane names should match",
                testPane.getName(), menu.getPane().getStem());

        ElementDetails menuElementDetails = menu.getElementDetails();
        assertNotNull("Menu ElementDetails should not be null",
                menuElementDetails);
        assertNotNull("Menu styles should not be null",
                menuElementDetails.getStyles());
    }
View Full Code Here

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

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

        // Only add the style class from the menu item if this is an outer link.
        if (outer) {
            ElementDetails elementDetails = item.getElementDetails();
            Styles styles = elementDetails.getStyles();
            if (styles != null) {
                element.setStyles(styles);
            }
        }
        element.setAttribute("href", item.getHref().getURL());
View Full Code Here

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

        DOMOutputBuffer outputBuffer = (DOMOutputBuffer) buffer;
       
        // Create the div attributes
        attributes = new DivAttributes();
        // Stylistic properties
        ElementDetails elementDetails = menu.getElementDetails();
        if (elementDetails != null) {
            attributes.setElementDetails(elementDetails);
        }

        // Create the actual element
View Full Code Here

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

            // Create the span attributes
            attributes = new SpanAttributes();

            // Stylistic properties
            ElementDetails elementDetails = item.getElementDetails();
            if (elementDetails != null) {
                attributes.setElementDetails(elementDetails);
            }

            // Events
View Full Code Here

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

                if (imageUrl != null) {

                    DOMOutputBuffer dom = (DOMOutputBuffer) buffer;
                    ImageAttributes attributes = new ImageAttributes();
                    // Stylistic properties
                    ElementDetails elementDetails = icon.getElementDetails();
                    if (elementDetails != null) {
                        attributes.setElementDetails(elementDetails);
                    }
                    // Image properties
                    attributes.setSrc(imageUrl);
View Full Code Here

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

                    if (shortcutTextValue != null) {
                        // this is never null.
                        ShortcutProperties shortcutProps =
                                menu.getShortcutProperties();

                        ElementDetails elementDetails = menu.getElementDetails();

                        if (elementDetails != null) {

                            SpanAttributes attributes = new SpanAttributes();
                            // Should only render out a surrounding span
                            // element if the device supports it.
                            if (shortcutProps.supportsSpan()) {
                                // Create span attributes from the menu's
                                // attributes. There are two mechanisms used
                                // here to support real css and the css
                                // emulation provided by MCS.  The style class
                                // VE-... is used for devices that support css
                                // and the css renderers need to ensure they
                                // generate appropriate style rules.  The
                                // pseudo element is used by those protocols
                                // that work through css emulation.
                                attributes.setId(elementDetails.getId());

                                // Need to explicitly set the display to inline
                                // (even though the shortcut should use the
                                // menu styles, we know display should always
                                // be inline in this case).
                                final Styles styles =
                                        elementDetails.getStyles().copy();
                                styles.getPropertyValues().setSpecifiedValue(
                                        StylePropertyDetails.DISPLAY,
                                        StyleKeywords.INLINE);

                                // The tag name and style class are
                                // conditionally added into the attributes
                                // because CSS emulation requires the tag name
                                // but no descendent selector in order to work
                                // correctly while real CSS supporting protocols
                                // would create too many style classes on the
                                // shortcut if the tag is specified and would
                                // not generate the required markup without the
                                // style class.
                                if (customisation.supportsStyleSheets()) {
                                    attributes.setTagName(null);
                                    attributes.setStyles(styles);
                                } else {
                                    attributes.setTagName(
                                            elementDetails.getElementName());
                                    attributes.setStyles(styles);
                                }

                                span.openSpan(domBuffer, attributes);
                            }
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.