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

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


        // Create the test DOM for the text buffer
        TestDOMOutputBuffer menuText = new TestDOMOutputBuffer();
        menuText.appendEncoded(content);

        // Create the test text, label, and then the menu item
        final ConcreteMenuText text = new ConcreteMenuText(elementDetails);
        text.setText(menuText);
        final ConcreteMenuLabel label = new ConcreteMenuLabel(
                new ElementDetailsStub(), text);
        final ConcreteMenuItem item = new ConcreteMenuItem(
                new ElementDetailsStub(), label);
        item.setHref(new LiteralLinkAssetReference("the href"));
View Full Code Here


        // Extract the output from the menu item rendering as a string.
        return DOMUtilities.toString(buffer.getRoot());
    }

    protected MenuText createMenuText() {
        ConcreteMenuText text = new ConcreteMenuText(new ElementDetailsStub());
        DOMOutputBuffer textBuffer = new TestDOMOutputBuffer();
        textBuffer.writeText("[text]");
        text.setText(textBuffer);
        return text;
    }
View Full Code Here

     * @param buffer The buffer to use as the textual content
     * @return A menu text
     */
    public MenuText createTestMenuText(ElementDetails elementDetails,
                                       OutputBuffer buffer) {
        ConcreteMenuText text = new ConcreteMenuText(elementDetails);
        text.setText(buffer);
        return text;
    }
View Full Code Here

            String shortcut) {

        // Create the text in a label (both with no style info).
        DOMOutputBuffer output = (DOMOutputBuffer)
                outputBufferFactory.createOutputBuffer();
        ConcreteMenuText text = new ConcreteMenuText(null);
        output.writeText(content);
        text.setText(output);
        MenuLabel label = new ConcreteMenuLabel(null, text);

        // Create the shard link attributes
        ShardLinkAttributes shardLinkAttrs = new ShardLinkAttributes();
        if (isNextLink) {
View Full Code Here

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

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

View Full Code Here

        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);
                push(item);
            } else {
                reportBadParent(MenuItem.class);
            }
View Full Code Here

        // May appear in menus or menu items (the latter always has one)
        // @todo later could use an interface common to the two target classes
        if (parentMenu != null) {
            ConcreteMenuLabel label = new ConcreteMenuLabel(
                    new ConcreteElementDetails(), new ConcreteMenuText());

            parentMenu.setLabel(label);
            push(label);
        } else {
            ConcreteMenuItem item = getCurrentMenuItem();
View Full Code Here

        }
    }

    // javadoc inherited
    public void endText() throws BuilderException {
        ConcreteMenuText text = getCurrentMenuText();

        if (text != null) {
            checkText(text);

            pop();
View Full Code Here

        }
    }

    // javadoc inherited
    public void setText(OutputBuffer text) throws BuilderException {
        ConcreteMenuText menuText = getCurrentMenuText();

        if (menuText != null) {
            try {
                menuText.setText(text);
            } catch (Exception e) {
                throw new BuilderException(e);
            }
        } else {
            reportBadParent("text");
View Full Code Here

TOP

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

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.