Package org.itsnat.comp.button.toggle

Examples of org.itsnat.comp.button.toggle.ItsNatHTMLInputRadio


        return null;
    }

    public ItsNatHTMLInputRadio createItsNatHTMLInputRadio(HTMLInputElement element,NameValue[] artifacts,boolean execCreateFilters,ItsNatStfulDocComponentManagerImpl compMgr)
    {
        ItsNatHTMLInputRadio comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatHTMLInputRadio)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatHTMLInputRadioImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatHTMLInputRadio)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here


    {
        Document doc = itsNatDoc.getDocument();
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();

        HTMLInputElement inputElem1 = (HTMLInputElement)doc.getElementById("radioId1");
        ItsNatHTMLInputRadio input1 = (ItsNatHTMLInputRadio)componentMgr.findItsNatComponent(inputElem1);
        HTMLInputElement inputElem2 = (HTMLInputElement)doc.getElementById("radioId2");
        ItsNatHTMLInputRadio input2 = (ItsNatHTMLInputRadio)componentMgr.findItsNatComponent(inputElem2);
        HTMLInputElement inputElem3 = (HTMLInputElement)doc.getElementById("radioId3");
        ItsNatHTMLInputRadio input3 = (ItsNatHTMLInputRadio)componentMgr.findItsNatComponent(inputElem3);

        // Chequeamos que forman ya grupo a trav�s del atributo name
        ItsNatButtonGroup itsNatGrp = input1.getItsNatButtonGroup();
        ButtonGroup group = itsNatGrp.getButtonGroup();
        TestUtil.checkError(input2.getItsNatButtonGroup() == itsNatGrp);
        TestUtil.checkError(input3.getItsNatButtonGroup() == itsNatGrp);
        TestUtil.checkError(input2.getItsNatButtonGroup().getButtonGroup() == group);
        TestUtil.checkError(input3.getItsNatButtonGroup().getButtonGroup() == group);

        TestUtil.checkError(input1.getToggleButtonModel().getGroup() == group);
        TestUtil.checkError(input2.getToggleButtonModel().getGroup() == group);
        TestUtil.checkError(input3.getToggleButtonModel().getGroup() == group);

        ToggleButtonModel dataModel1 = new ToggleButtonModel();
        input1.setButtonModel(dataModel1);
        ToggleButtonModel dataModel2 = new ToggleButtonModel();
        input2.setButtonModel(dataModel2);
        ToggleButtonModel dataModel3 = new ToggleButtonModel();
        input3.setButtonModel(dataModel3);

        group = new ButtonGroup();
        ItsNatButtonGroup htmlGroup = componentMgr.getItsNatButtonGroup(group);
        htmlGroup.addButton(input1);
        htmlGroup.addButton(input2);
        htmlGroup.addButton(input3);

        TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(group));
        TestUtil.checkError(htmlGroup == componentMgr.getItsNatButtonGroup(htmlGroup.getName()));

        TestUtil.checkError(input1.getItsNatButtonGroup().getButtonCount() == 3);

        TestHTMLInputRadio listener1 = new TestHTMLInputRadio("1",itsNatDoc);
        input1.addEventListener("click",listener1);
        dataModel1.addChangeListener(listener1);

        TestHTMLInputRadio listener2 = new TestHTMLInputRadio("2",itsNatDoc);
        input2.addEventListener("click",listener2);
        dataModel2.addChangeListener(listener2);

        TestHTMLInputRadio listener3 = new TestHTMLInputRadio("3",itsNatDoc);
        input3.addEventListener("click",listener3);
        dataModel3.addChangeListener(listener3);
    }
View Full Code Here

        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);
View Full Code Here

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

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

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

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

                ((EventTarget)linkExit).removeEventListener("click",this,false);
                doc.getBody().removeChild(elem);
                modalLayer.dispose();
            }
View Full Code Here

        // Toggle Buttons

        ItsNatHTMLInputCheckBox inputCheckBox = (ItsNatHTMLInputCheckBox)compMgr.findItsNatComponentById("inputCheckBoxId");
        check(inputCheckBox);

        ItsNatHTMLInputRadio inputRadio = (ItsNatHTMLInputRadio)compMgr.findItsNatComponentById("inputRadioButtonId");
        check(inputRadio);

        ItsNatFreeCheckBox freeCheckBox = (ItsNatFreeCheckBox)compMgr.findItsNatComponentById("freeCheckBoxId");
        check(freeCheckBox);
View Full Code Here

    public static void BUTTONS_TOGGLE_BUTTONS()
    {
        ItsNatDocument itsNatDoc = null;
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();

        final ItsNatHTMLInputRadio inputComp1 = (ItsNatHTMLInputRadio)componentMgr.createItsNatComponentById("inputId1");
        final ItsNatHTMLInputRadio inputComp2 = (ItsNatHTMLInputRadio)componentMgr.createItsNatComponentById("inputId2");

        EventListener evtListener = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                EventTarget currentTarget = evt.getCurrentTarget();
                String button;
                if (currentTarget == inputComp1.getHTMLInputElement())
                    button = "button 1";
                else
                    button = "button 2";

                System.out.println("Clicked " + button);
            }
        };

        inputComp1.addEventListener("click",evtListener);
        inputComp2.addEventListener("click",evtListener);

        ItsNatButtonGroup itsNatGrp1 = inputComp1.getItsNatButtonGroup();
        ItsNatButtonGroup itsNatGrp2 = inputComp2.getItsNatButtonGroup();
        if ( ((itsNatGrp1 == null) || (itsNatGrp2 == null)) ||
             (itsNatGrp1.getButtonGroup() != itsNatGrp2.getButtonGroup()) )
        {
            ButtonGroup group = new ButtonGroup();
            ItsNatButtonGroup htmlGroup = componentMgr.getItsNatButtonGroup(group);
            htmlGroup.addButton(inputComp1);
            htmlGroup.addButton(inputComp2);
        }

        ToggleButtonModel dataModel1 = inputComp1.getToggleButtonModel();
        ToggleButtonModel dataModel2 = inputComp2.getToggleButtonModel();

        ActionListener actListener = new ActionListener()
        {
            public void actionPerformed(ActionEvent e)
            {
View Full Code Here

TOP

Related Classes of org.itsnat.comp.button.toggle.ItsNatHTMLInputRadio

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.