Examples of MenuIcon


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

    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) {
            element.setStyles(styles);
        }

        try {
            String url = icon.getNormalURL().getURL();
            element.setAttribute("src", url);
            String altText = getAltText(item);
            if (altText != null) {
                element.setAttribute("alt", altText);
            }
View Full Code Here

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

    public void testGetIcon() {
        MenuLabel label;

        // Test non-null configuration
        label = createTestInstance(null, true);
        MenuIcon testIcon = label.getIcon();
        assertNotNull("Icon should not be null", testIcon);

        // Test null configuration
        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);
        assertEquals("Icons should be the same", icon, testIcon);
View Full Code Here

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

    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");

        if (styles != null) {
            element.setStyles(styles);
        }

        String altText = getAltText(item);
        if (altText != null) {
            element.setAttribute("alt", altText);
        }

        try {
            String url;

            url = icon.getNormalURL().getURL();
            element.setAttribute("normal", url);

            url = icon.getOverURL().getURL();
            element.setAttribute("over", url);

        } catch (AssetReferenceException e) {
            throw new RendererException(e);
        }
View Full Code Here

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

     *                 over image
     * @return A menu icon
     */
    public MenuIcon createTestMenuIcon(ImageAssetReference url,
                                       boolean isNormal) {
        MenuIcon icon;
        if (isNormal) {
            icon = createTestMenuIcon(createTestElementDetails(), url,
                                      createImageAssetReference());
        } else {
            icon = createTestMenuIcon(createTestElementDetails(),
View Full Code Here

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

        // Assume that nothing will be written.
        MenuItemRenderedContent renderedContent = MenuItemRenderedContent.NONE;

        // Give up straight away if there is no icon for this menu item.
        // Note that this will potentially "break" the enclosing renderer.
        MenuIcon icon = item.getLabel().getIcon();
        if (icon != null) {
            ImageAssetReference imageRef = icon.getNormalURL();

            // set the url this item points to
            try {
                // Extract the url from the image
                String imageUrl = imageRef.getURL();
                // If we were able to get one
                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.MenuIcon

    // javadoc inherited
    public void startIcon() throws BuilderException {
        ConcreteMenuLabel parent = getCurrentMenuLabel();

        if (parent != null) {
            MenuIcon icon = parent.getIcon();

            if (icon == null) {
                icon = new ConcreteMenuIcon();

                parent.setIcon(icon);
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.