Examples of ItsNatDOMException


Examples of org.itsnat.core.ItsNatDOMException

            case Node.ENTITY_REFERENCE_NODE:
                return JSRenderEntityReferenceImpl.SINGLETON;
            case Node.PROCESSING_INSTRUCTION_NODE:
                return JSRenderProcessingInstructionImpl.SINGLETON;
            case Node.DOCUMENT_NODE:
                throw new ItsNatDOMException("Unexpected Document node",node);
            case Node.DOCUMENT_TYPE_NODE:
                throw new ItsNatDOMException("Unexpected DocumentType node",node);
            case Node.ENTITY_NODE:
                throw new ItsNatDOMException("Unexpected Entity node",node);
            case Node.NOTATION_NODE:
                throw new ItsNatDOMException("Unexpected Notation node",node);
            case AbstractViewImpl.ABSTRACT_VIEW:
                return JSRenderAbstractViewImpl.SINGLETON;
        }

        throw new ItsNatDOMException("Internal error",node);
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

        {
            serializer.transform(source,result);
        }
        catch (TransformerException ex)
        {
            throw new ItsNatDOMException(ex,node);
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

                serializer.serialize(docFrag);
            }
        }
        catch(IOException ex)
        {
            throw new ItsNatDOMException(ex,node);
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

                    throw new RuntimeException("INTERNAL ERROR"); // Por si acaso
                if (content instanceof Node) // Nodo concreto
                {
                    Node childNode = (Node)content;
                    if (itsNatDoc.isDebugMode() && DOMUtilInternal.isNodeBoundToDocumentTree(childNode))
                        throw new ItsNatDOMException("Child nodes removed from a disconnected node cannot be reinserted in a different place on load phase and fast mode",childNode);
                    parentNode.appendChild(childNode);
                }
                else
                {
                    @SuppressWarnings("unchecked")
                    LinkedList<Node> nodeList = (LinkedList<Node>)content;
                    Iterator<Node> itChildNodes = nodeList.iterator();
                    DocumentFragment childNodesFragment = (DocumentFragment)itChildNodes.next(); // Sabemos que el primero es el DocumentFragment que se le dio al usuario
                    while(itChildNodes.hasNext())
                    {
                        Node childNode = itChildNodes.next();
                        if (itsNatDoc.isDebugMode() && DOMUtilInternal.isNodeBoundToDocumentTree(childNode))
                            throw new ItsNatDOMException("Child nodes removed from a disconnected node cannot be reinserted in a different place on load phase and fast mode",childNode);
                        parentNode.appendChild(childNode);
                    }
                    // Al mismo tiempo que los insertamos se eliminaron en teor�a del DocumentFragment que se dio al usuario y que los conten�a,
                    // lo comprobamos
                    if (childNodesFragment.hasChildNodes())
                        throw new ItsNatDOMException("DocumentFragment containing the child nodes removed from a disconnected node cannot be reinserted in a different place on load phase and fast mode",childNodesFragment);
                }
            }
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

        {
            serializer.serialize(node);
        }
        catch(IOException ex)
        {
            throw new ItsNatDOMException(ex,node);
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

        String value = dataTextToJS(textNode,clientDoc);

        Node parent = textNode.getParentNode();
        Node nextSibling = textNode.getNextSibling(); // Puede ser null
        if ((nextSibling != null)&& (nextSibling.getNodeType() == Node.TEXT_NODE))
            throw new ItsNatDOMException("Two contiguous text nodes, avoid this practice",textNode);
        // El programador tiene la oportunidad de unir ambos nodos de texto (por ejemplo con normalize o eliminado el siguiente y cambiando el valor del que queda)

        NodeLocationImpl parentLoc = clientDoc.getNodeLocation(parent,true);
        NodeLocationImpl nextSiblingLoc = clientDoc.getNodeLocationRelativeToParent(nextSibling);
        // Hay que tener en cuenta que nextSibling puede ser nulo
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

        // via DOM vale pero por coherencia no lo admitimos adem�s Safari ignora los estilos introducidos de esta manera.

        if (node instanceof HTMLTableRowElement)
        {
            if (node.getParentNode() instanceof HTMLTableRowElement)
                throw new ItsNatDOMException("A TR element must be inserted below a TBODY, THEAD or TFOOT",node);
        }
        else if (node instanceof HTMLStyleElement)
        {
             if (!(node.getParentNode() instanceof HTMLHeadElement))
                throw new ItsNatDOMException("A STYLE element must be inserted below HEAD",node);
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

                }
            }
            else if (node instanceof Text)
            {
                if (type.equals("DOMNodeInserted"))
                    throw new ItsNatDOMException("Add the text node to the <option> node before inserting to the tree",node);
                else
                    throw new ItsNatDOMException("The text node of the <option> cannot be removed, remove the <option> or change the value",node);
            }
            else
                throw new ItsNatDOMException("Unexpected node",node);
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

        else
        {
            this.builtInElement = false;
            this.boundToTree = DOMUtilInternal.isNodeInside(element,getItsNatDocument().getDocument());
            if (boundToTree && (element.getParentNode() != getVisualRootElement()))
                    throw new ItsNatDOMException("Provided element to the modal layer must be child of the visual root node (<body> in X/HTML)",element);
        }
    }
View Full Code Here

Examples of org.itsnat.core.ItsNatDOMException

        {
            HTMLTableElement htmlTableElem = (HTMLTableElement)tableElem;

            // Buscamos el tbody, debe existir
            HTMLTableSectionElement tBody = (HTMLTableSectionElement)ItsNatTreeWalker.getFirstChildElementWithTagNameNS(htmlTableElem,NamespaceUtil.XHTML_NAMESPACE,"tbody");
            if (tBody == null) throw new ItsNatDOMException("Missing <tbody>",htmlTableElem);
            return tBody;
        }
        else
        {
            // En el caso de tabla s�lo con body, �ste s�lo deber�a tener una s�la fila de patr�n
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.