Package org.itsnat.comp.layer

Examples of org.itsnat.comp.layer.ItsNatModalLayer


        return "modalLayer";
    }

    public ItsNatModalLayer createItsNatModalLayerHTML(Element element,NameValue[] artifacts,boolean execCreateFilters,ItsNatHTMLDocComponentManagerImpl compMgr)
    {
        ItsNatModalLayer comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatModalLayerHTMLImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here


        return comp;
    }

    public ItsNatModalLayer createItsNatModalLayerHTML(Element element,boolean clean, int zIndex, float opacity, String background, NameValue[] artifacts,boolean execCreateFilters,ItsNatHTMLDocComponentManagerImpl compMgr)
    {
        ItsNatModalLayer comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processBeforeCreateItsNatComponentListener(element,getCompType(),getParams(clean,zIndex,opacity,background),artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatModalLayerHTMLImpl(element,clean,zIndex,opacity,background,artifacts,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

        return comp;
    }

    public ItsNatModalLayer createItsNatModalLayerSVG(Element element,NameValue[] artifacts,boolean execCreateFilters,ItsNatSVGDocComponentManagerImpl compMgr)
    {
        ItsNatModalLayer comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatModalLayerSVGImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

        return comp;
    }

    public ItsNatModalLayer createItsNatModalLayerSVG(Element element,boolean clean,int zIndex, float opacity, String background, NameValue[] artifacts,boolean execCreateFilters,ItsNatSVGDocComponentManagerImpl compMgr)
    {
        ItsNatModalLayer comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processBeforeCreateItsNatComponentListener(element,getCompType(),getParams(clean,zIndex,opacity,background),artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatModalLayerSVGImpl(element,clean,zIndex,opacity,background,artifacts,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

        return comp;
    }

    public ItsNatModalLayer createItsNatModalLayerXUL(Element element,NameValue[] artifacts,boolean execCreateFilters,ItsNatXULDocComponentManagerImpl compMgr)
    {
        ItsNatModalLayer comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatModalLayerXULImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

        return comp;
    }

    public ItsNatModalLayer createItsNatModalLayerXUL(Element element,boolean clean,int zIndex, float opacity, String background, NameValue[] artifacts,boolean execCreateFilters,ItsNatXULDocComponentManagerImpl compMgr)
    {
        ItsNatModalLayer comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processBeforeCreateItsNatComponentListener(element,getCompType(),getParams(clean,zIndex,opacity,background),artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatModalLayerXULImpl(element,clean,zIndex,opacity,background,artifacts,compMgr);
        if (doFilters) comp = (ItsNatModalLayer)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here

        SPITutMainDocument spiTutDoc = parent.getSPITutMainDocument();
        ItsNatHTMLDocument itsNatDoc = parent.getItsNatHTMLDocument();
        HTMLDocument doc = itsNatDoc.getHTMLDocument();
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatModalLayer layer = compMgr.createItsNatModalLayer(null,false,1,0.5f,"black",null);
        Element parentLayer = layer.getElement();
        parentLayer.setAttribute("id","overviewPopupLayerContainerId");
       
        HTMLBodyElement body = (HTMLBodyElement)doc.getBody();

        DocumentFragment frag = spiTutDoc.loadDocumentFragment("overview.popup");
View Full Code Here

    }

    public void showModalView(String code,boolean cleanMode,int zIndex,float opacity,String background)
    {
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        final ItsNatModalLayer modalLayer = compMgr.createItsNatModalLayer(null,cleanMode,opacity,background,null);
        TestUtil.checkError(modalLayer.getZIndex() == zIndex); // Lo m�s probable es que se haya pulsado dos veces el link de crear los layers

        EventListener unexpEvtListener = new EventListenerSerial()
        {
            public void handleEvent(Event evt)
            {
                StringBuilder code = new StringBuilder();
                code.append("if (confirm('Received an unexpected event by a hidden element. Reload?')) ");
                code.append("  window.location.reload(true);");
               
                itsNatDoc.addCodeToSend(code.toString());
            }
        };
        modalLayer.addUnexpectedEventListener(unexpEvtListener);

        final HTMLDocument doc = itsNatDoc.getHTMLDocument();
        DocumentFragment frag = itsNatDoc.toDOM(code);
        final Element elem = (Element)frag.getFirstChild();
        doc.getBody().appendChild(elem);

        NodeList links = elem.getElementsByTagName("a");
        final HTMLAnchorElement linkExit = (HTMLAnchorElement)links.item(0);
        final HTMLAnchorElement linkCheckServ = (HTMLAnchorElement)links.item(1);

        // Link simplemente para actualizar el cliente con cambios en el servidor
        final EventListener listenerNothing = new EventListenerSerial()
        {
            public void handleEvent(Event evt)
            {
            }
        };
        ((EventTarget)linkCheckServ).addEventListener("click",listenerNothing,false);

        final HTMLSelectElement select = (HTMLSelectElement)elem.getElementsByTagName("select").item(0);
        final ItsNatHTMLSelectComboBox selectComp = (ItsNatHTMLSelectComboBox)compMgr.createItsNatComponent(select);
        DefaultComboBoxModel model = (DefaultComboBoxModel)selectComp.getComboBoxModel();
        model.addElement("One " + zIndex);
        model.addElement("Two " + zIndex);
        model.addElement("Three " + zIndex);
        model.addElement("Four " + zIndex);
        model.addElement("Five " + zIndex);

        NodeList inputList = elem.getElementsByTagName("input");

        final HTMLInputElement inputText = (HTMLInputElement)inputList.item(0);
        final ItsNatHTMLInputText inputTextComp = (ItsNatHTMLInputText)compMgr.createItsNatComponent(inputText);
        inputTextComp.setText("Hello");

        final HTMLTextAreaElement textArea = (HTMLTextAreaElement)elem.getElementsByTagName("textarea").item(0);
        final ItsNatHTMLTextArea textAreaComp = (ItsNatHTMLTextArea)compMgr.createItsNatComponent(textArea);
        textAreaComp.setText("Hello");

        final HTMLInputElement inputCheck = (HTMLInputElement)inputList.item(1);
        final ItsNatHTMLInputCheckBox inputCheckComp = (ItsNatHTMLInputCheckBox)compMgr.createItsNatComponent(inputCheck);
        inputCheckComp.setSelected(false);

        final HTMLInputElement inputRadio1 = (HTMLInputElement)inputList.item(2);
        final ItsNatHTMLInputRadio inputRadioComp1 = (ItsNatHTMLInputRadio)compMgr.createItsNatComponent(inputRadio1);
        inputRadioComp1.setSelected(false);

        final HTMLInputElement inputRadio2 = (HTMLInputElement)inputList.item(3);
        final ItsNatHTMLInputRadio inputRadioComp2 = (ItsNatHTMLInputRadio)compMgr.createItsNatComponent(inputRadio2);
        inputRadioComp2.setSelected(false);

        EventListener listenerExit = new EventListenerSerial()
        {
            public void handleEvent(Event evt)
            {
                selectComp.dispose();
                inputTextComp.dispose();
                textAreaComp.dispose();
                inputCheckComp.dispose();
                inputRadioComp1.dispose();
                inputRadioComp2.dispose();

                ((EventTarget)linkCheckServ).removeEventListener("click",listenerNothing,false);
                //((EventTarget)elem).removeEventListener("click",this,false);
                ((EventTarget)linkExit).removeEventListener("click",this,false);
                doc.getBody().removeChild(elem);
                modalLayer.dispose();
            }
        };

//        ((EventTarget)elem).addEventListener("click",listenerExit,false);
        ((EventTarget)linkExit).addEventListener("click",listenerExit,false);
View Full Code Here

    }

    public void showModalView(String code,boolean cleanMode,final int x,final int y)
    {
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        final ItsNatModalLayer modalLayer = compMgr.createItsNatModalLayer(null,cleanMode,1,null,null);
        final Element panel = modalLayer.getElement();

        panel.setAttribute("left",Integer.toString(x));
        panel.setAttribute("top",Integer.toString(y));

        DocumentFragment frag = itsNatDoc.toDOM(code);
        final Element elem = (Element)frag.getFirstChild(); // vbox
        panel.appendChild(elem);

        NodeList buttons = elem.getElementsByTagName("button");
        final Element buttonExit = (Element)buttons.item(0);

        final EventListener listenerExit = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                ((EventTarget)buttonExit).removeEventListener("command",this,false);
                modalLayer.dispose(); // Removes the <panel>
            }
        };
        ((EventTarget)buttonExit).addEventListener("command",listenerExit,false);

        EventListener listenerExit2 = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                ((EventTarget)buttonExit).removeEventListener("command",listenerExit,false);
                // The component is automatically disposed if pophidden event is enabled
            }
        };
        modalLayer.addEventListener("popuphidden",listenerExit2,true); // before

        EventListener listenerExit3 = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                // The component is automatically disposed if pophidden event is enabled
                if (!modalLayer.isDisposed()) throw new RuntimeException("TEST ERROR");
            }
        };
        modalLayer.addEventListener("popuphidden",listenerExit3,false); // after
    }
View Full Code Here

    }

    public void showModalView(String code,boolean cleanMode,float opacity,String background)
    {
        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        final ItsNatModalLayer modalLayer = compMgr.createItsNatModalLayer(null,cleanMode,opacity,background,null);

        final Document doc = itsNatDoc.getDocument();
        DocumentFragment frag = itsNatDoc.toDOM(code);
        final Element elem = (Element)frag.getFirstChild();
        doc.getDocumentElement().appendChild(elem);

        NodeList links = elem.getElementsByTagName("a");
        final Element linkExit = (Element)links.item(0);

        EventListener listenerExit = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                ((EventTarget)linkExit).removeEventListener("click",this,false);
                doc.getDocumentElement().removeChild(elem);
                modalLayer.dispose();
            }
        };

        ((EventTarget)linkExit).addEventListener("click",listenerExit,false);
    }
View Full Code Here

TOP

Related Classes of org.itsnat.comp.layer.ItsNatModalLayer

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.