Package org.itsnat.impl.core.mut.doc

Examples of org.itsnat.impl.core.mut.doc.DocMutationEventListenerImpl


    }
   
    public void processResponse()
    {
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
        DocMutationEventListenerImpl mutListener = itsNatDoc.getDocMutationEventListener();

        String docMarkup = null;

        boolean serializeBefore = isSerializeBeforeDispatching();
        if (serializeBefore) // Caso fastLoad=false y remote control
        {
            mutListener.setEnabled(false); // Desactivamos totalmente pues hay muchos casos en los que antes de serializar necesitamos hacer cambios temporales en el DOM que no queremos que generen c�digo JavaScript
            preSerializeDocument();
            docMarkup = serializeDocument();
            mutListener.setEnabled(true); // Restauramos

            rewriteClientUIControlProperties();
        }

        dispatchRequestListeners();

        if (!serializeBefore) // Caso fast load
        {
            // En caso Fast Load DEBE ejecutarse despu�s de los listeners del
            // usuario porque el estado del DOM servidor en carga es el resultado
            // de ejecutar dichos listeners en el servidor que deben tambi�n
            // ejecutarse en JavaScript.
            rewriteClientUIControlProperties();

            mutListener.setEnabled(false); // Desactivamos totalmente pues hay muchos casos en los que antes de serializar necesitamos hacer cambios temporales en el DOM que no queremos que generen c�digo JavaScript
            preSerializeDocument();
            docMarkup = serializeDocument();
            mutListener.setEnabled(true); // Restauramos
        }

        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        if (clientDoc.isScriptingEnabled())
        {
View Full Code Here


                enableEventListeners(); // Hay que tener en cuenta que si no estuviera en el �rbol del documento dar�a error
            }
            else
            {
                // Es un componente preparado para ser a�adido y quitado del �rbol continuamente, es usado por ejemplo por los componentes usados como editores
                DocMutationEventListenerImpl mainListener = itsNatDoc.getDocMutationEventListener();
                mainListener.addBeforeAfterMutationRenderListener(node,this);
                this.hasMutationEventListener = true;

                ItsNatDocComponentManagerImpl compMgr = getItsNatComponentManagerImpl();
                compMgr.addExcludedNodeAsItsNatComponent(node); // Evita que un buildComponents lo a�ada, aunque el nodo no est� unido al �rbol no importa desde el punto de vista del registro de ItsNatDocument
            }
View Full Code Here

        compMgr.removeItsNatComponent(this,false);
        if (hasMutationEventListener)
        {
            ItsNatDocumentImpl itsNatDoc = getItsNatDocumentImpl();
            DocMutationEventListenerImpl mainListener = itsNatDoc.getDocMutationEventListener();
            Node node = getNode();
            mainListener.removeBeforeAfterMutationRenderListener(node,this);
            compMgr.removeExcludedNodeAsItsNatComponent(node);
        }
        this.disposed = true;
    }
View Full Code Here

        if (this.autoBuildComponents == value)
            return; // No cambia nada

        this.autoBuildComponents = value;

        DocMutationEventListenerImpl mutEventListener = getItsNatDocumentImpl().getDocMutationEventListener();
        AutoBuildCompBeforeAfterMutationRenderListener autoBuildListener;
        if (value)
            autoBuildListener = new AutoBuildCompBeforeAfterMutationRenderListener(this);
        else
            autoBuildListener = null;

        mutEventListener.setAutoBuildCompBeforeAfterMutationRenderListener(autoBuildListener);
    }
View Full Code Here

        // Si el componente creara/borrara nodos con posibles componentes en otro lugar diferente a bajo s� mismo
        // no se detectar�a pero no hay ning�n componente que haga esto.
        // En dicho caso se registrar�a antes este listener aunque ralentiza m�s pues hay que evitar
        // a�adir componentes cuando ya se han a�adido

        DocMutationEventListenerImpl mutEventListener = getItsNatDocumentImpl().getDocMutationEventListener();
        mutEventListener.setAutoBuildCompBeforeAfterMutationRenderListener(new AutoBuildCompBeforeAfterMutationRenderListener(this));
    }
View Full Code Here

        ItsNatSessionImpl itsNatSession = ItsNatSessionObjectInputStream.getItsNatSession(in);
        itsNatSession.addDeserialPendingTask(servletName,task); // Lo dejamos pendiente tras la deserializaci�n


        // Hay que tener en cuenta que los event listeners internos no se serializan
        DocMutationEventListenerImpl mutationListener = getDocMutationEventListener();

        ItsNatDocumentInternal doc = (ItsNatDocumentInternal)getDocument();
        doc.addEventListenerInternal("DOMNodeInserted",mutationListener,false);
        doc.addEventListenerInternal("DOMNodeRemoved",mutationListener,false);
        doc.addEventListenerInternal("DOMAttrModified",mutationListener,false);
View Full Code Here

        this.loading = false;
    }

    public void registerMutationListener()
    {
        DocMutationEventListenerImpl mutationListener = getDocMutationEventListener();

        ItsNatDocumentInternal doc = (ItsNatDocumentInternal)getDocument();
        doc.addEventListenerInternal("DOMNodeInserted",mutationListener,false);
        doc.addEventListenerInternal("DOMNodeRemoved",mutationListener,false);
        doc.addEventListenerInternal("DOMAttrModified",mutationListener,false);
View Full Code Here

            Element rootElem = getItsNatStfulDocument().getVisualRootElement();
            rootElem.appendChild(iframeElem);
        }

        // Llegados a este punto es seguro que el <iframe> est� en el documento
        DocMutationEventListenerImpl mainListener = clientDoc.getItsNatStfulDocument().getDocMutationEventListener();
        mainListener.addBeforeAfterMutationRenderListener(iframeElem,this);

        clientDoc.addHTMLIFrameFileUploadImpl(this);
        comp.addHTMLIFrameFileUploadImpl(this);

        StringBuilder code = new StringBuilder();
View Full Code Here

        synchronized(itsNatDoc) // Sincronizamos pues es apenas el �nico m�todo que se puede llamar y es llamado sin error durante la carga del archivo
        {
            if (disposed) return;

            HTMLIFrameElement iframeElem = comp.getHTMLIFrameElement();
            DocMutationEventListenerImpl mainListener = clientDoc.getItsNatStfulDocument().getDocMutationEventListener();
            mainListener.removeBeforeAfterMutationRenderListener(iframeElem,this);

            clientDoc.removeHTMLIFrameFileUploadImpl(this);
            comp.removeHTMLIFrameFileUploadImpl(this);

            this.disposed = true;
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.mut.doc.DocMutationEventListenerImpl

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.