Examples of ShardLinkAttributes


Examples of com.volantis.mcs.dissection.links.ShardLinkAttributes

                type = DissectionElementTypes.getKeepTogetherType();

            } else if (localName.equals(SHARD_LINK)) {

                // Create a new attributes class.
                ShardLinkAttributes attrs
                    = new ShardLinkAttributes();

                // Initialise the attributes class.
                String value = attributes.getValue("action");
                ShardLinkAction action;
                if (value.equals("next")) {
                    action = ShardLinkAction.NEXT;
                } else if (value.equals("previous")) {
                    action = ShardLinkAction.PREVIOUS;
                } else {
                    throw new IllegalArgumentException("Unknown action: "
                                                       + value);
                }
                attrs.setAction(action);
                attrs.setUserData(attributes.getValue("userData"));

                annotation = attrs;
                type = DissectionElementTypes.getShardLinkType();

            } else if (localName.equals(SHARD_LINK_GROUP)) {

                // Get the dissectable area identity.
                DissectableAreaIdentity identity
                    = getDissectableAreaIdentity(attributes);

                // Create a new attributes class.
                ShardLinkGroupAttributes attrs
                    = new ShardLinkGroupAttributes();

                // Initialise the attributes class.
                attrs.setDissectableArea(identity);

                annotation = attrs;
                type = DissectionElementTypes.getShardLinkGroupType();

            } else if (localName.equals(SHARD_LINK_CONDITIONAL)) {

                // Create a new attributes class.
                ShardLinkConditionalAttributes attrs
                    = new ShardLinkConditionalAttributes();

                // Initialise the attributes class.
                ShardLinkContentRule rule;
                String value = attributes.getValue("rule");
                if (value.equals("any")) {
                    rule = StandardContentRules.getAnyRule();
                } else if (value.equals("separator")) {
                    rule = StandardContentRules.getSeparatorRule();
                } else {
                    throw new IllegalArgumentException("Unknown rule: "
                                                       + value);
                }
                attrs.setContentRule(rule);

                annotation = attrs;
                type = DissectionElementTypes.getShardLinkConditionalType();

            } else {
View Full Code Here

Examples of com.volantis.mcs.dissection.links.ShardLinkAttributes

        output.writeText(content);
        text.setText(output);
        MenuLabel label = new ConcreteMenuLabel(null, text);

        // Create the shard link attributes
        ShardLinkAttributes shardLinkAttrs = new ShardLinkAttributes();
        if (isNextLink) {
            shardLinkAttrs.setAction(ShardLinkAction.NEXT);
        } else {
            shardLinkAttrs.setAction(ShardLinkAction.PREVIOUS);
        }

        // Create the menu item itself.
        ShardLinkMenuItem item =
                new ShardLinkMenuItem(createElementDetails(styles),
View Full Code Here

Examples of com.volantis.mcs.dissection.links.ShardLinkAttributes

            // A shard link element is treated as a single entity for sizing
            // and output.
            overheadCost.addShardLinkCost(document, element,
                                          pathologicalShardLinkDetails);

            ShardLinkAttributes attributes
                = (ShardLinkAttributes) document.getAnnotation(element);

            // Create the ShardLink and initialise it.
            ShardLinkActionImpl action
                = (ShardLinkActionImpl) attributes.getAction();
            ShardLink shardLink = new ShardLink();
            shardLink.setAction(action);

            // Create a linkage between the shard link and the area to which it
            // belongs.
View Full Code Here

Examples of com.volantis.mcs.protocols.ShardLinkAttributes

    public void testShardLinkStyleClass() throws Exception {
        privateSetUp();

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        ShardLinkAttributes attributes = new ShardLinkAttributes();
        attributes.setStyles(StylesBuilder.getDeprecatedStyles());
        Element anchor;
        Node node;

        buffer.initialise();
        attributes.setHref("http://www.volantis.com/page");
        attributes.setLinkText("Next");
        attributes.setShortcut("N");

        protocol.doShardLink(buffer, attributes);

        node = buffer.getCurrentElement().getHead();
View Full Code Here

Examples of com.volantis.mcs.protocols.ShardLinkAttributes

    public void testShardLinkStyleClass() throws Exception {
        privateSetUp();

        DOMOutputBuffer buffer = new DOMOutputBuffer();
        ShardLinkAttributes attributes = new ShardLinkAttributes();
        Element anchor;
        Node node;
        String styleClass;

        buffer.initialise();
        attributes.setHref("http://www.volantis.com/page");
        attributes.setLinkText("Next");
        attributes.setShortcut("N");
        // todo XDIME-CP style dissection correctly.
//        attributes.setStyleClass("shardlink");

        protocol.doShardLink(buffer, 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.