Package com.volantis.mcs.dissection

Examples of com.volantis.mcs.dissection.DissectableAreaAttributes


            ElementType type;

            if (localName.equals(DISSECTABLE_AREA)) {

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

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

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

                // Set the annotation and the type.
                annotation = attrs;
                type = DissectionElementTypes.getDissectableAreaType();

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

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

                // Initialise the attributes class.
                String after = attributes.getValue("forceBreakAfter");
                String before = attributes.getValue("forceBreakBefore");
                attrs.setForceBreakAfter("true".equalsIgnoreCase(after));
                attrs.setForceBreakBefore("true".equalsIgnoreCase(before));

                // Set the annotation and the type.
                annotation = attrs;
                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


        }
       
        if (type == null || type == DissectionElementTypes.getPlainElementType()) {
            // set no annotation
        } else if (type == DissectionElementTypes.getDissectableAreaType()) {
            DissectableAreaAttributes annotation = new DissectableAreaAttributes();
            annotation.setIdentity(
                    new DissectableAreaIdentity(
                            element.getAttributeValue(DissectionConstants.INCLUSION_PATH_ATTRIBUTE),
                            element.getAttributeValue(DissectionConstants.DISSECTING_PANE_NAME_ATTRIBUTE)));
            setNodeAnnotation(annotation);
        } else if (type == DissectionElementTypes.getKeepTogetherType()) {
View Full Code Here

        // Set the attributes associated with the dissectable contents.
        DissectableAreaIdentity identity
            = new DissectableAreaIdentity(attributes.getInclusionPath(),
                                          attributes.getDissectingPane()
                                          .getName());
        DissectableAreaAttributes dissectableAttributes
            = new DissectableAreaAttributes();
        dissectableAttributes.setIdentity(identity);
        element.setAnnotation(dissectableAttributes);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dissection.DissectableAreaAttributes

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.