Examples of WhiteSpaceFixStrategy


Examples of com.volantis.mcs.protocols.WhiteSpaceFixStrategy

        // Does the current element belong to the list of elements
        // that need to have some sort of space added?
        if (element.getPrevious() instanceof Text) {
            Text text = (Text) element.getPrevious();
            WhiteSpaceFixStrategy strategy =
                    getWhiteSpaceFixStrategy(element, true);
            int whitespaceCount = 0;
            if (strategy != null &&
                (whitespaceCount =
                    removeAndCountTrailingWhiteSpace(text)) > 0) {
                for (int i=0; i<whitespaceCount; i++) {
                    strategy.fixUpSpace(element, true);
                }
            }
        }

        if (element.getNext() instanceof Text) {
            Text text = (Text) element.getNext();
            WhiteSpaceFixStrategy strategy =
                    getWhiteSpaceFixStrategy(element, false);
            int whitespaceCount = 0;
            if (strategy != null &&
                    (whitespaceCount =
                    removeAndCountLeadingWhiteSpace(text)) > 0) {
                for (int i=0; i<whitespaceCount; i++) {
                    strategy.fixUpSpace(element, false);
                }
            }
        }

        // visit the children
View Full Code Here

Examples of com.volantis.mcs.protocols.WhiteSpaceFixStrategy

     * @return the <code>WhiteSpaceFixStrategy</code> or null if one is not
     * needed
     */
    private WhiteSpaceFixStrategy getWhiteSpaceFixStrategy(Element elmement,
                                                           boolean isOpen) {
        WhiteSpaceFixStrategy strategy = null;
        if (inlineStyleElements.contains(elmement.getName())) {
            strategy = (isOpen) ? openStyleStrategy : closeStyleStrategy;
        } else if (inlineLinkElements.contains(elmement.getName())) {
            strategy = (isOpen) ? openAnchorStrategy : closeAnchorStrategy;
        }
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.