Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Node


        Element br = null;

        // This is true when a line break needs to be added and false otherwise.
        boolean addLineBreak = false;

        Node next;
        for (Node node = element.getHead(); node != null; node = next) {
            next = getNextChild(node, element);

            if (node instanceof Element) {
                Element child = (Element) node;
View Full Code Here


        // This is true when a line break has been added before the current node.
        // This is initialised to true to prevent a line break being added at
        // the start.
        boolean addedLineBreak = true;

        Node next;
        for (Node node = element.getHead(); node != null; node = next) {
            next = getNextChild(node, element);

            if (node instanceof Element) {
                Element child = (Element) node;
View Full Code Here

        }

        Element wrapper = null;
        boolean containsBlock = false;
        boolean wrapperNeeded;
        Node next;

        for (Node child = card.getHead(); child != null;
             child = next) {
            next = getNextChild(child, card);
View Full Code Here

                if (logger.isDebugEnabled()) {
                    logger.debug("Found invalid " + element);
                }
                // Search for nested tr elements.
                boolean nextRow = false;
                Node rowNode = element.getHead();
                while (rowNode != null) {
                    if (rowNode instanceof Element) {
                        Element row = (Element) rowNode;
                        rowNode = rowNode.getNext();
                        if ("tr".equals(row.getName())) {
                            if (logger.isDebugEnabled()) {
                                logger.debug("Found invalid " + row);
                            }

                            // If we already did at least one row ...
                            if (nextRow) {
                                // ... then add a br element here to be
                                // consistent with the way that
                                // removeNestedTables works.
                                Element br = factory.createElement("br");
                                br.insertBefore(row);
                            }

                            // Search for nested td elements.
                            Node colNode = row.getHead();
                            while (colNode != null) {
                                if (colNode instanceof Element) {
                                    Element col = (Element) colNode;
                                    colNode = colNode.getNext();
                                    if ("td".equals(col.getName())) {
                                        if (logger.isDebugEnabled()) {
                                            logger.debug("Found invalid " +
                                                         col);
                                        }
View Full Code Here

     * @param element the element to delete.
     * @return the node that takes it place in the DOM (the first child), or
     *         null if there were no children.
     */
    private Node deleteElement(Element element) {
        Node firstChild = element.getHead();
        element.insertChildrenAfter(element);
        element.remove();
        return firstChild;
    }
View Full Code Here

        Element tr = null;
        Element td = null;

        if (element.getName().equals("table") && hasOneChild(element)) {
            Node trNode = element.getHead();
            if (trNode instanceof Element) {
                tr = (Element)trNode;

                if (hasOneChild(tr)) {
                    Node tdNode = tr.getHead();
                    if (tdNode instanceof Element) {
                        td = (Element)tdNode;
                    }
                }
            }
View Full Code Here

    private boolean containsATable(Element element) {

        boolean result = false;

        if (hasOneChild(element)) {
            Node nodeChild1 = element.getHead();
            if (nodeChild1 instanceof Element) {
                Element elementChild1 = (Element)nodeChild1;
                if (elementChild1.getName().equals("table")) {
                        result = true;
                    }
View Full Code Here

        if (backgroundColour != null) {

            outerElement.removeAttribute("bgcolor");

            Node child = outerElement.getHead();
            while (child != null) {
                if (child instanceof Element) {
                    Element elementChild = (Element)child;
                    if (elementChild.getAttributeValue("bgcolor") == null) {
                        elementChild.setAttribute("bgcolor", backgroundColour);
                    }
                }

                child = child.getNext();
            }

        }

View Full Code Here

        // Pop the output buffer from the stack. At this moment it contains the
        // content of the widget, which will be rendered to JavaScript string.
        domProtocol.getMarinerPageContext().popOutputBuffer(stringOutputBuffer);

        // Mark all elements in the output buffer as requiring to be transformed to text nodes.
        Node child = stringOutputBuffer.getRoot().getHead();
       
        while (child != null) {
            if (child instanceof Element) {
                domProtocol.setTransformToTextMarker((Element) child, true);
            }
           
            child = child.getNext();
        }
       
        // Transfer the content of the output buffer back to the current output buffer.
        getCurrentBuffer(protocol).addOutputBuffer(stringOutputBuffer);
View Full Code Here

            // of abstraction and doesn't seem particularly clear as to why it
            // does what it does. Potential candidate for re-write? jabley

            // Predicate Node that is being tested to see if it has a sibling.
            // We start off the the specified element itself; i.e. self.
            Node ancestorOrSelfWithSibling = element;

            // Set the ancestorOrSelfWithSibling to an element on that axis
            // with a sibling in the required direction (following or
            // preceding)
            while (!hasSibling(ancestorOrSelfWithSibling, following)) {

                // Get the parent instead
                ancestorOrSelfWithSibling = ancestorOrSelfWithSibling
                        .getParent();

                // Don't need to worry about whether the nearest sibling is
                // a text node if there is a div node between it and the
                // element to be removed.
                //
                // @todo jabley This seems to be some sort of duplicatation with removeInnerDiv?
                if (isDivElement(ancestorOrSelfWithSibling)) {
                    return true;
                }
            }

            Node sibling = getSiblingForRemovalTest(
                    ancestorOrSelfWithSibling,
                    following);
            return ((sibling == null) || isBlockyElement(sibling));
        }
        return false;
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.Node

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.