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

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


        // Test legal configuration
        text.setText(testText);
        label = createTestInstance(MenuModelHelper.createElementDetails(),
                                   text,
                                   icon);
        MenuText testMenuText = label.getText();
        assertNotNull("Menu text should not be null", testMenuText);
        assertEquals("The menu texts should be the same", text, testMenuText);

        // Test method
        OutputBuffer secondTestText = new DOMOutputBuffer();
View Full Code Here


        textElement.append(testTextString);
        b.addTail(textElement);
        textBuffer.addElement(b);

        // Create the test text, label, and then the menu item
        MenuText text = entity.createTestMenuText(textBuffer);
        MenuLabel label = entity.createTestMenuLabel(text);
        MenuItem item = entity.createTestMenuItem(label);

        // Create test renderer object
        DefaultPlainTextMenuItemRenderer renderer =
View Full Code Here

    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) {
            element.setStyles(styles);
        }
        DOMOutputBuffer textOutputBuffer = (DOMOutputBuffer) text.getText();
        outputBuffer.addOutputBuffer(textOutputBuffer);
        outputBuffer.closeElement(element);
        lastElement = element;

        return MenuItemRenderedContent.TEXT;
View Full Code Here

     * @return The menu text, or null if alternate text should not be provided.
     */
    protected String getAltText(MenuItem item) {
        String altText = null;
        if (provideAltText) {
            MenuText menuText = item.getLabel().getText();
            OutputBuffer text = menuText.getText();
            altText = text.stringValue();
        }
        return altText;
    }
View Full Code Here

TOP

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

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.